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

[BUG] emmet, autocomplete, props suggestion doesn't work in some .vue files #827

Closed
3 tasks done
alexhx5 opened this issue Jun 24, 2018 · 7 comments
Closed
3 tasks done

Comments

@alexhx5
Copy link

alexhx5 commented Jun 24, 2018

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

Info

  • Platform: Win 10
  • Vetur version: 0.12.5
  • VS Code version: 1.24.1

Problem

In some .vue files emmet, autocomplete, props suggestion stops working (.vue files with not much code in them aren't affected)

The number of lines doesn't seem to be the reason it stops working (perhaps tag formatting is what's causing it? Doing f1 => format document isn't fixing the issue).

In the problematic files, if you type div or v-layout or any other tag manually it won't suggest to autocomplete it and after you hit enter, it moves the cursor to the next line without creating a tag.

I've reinstalled it several times (including the manual .vsix method) but it didn't help

UPDATE

The problem is caused by something in <script> section.

When I remove everything inside return { }, it starts working again


export default {
  name: "main",
  data() {
    return {
      ...
    }
  }
}

VUE Language Server - output

Vetur initialized
[Error - 5:26:31 PM] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot read property 'parameters' of undefined
  Code: -32603 
[Error - 5:26:32 PM] Request textDocument/definition failed.
  Message: Request textDocument/definition failed with message: Cannot set property 'typeParameters' of undefined
  Code: -32603 
[Error - 5:26:34 PM] Request textDocument/completion failed.
  Message: Request textDocument/completion failed with message: Cannot read property 'parameters' of undefined
  Code: -32603 
[Error - 5:26:40 PM] Request textDocument/completion failed.
  Message: Request textDocument/completion failed with message: Cannot read property 'parameters' of undefined
  Code: -32603 
@alexhx5 alexhx5 changed the title [BUG] Emmet, autocompleate, props suggestion doesn't work for .vue + vuetify anymore [BUG] emmet, autocomplete, props suggestion doesn't work in some .vue files Jun 24, 2018
@sunyuu
Copy link

sunyuu commented Sep 23, 2018

@AlexSHoffman Hi. i have the similar problems, but mine is that it doesn't work in some project. I have no idea how this happened. Can you tell me how to see the vue language server outputs.

@alexhx5
Copy link
Author

alexhx5 commented Sep 23, 2018

@sunyuu to see the vue language server output you just need to:

  • Open the VScode terminal. Ctrl + ~
  • Go to Output tab
  • Choose the vue language server in the drop down menu

@kindlyfire
Copy link

I get the same error. Code to reproduce: gist

I commented the code to show the function causing the problem. When the watcher for value is commented out, everything works fine and emmet works. When it is uncommented, it causes the error and emmet/autocomplete doesn't work. I also noticed commenting out the line 21 (this.rValue = v) causes it not to error. Changing the name of the watcher rValue also makes the error go away.

Errors (I found two different ones):

[Error - 7:05:46 PM] Request textDocument/completion failed.
  Message: Request textDocument/completion failed with message: Cannot read property 'parameters' of undefined
  Code: -32603 
[Error - 7:12:26 PM] Request textDocument/hover failed.
  Message: Request textDocument/hover failed with message: Cannot set property 'typeParameters' of undefined
  Code: -32603 

@kindlyfire
Copy link

Changing my watchers to objects with a handler prop does seem to fix the problem. gist

@boolka
Copy link

boolka commented Mar 1, 2019

I got the same error.
Vetur - 0.16.2
veturhovermessagestrace
veturhoverfail
@kindlyfire recommendations works

@octref
Copy link
Member

octref commented Mar 21, 2019

This seems to be solved in TS 3.3, which you can get by:

See #682 for details.

image

This issue will be completely gone after #1163.

@octref octref closed this as completed Mar 21, 2019
@octref octref added this to the March 2019 milestone Mar 21, 2019
@sunny8080
Copy link

Same problem happened with me, for some vue files emmet suggestions were working but for some files not. In my case it was occurring, because of lang="" which is included in <template> tag.

Earlier:
sol1

After removing lang="" :
sol2

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

No branches or pull requests

6 participants