-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
disable trigger-character completions and signature in comments
- Loading branch information
1 parent
c2046a2
commit ad1ade4
Showing
7 changed files
with
126 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
open Import | ||
|
||
let position_in_comment ~position ~merlin = | ||
let loc_contains_position (_, (loc : Loc.t)) = | ||
let start = Position.of_lexical_position loc.loc_start in | ||
let end_ = Position.of_lexical_position loc.loc_end in | ||
match Option.both start end_ with | ||
| Some (start, end_) -> ( | ||
let range = Range.create ~start ~end_ in | ||
match Position.compare_inclusion position range with | ||
| `Inside -> true | ||
| `Outside _ -> false) | ||
| None -> false | ||
in | ||
Document.Merlin.with_pipeline_exn ~name:"get-comments" merlin (fun pipeline -> | ||
Mpipeline.reader_comments pipeline |> List.exists ~f:loc_contains_position) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(** Returns [true] if [position] occurs inside a comment in the document *) | ||
val position_in_comment : | ||
position:Position.t -> merlin:Document.Merlin.t -> bool Fiber.t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters