Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ncik-roberts committed Aug 14, 2024
1 parent 240f8aa commit ac53d63
Show file tree
Hide file tree
Showing 129 changed files with 7,458 additions and 75,407 deletions.
30 changes: 0 additions & 30 deletions emacs/merlin.el
Original file line number Diff line number Diff line change
Expand Up @@ -1791,17 +1791,10 @@ Empty string defaults to jumping to all these."
(dolist (pos positions)
(let* ((start (assoc 'start pos))
(end (assoc 'end pos))
<<<<<<< HEAD
(occ-buff (find-file-noselect (cdr (assoc 'file pos))))
(marker (with-current-buffer occ-buff
(copy-marker (merlin--point-of-pos start))))
||||||| fcc3157ab0
=======
(file (cdr (assoc 'file pos)))
(occ-buff (if file (find-file-noselect file) src-buff))
(marker (with-current-buffer occ-buff
(copy-marker (merlin--point-of-pos start))))
>>>>>>> 501-plus-upstream-main-9fa77db
(line (cdr (assoc 'line start)))
(start-buf-pos (with-current-buffer occ-buff
(merlin--point-of-pos start)))
Expand All @@ -1817,15 +1810,7 @@ Empty string defaults to jumping to all these."
marker
start-buf-pos
end-buf-pos
<<<<<<< HEAD
occ-buff))))

||||||| fcc3157ab0
src-buff))))

=======
occ-buff))))
>>>>>>> 501-plus-upstream-main-9fa77db
;; Insert the critical text properties that occur-mode
;; makes use of
(add-text-properties start-offset
Expand All @@ -1842,20 +1827,6 @@ Empty string defaults to jumping to all these."
(or (not (equal line pending-line))
(not (equal previous-buf occ-buff))))
(insert pending-lines-text))
<<<<<<< HEAD

(when (not (equal previous-buf occ-buff))
(insert (propertize (format "Occurrences in buffer: %s"
;(length lst)
occ-buff)
'font-lock-face
list-matching-lines-buffer-name-face
'read-only t
'occur-title occ-buff))
(insert "\n"))

||||||| fcc3157ab0
=======

(when (not (equal previous-buf occ-buff))
(insert (propertize (format "Occurrences in buffer %s:"
Expand All @@ -1867,7 +1838,6 @@ Empty string defaults to jumping to all these."
'occur-title occ-buff))
(insert "\n"))

>>>>>>> 501-plus-upstream-main-9fa77db
(setq pending-line line)
(setq previous-buf occ-buff)
(setq pending-lines-text lines-text)))
Expand Down
84 changes: 0 additions & 84 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

91 changes: 0 additions & 91 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,93 +1,3 @@
<<<<<<< HEAD
{
description = "Merlin Nix Flake";

inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:nixos/nixpkgs";
inputs.menhir-repository = {
url = "gitlab:fpottier/menhir/20201216?host=gitlab.inria.fr";
flake = false;
};

outputs = { self, nixpkgs, flake-utils, menhir-repository }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}".extend (_: super: {
ocamlPackages = super.ocamlPackages.overrideScope' (_: osuper: {
menhirLib = osuper.menhirLib.overrideAttrs (_: {
version = "20201216";
src = menhir-repository;
});
});
});
inherit (pkgs.ocamlPackages) buildDunePackage;
in
rec {
packages = rec {
default = merlin;
merlin-lib = buildDunePackage {
pname = "merlin-lib";
version = "dev";
src = ./.;
duneVersion = "3";
propagatedBuildInputs = with pkgs.ocamlPackages; [
csexp
];
doCheck = true;
};
dot-merlin-reader = buildDunePackage {
pname = "dot-merlin-reader";
version = "dev";
src = ./.;
duneVersion = "3";
propagatedBuildInputs = [
pkgs.ocamlPackages.findlib
];
buildInputs = [
merlin-lib
];
doCheck = true;
};
merlin = buildDunePackage {
pname = "merlin";
version = "dev";
src = ./.;
duneVersion = "3";
buildInputs = [
merlin-lib
dot-merlin-reader
pkgs.ocamlPackages.menhirLib
pkgs.ocamlPackages.menhirSdk
pkgs.ocamlPackages.yojson
];
nativeBuildInputs = [
pkgs.ocamlPackages.menhir
pkgs.jq
];
nativeCheckInputs = [ dot-merlin-reader ];
checkInputs = with pkgs.ocamlPackages; [
ppxlib
];
doCheck = true;
checkPhase = ''
runHook preCheck
patchShebangs tests/merlin-wrapper
dune build @check @runtest
runHook postCheck
'';
meta = with pkgs; {
mainProgram = "ocamlmerlin";
};
};
};
devShells.default = pkgs.mkShell {
inputsFrom = pkgs.lib.attrValues packages;
buildInputs = with pkgs.ocamlPackages; [ ocaml-lsp ];
};
});
}
||||||| fcc3157ab0
=======
{
description = "Merlin Nix Flake";

Expand Down Expand Up @@ -172,4 +82,3 @@
};
});
}
>>>>>>> 501-plus-upstream-main-9fa77db
57 changes: 1 addition & 56 deletions src/analysis/ast_iterators.ml
Original file line number Diff line number Diff line change
@@ -1,57 +1,3 @@
<<<<<<< HEAD
open Std
open Typedtree

