Skip to content

Commit

Permalink
Make in keyword completion less aggressive
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoos committed Aug 23, 2024
1 parent c894916 commit 211b094
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
2 changes: 1 addition & 1 deletion ocaml-lsp-server/src/compl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ module Complete_by_prefix = struct

let complete_keywords completion_position prefix =
match prefix with
| "" | "i" | "in" ->
| "i" | "in" ->
let ci_for_in =
CompletionItem.create
~label:"in"
Expand Down
24 changes: 1 addition & 23 deletions ocaml-lsp-server/test/e2e-new/completion.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1100,21 +1100,10 @@ let%expect_test "completion for `in` keyword - no prefix" =
let foo param1 =
let bar = param1 |ocaml} in
let position = Position.create ~line:2 ~character:19 in
print_completions ~limit:3 source position;
print_completions ~limit:2 source position;
[%expect
{|
Completions:
{
"kind": 14,
"label": "in",
"textEdit": {
"newText": "in",
"range": {
"end": { "character": 19, "line": 2 },
"start": { "character": 19, "line": 2 }
}
}
}
{
"detail": "'a -> 'b",
"kind": 12,
Expand Down Expand Up @@ -1252,17 +1241,6 @@ let%expect_test "completion for object methods" =
[%expect
{|
Completions:
{
"kind": 14,
"label": "in",
"textEdit": {
"newText": "in",
"range": {
"end": { "character": 34, "line": 0 },
"start": { "character": 34, "line": 0 }
}
}
}
{
"detail": "'a",
"kind": 2,
Expand Down

0 comments on commit 211b094

Please sign in to comment.