Describe the bug
I configured a custom language server for dart. It is starting up and displaying some auto completions. However it is just displaying auto completions when I type in a new line, not after i have some variable/instance and want to see methods. Then it does not recommend me anything. It seems that it is just auto completing global stuff.
To Reproduce
Configured the dart_language_server like this:
{
"languageserver": {
"dart": {
"command": "dart_language_server",
"args": [],
"filetypes": ["dart"],
"cwd": "./lib",
"initializationOptions": {},
"settings": {
"dart": {
"validation": {},
"completion": {}
}
}
}
}
}
Expected behavior
I get some completion suggestions for instance variables as well like with LanguageClient-Neovim
Screenshots
Here you see it completes global stuff

However, it does not find methods of a class instance like it should:

Desktop (please complete the following information):
Looks like the server need sometime to build the cache for completion, it works well after the server get started for a while.
I think this is unnecessary:
cwd": "./lib",
Hm, also after waiting a while it doesn't work for me. On the contrary, yes it seems to display completions after I type in the DOT so for example variable. and then I get other global completions and not completions of methods for the instance variable i am currently using.
Example: lots of global namespace stuff again and not completions for context

I have increase the timeout for content sync, hope that could solve your issue.
You have to build from source right now it see the result.
no doesn't work for me, I still see a lot of global results. I am currently using vim-lsc which works just fine with the dart_language_server
@wwwdata I've figured it out, is's bug of dart language server, it claimed to support increment document sync, but it's buggy. vim-lsp could work because it doesn't support increment sync.
Or add "forceFullSync": true to configuration section of dart languageserver.
thx, that forceFullSync was fixing it for me!
Figured out dart language server expect optional rangeLength field on document change params, I've added that field, so forceFullSync not needed any more.