Skip to content

Commit

Permalink
Some LSP fixes (#680)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgolsson authored Mar 21, 2024
1 parent c89ac4f commit fc2bc0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions crates/rune/src/languageserver/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ pub(super) fn complete_native_instance_data(
let docs = meta.docs.lines().join("\n");
let args = meta.docs.args().unwrap_or_default().join(", ");

let detail = return_type.map(|r| format!("({args} -> {r}"));
let detail = return_type.map(|r| format!("({args}) -> {r}"));

results.try_push(CompletionItem {
label: n.try_to_string()?.into_std(),
Expand All @@ -146,7 +146,7 @@ pub(super) fn complete_native_instance_data(
detail: None,
description: Some(prefix.try_to_string()?.into_std()),
}),
data: Some(serde_json::to_value(meta.hash).unwrap()),
data: Some(serde_json::to_value(meta.hash.into_inner() as i64).unwrap()),
..Default::default()
})?;
}
Expand Down Expand Up @@ -201,7 +201,7 @@ pub(super) fn complete_native_loose_data(
},
new_text: func_name.into_std(),
})),
data: Some(serde_json::to_value(meta.hash).unwrap()),
data: Some(serde_json::to_value(meta.hash.into_inner() as i64).unwrap()),
..Default::default()
})?;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/rune/src/languageserver/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ impl Source {

// The set of tokens that delimit symbols.
let x: &[_] = &[
',', ';', '(', '.', '=', '+', '-', '*', '/', '}', '{', ']', '[', ')', ':',
',', ';', '(', '.', '=', '+', '-', '*', '/', '}', '{', ']', '[', ')',
];

let end_search = (offset - start_byte + 1).min(chunk.len());
Expand Down

0 comments on commit fc2bc0c

Please sign in to comment.