let {Logger. log} = Logger.for_section "iterators"

(* The compiler contains an iterator that aims to gather definitions but
ignores local values like let-in expressions and local type definition. To
provide occurrences in the active buffer we extend the compiler's iterator with
these cases. *)
let iter_on_defs ~uid_to_locs_tbl =
let log = log ~title:"iter_on_defs" in
let register_uid uid fragment =
let loc = Misc_utils.loc_of_decl ~uid fragment in
Option.iter loc ~f:(fun loc ->
Types.Uid.Tbl.add uid_to_locs_tbl uid loc)
in
let iter_decl = Cmt_format.iter_on_declarations ~f:register_uid in
let register_uid uid loc =
Types.Uid.Tbl.add uid_to_locs_tbl uid loc
in
{ iter_decl with
expr = (fun sub ({ exp_extra; _ } as expr) ->
List.iter exp_extra ~f:(fun (exp_extra, _loc, _attr) ->
match exp_extra with
| Texp_newtype' (typ_id, typ_name, _, uid) ->
log "Found newtype %s wit id %a (%a)\n%!" typ_name.txt
Logger.fmt (Fun.flip Ident.print_with_scope typ_id)
Logger.fmt (fun fmt -> Location.print_loc fmt typ_name.loc);
register_uid uid typ_name;
()
| _ -> ());
iter_decl.expr sub expr);
}

let build_uid_to_locs_tbl ~(local_defs : Mtyper.typedtree) () =
let uid_to_locs_tbl : string Location.loc Types.Uid.Tbl.t =
Types.Uid.Tbl.create 64
in
let iter = iter_on_defs ~uid_to_locs_tbl in
begin match local_defs with
| `Interface sign ->
iter.signature iter sign
| `Implementation str ->
iter.structure iter str end;
uid_to_locs_tbl

let iter_on_usages ~f (local_defs : Mtyper.typedtree) =
let iter = Cmt_format.iter_on_occurrences ~f in
begin match local_defs with
| `Interface signature -> iter.signature iter signature
| `Implementation structure -> iter.structure iter structure end
||||||| fcc3157ab0
=======
open Std
open Typedtree

Expand Down Expand Up @@ -165,7 +111,7 @@ let iter_on_defs ~uid_to_locs_tbl =
expr = (fun sub ({ exp_extra; _ } as expr) ->
List.iter exp_extra ~f:(fun (exp_extra, _loc, _attr) ->
match exp_extra with
| Texp_newtype' (typ_id, typ_name, uid) ->
| Texp_newtype' (typ_id, typ_name, _, uid) ->
log "Found newtype %s wit id %a (%a)\n%!" typ_name.txt
Logger.fmt (Fun.flip Ident.print_with_scope typ_id)
Logger.fmt (fun fmt -> Location.print_loc fmt typ_name.loc);
Expand Down Expand Up @@ -197,4 +143,3 @@ let iter_on_usages ~f (local_defs : Mtyper.typedtree) =
let iterator_on_usages ~f =
let occ_iter = Cmt_format.iter_on_occurrences ~f in
iter_only_visible occ_iter
>>>>>>> 501-plus-upstream-main-9fa77db
6 changes: 0 additions & 6 deletions src/analysis/completion.ml
Original file line number Diff line number Diff line change
Expand Up @@ -660,15 +660,9 @@ let branch_complete buffer ?get_doc ?target_type ?kinds ~keywords prefix =
let lbls = Datarepr.labels_of_type p decl in
let labels = List.map lbls ~f:(fun (_,lbl) ->
try
<<<<<<< HEAD
let _, lbl_arg, lbl_res = Ctype.instance_label ~fixed:false lbl in
||||||| fcc3157ab0
let _, lbl_arg, lbl_res = Ctype.instance_label false lbl in
=======
let _, lbl_arg, lbl_res =
Ctype.instance_label ~fixed:false lbl
in
>>>>>>> 501-plus-upstream-main-9fa77db
begin try
Ctype.unify_var env ty lbl_res;
with _ -> ()
Expand Down
Loading

0 comments on commit ac53d63

Please sign in to comment.