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

Visual Studio Client Integration: Server throws cannot read properties of undefined (reading 'length') #807

Open
3 tasks
varunverma001 opened this issue Nov 29, 2022 · 2 comments · May be fixed by #955
Open
3 tasks
Labels

Comments

@varunverma001
Copy link

Describe the bug

When integrating the Yaml Language Server with Visual Studio I faced an error during the 'textDocument/completion' call to the server.
The error is outmsg = "{"jsonrpc":"2.0","id":9,"error":{"code":-32603,"message":"Request textDocument/completion failed with message: Cannot read properties of undefined (reading 'length')"}}"
The version of yaml language server is 1.10.0

I tried to attach the yaml language server nodejs process and found that the error is thrown at line 283 of this file https://github.com/redhat-developer/yaml-language-server/blob/1.10.0/src/languageservice/services/yamlCompletion.ts

I fixed this error by changing the condition to 'if (this.customTags && this.customTags.length > 0) {'
The schema is fine and gets validated with the same language server. I am happy to provide if required.

Expected Behavior

Even if customTags are not defined the completion should work successfully.

Current Behavior

It throws an error "Request textDocument/completion failed with message: Cannot read properties of undefined (reading 'length')"}}"

Steps to Reproduce

  1. Setup a new VS client
  2. Don't initialize the language server and start it with defaults.
  3. Run the autocompletion on a schema file.

Environment

  • [ yes] Windows
  • Mac
  • Linux
  • other (please specify)
@gorkem gorkem added the bug label Dec 17, 2022
@gorkem
Copy link
Collaborator

gorkem commented Dec 17, 2022

Adding a permalink to the line

@thecaralice
Copy link

I faced a similar problem with helix; looks like pullConfiguration doesn't get called at all

this.settingsHandler.pullConfiguration();

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

Successfully merging a pull request may close this issue.

3 participants