Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dart language server #41

Closed
wwwdata opened this issue Aug 5, 2018 · 9 comments
Closed

dart language server #41

wwwdata opened this issue Aug 5, 2018 · 9 comments

Comments

@wwwdata
Copy link

wwwdata commented Aug 5, 2018

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
@chemzqm
Copy link
Member

chemzqm commented Aug 6, 2018

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",

@wwwdata
Copy link
Author

wwwdata commented Aug 6, 2018

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.

@wwwdata
Copy link
Author

wwwdata commented Aug 6, 2018

Example: lots of global namespace stuff again and not completions for context

screen shot 2018-08-06 at 17 17 32

@chemzqm
Copy link
Member

chemzqm commented Aug 7, 2018

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.

@wwwdata
Copy link
Author

wwwdata commented Aug 7, 2018

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

@chemzqm
Copy link
Member

chemzqm commented Aug 7, 2018

@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.

natebosch/dart_lsp#50

@chemzqm chemzqm closed this as completed Aug 7, 2018
@chemzqm
Copy link
Member

chemzqm commented Aug 7, 2018

Or add "forceFullSync": true to configuration section of dart languageserver.

@wwwdata
Copy link
Author

wwwdata commented Aug 7, 2018

thx, that forceFullSync was fixing it for me!

@chemzqm
Copy link
Member

chemzqm commented Aug 7, 2018

Figured out dart language server expect optional rangeLength field on document change params, I've added that field, so forceFullSync not needed any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants