Comments (7)
@hrsh7th thanks for your reminder, after I change the result of the single-character response, it works. I'll send a PR for lexical.
from cmp-nvim-lsp.
Thank you detailed response.
Hmm. . . Let's track how VSCode handles null return values for textDocument/completion.
Also, I think the server should return isIncomplete=true instead of just returning null. What are your thoughts on this?
from cmp-nvim-lsp.
Can you upload the example LSP?
from cmp-nvim-lsp.
If that's true, I think it could be a bug in the LSP server.
Which language server are you having problems with?
from cmp-nvim-lsp.
If that's true, I think it could be a bug in the LSP server.
Which language server are you having problems with?
I'm using Lexical, I'm the committer too. We intentionally don't allow one character completion: https://github.com/lexical-lsp/lexical/blob/main/apps/server/lib/lexical/server/code_intelligence/completion.ex#L69
I don't think it's a server-side bug because VScode and Emacs work fine.
from cmp-nvim-lsp.
This is the code, when I type S
(send completion request), and t
(only send didChange
request)
and this is the log
[DEBUG][2023-04-25 18:23:40] .../vim/lsp/rpc.lua:284 "rpc.send" {
id = 2,
jsonrpc = "2.0",
method = "textDocument/completion",
params = {
context = {
triggerKind = 1
},
position = {
character = 5,
line = 3
},
textDocument = {
uri = "file:///Users/scottming/Code/dummy/lib/dummy.ex"
}
}
}
[DEBUG][2023-04-25 18:23:40] .../vim/lsp/rpc.lua:387 "rpc.receive" {
id = 2,
jsonrpc = "2.0",
result = {}
}
[DEBUG][2023-04-25 18:23:40] .../vim/lsp/rpc.lua:387 "rpc.receive" {
jsonrpc = "2.0",
method = "textDocument/publishDiagnostics",
params = {
diagnostics = {},
uri = "file:///Users/scottming/Code/dummy/lib/dummy.ex"
}
}
[DEBUG][2023-04-25 18:23:41] .../vim/lsp/rpc.lua:284 "rpc.send" {
jsonrpc = "2.0",
method = "textDocument/didChange",
params = {
contentChanges = { {
range = {
["end"] = {
character = 5,
line = 3
},
start = {
character = 5,
line = 3
}
},
rangeLength = 0,
text = "t"
} },
textDocument = {
uri = "file:///Users/scottming/Code/dummy/lib/dummy.ex",
version = 12
}
}
}
[DEBUG][2023-04-25 18:23:41] .../vim/lsp/rpc.lua:387 "rpc.receive" {
jsonrpc = "2.0",
method = "textDocument/publishDiagnostics",
params = {
diagnostics = {},
uri = "file:///Users/scottming/Code/dummy/lib/dummy.ex"
}
}
Above is the behavior of neovim, and below is VScode
from cmp-nvim-lsp.
Also, I think the server should return isIncomplete=true instead of just returning null. What are your thoughts on this?
I think what you said makes sense.
for speed clients should be able to filter an already received completion list if the user continues typing. Servers can opt out of this using a CompletionList and mark it as isIncomplete.
Let me try to return a struct like
{isIncomplete: true, items: []}
from cmp-nvim-lsp.
Related Issues (20)
- Filter some suggestions provided by cmp-nvim-lsp HOT 1
- Cause lags / delay with Telescope & UI
- Hide warning and error show on editor HOT 3
- LSP suggestions don't appear in certain files, although LS loaded
- migrate to Lazy.nvim and module 'cmp_nvim_lsp' not found HOT 1
- Filter out suggestion based on current typing characters HOT 1
- Error thrown when using omnicompletion HOT 1
- How to show "Auto import from ..." in the documentation window?
- lsp completion items not updating unless I restart the server HOT 7
- `#` symbol doesn't start the cmp menu in a CSS property
- Option to exclude a client completely
- How to install cmp-nvim-lsp HOT 2
- Use of after directory, antipattern.
- entry_filter has no effect
- Confirmation behavior `Insert` does not work
- HTML & CSS LSP Autocompletion isn't working
- Can't stop suggestion box from closing when entering whitespace
- cmp_nvim_lsp not found HOT 3
- Disable JSX snippets HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmp-nvim-lsp.