Coc.nvim: dart language server

Created on 5 Aug 2018  路  9Comments  路  Source: neoclide/coc.nvim

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

screen shot 2018-08-05 at 21 48 45

However, it does not find methods of a class instance like it should:
screen shot 2018-08-05 at 21 49 07

Desktop (please complete the following information):

  • Terminal: [e.g. iTerm2]
  • Version: [e.g. v3.2.2]

    • Neovim 0.3.1

All 9 comments

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

screen shot 2018-08-06 at 17 17 32

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.

https://github.com/natebosch/dart_language_server/issues/50

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aareman picture aareman  路  3Comments

tom-james-watson picture tom-james-watson  路  3Comments

LinArcX picture LinArcX  路  4Comments

npearson72 picture npearson72  路  3Comments

svenstaro picture svenstaro  路  4Comments