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

Request textDocument/completion failed with message: Cannot read property 'showExpandedAbbreviation' of undefined #867

Open
3 tasks done
raphinesse opened this issue Aug 10, 2018 · 4 comments
Labels

Comments

@raphinesse
Copy link

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: Linux
  • vue-language-server version: 0.0.33
  • VS Code version: N/A (using it from within atom)

Problem

For me, the changes from bf2b90f break auto completion in all modes that support Emmet.

On receiving a textDocument/completion request, Vue Language Server will eventually call require("vscode-emmet-helper").doComplete which in turn will try to access the property showExpandedAbbreviation of the passed-in Emmet configuration. For me, config.emmet is undefined, which is why the request fails with the message Request textDocument/completion failed with message: Cannot read property 'showExpandedAbbreviation' of undefined (-32603)

Reproducible Case

  • send request of type textDocument/completion with following payload:
{
  context: {triggerKind: 1},
  position: {line: 2, character: 5},
  textDocument: {uri: "file:///home/raphinesse/Test.vue"}
}

where Test.vue has the following contents:

<template>
  <div class="test"></div>
  div
</template>
  • Receive response with error Request textDocument/completion failed with message: Cannot read property 'showExpandedAbbreviation' of undefined (-32603)
@octref octref added the bug label Aug 10, 2018
@octref
Copy link
Member

octref commented Aug 10, 2018

I see, will give it a default config when config.emmet is not available.

@octref
Copy link
Member

octref commented Aug 10, 2018

Which would be fixed by this PR, I just need to update it...#745

@raphinesse
Copy link
Author

@octref That PR looks perfect. When glancing over the code, I also thought that there should be default values for all configuration keys.

@mike-hearn
Copy link

Apologies for bumping this issue, but I ran into this today as well, with the same error message.

In my case I was running Neovim, trying to use the language server via https://github.com/autozimu/LanguageClient-neovim + https://github.com/ncm2/ncm2. Opening a new App.vue file, and starting to type anything triggers the error in the console and renders the language server unusable.

It looks like the current Neovim/ncm2/LSP solution involves putting a giant default config into your vimrc (ncm2/ncm2#36), but ideally the LSP itself would provide sensible defaults.

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

No branches or pull requests

3 participants