lsp: Provide completion reason in the request (#12893)
This should help LS make a better call about the completions it should return back to the caller. For example, it speeds up import completions for typescript. Before: https://github.com/zed-industries/zed/assets/24362066/b38fd565-f9ff-4db7-a87f-c3b31a9fdc96 after: https://github.com/zed-industries/zed/assets/24362066/d4fbc9ae-9aab-4543-b9f6-16acf1619576 This should be merged after 06.12 Preview to give it some time on Nightly. Release Notes: - N/A
This commit is contained in:
parent
eb7b5a7131
commit
0a13b9ee01
12 changed files with 86 additions and 26 deletions
|
@ -2499,7 +2499,7 @@ async fn test_completions_without_edit_ranges(cx: &mut gpui::TestAppContext) {
|
|||
let text = "let a = b.fqn";
|
||||
buffer.update(cx, |buffer, cx| buffer.set_text(text, cx));
|
||||
let completions = project.update(cx, |project, cx| {
|
||||
project.completions(&buffer, text.len(), cx)
|
||||
project.completions(&buffer, text.len(), DEFAULT_COMPLETION_CONTEXT, cx)
|
||||
});
|
||||
|
||||
fake_server
|
||||
|
@ -2526,7 +2526,7 @@ async fn test_completions_without_edit_ranges(cx: &mut gpui::TestAppContext) {
|
|||
let text = "let a = \"atoms/cmp\"";
|
||||
buffer.update(cx, |buffer, cx| buffer.set_text(text, cx));
|
||||
let completions = project.update(cx, |project, cx| {
|
||||
project.completions(&buffer, text.len() - 1, cx)
|
||||
project.completions(&buffer, text.len() - 1, DEFAULT_COMPLETION_CONTEXT, cx)
|
||||
});
|
||||
|
||||
fake_server
|
||||
|
@ -2591,7 +2591,7 @@ async fn test_completions_with_carriage_returns(cx: &mut gpui::TestAppContext) {
|
|||
let text = "let a = b.fqn";
|
||||
buffer.update(cx, |buffer, cx| buffer.set_text(text, cx));
|
||||
let completions = project.update(cx, |project, cx| {
|
||||
project.completions(&buffer, text.len(), cx)
|
||||
project.completions(&buffer, text.len(), DEFAULT_COMPLETION_CONTEXT, cx)
|
||||
});
|
||||
|
||||
fake_server
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue