Skip to content

Commit

Permalink
chore: Make Module.* completion work properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
spotandjake committed Jan 2, 2024
1 parent 479b596 commit cc04f00
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions compiler/src/language_server/completion.re
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ let find_completable_state = (documents, uri, position: Protocol.position) => {
if (has_hit_info) {
Some(
CompletableExpr(
String_utils.slice(~first=curr_offset, ~last=offset, source),
String_utils.slice(~first=slice_offset, ~last=offset, source),
),
);
} else {
Expand All @@ -166,7 +166,7 @@ let find_completable_state = (documents, uri, position: Protocol.position) => {
if (has_hit_info) {
Some(
CompletableType(
String_utils.slice(~first=curr_offset, ~last=offset, source),
String_utils.slice(~first=slice_offset, ~last=offset, source),
),
);
} else {
Expand All @@ -175,7 +175,7 @@ let find_completable_state = (documents, uri, position: Protocol.position) => {
| ['\n', ...rest] when !has_hit_info =>
Some(
ComletableCode(
String_utils.slice(~first=curr_offset, ~last=offset, source),
String_utils.slice(~first=slice_offset, ~last=offset, source),
),
)
// Whitespace
Expand Down Expand Up @@ -500,7 +500,7 @@ let process =
| Some(completableState) =>
switch (completableState) {
| ComletableCode(str) =>
Trace.log("Completable: Code " ++ str);
let str = String.trim(str);
let completionPath = String.split_on_char('.', str);
get_top_level_completions(
~include_keywords=true,
Expand All @@ -511,7 +511,7 @@ let process =
completionPath,
);
| CompletableExpr(str) =>
Trace.log("Completable: Expr " ++ str);
let str = String.trim(str);
let completionPath = String.split_on_char('.', str);
get_top_level_completions(
~include_keywords=false,
Expand All @@ -522,7 +522,7 @@ let process =
completionPath,
);
| CompletableType(str) =>
Trace.log("Completable: Type " ++ str);
let str = String.trim(str);
let completionPath = String.split_on_char('.', str);
get_top_level_completions(
~include_keywords=false,
Expand Down

0 comments on commit cc04f00

Please sign in to comment.