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

Intellisense / type checking stopped working in v0.22.4 #1449

Closed
3 tasks done
Soresu opened this issue Oct 4, 2019 · 40 comments · Fixed by #1450
Closed
3 tasks done

Intellisense / type checking stopped working in v0.22.4 #1449

Soresu opened this issue Oct 4, 2019 · 40 comments · Fixed by #1450
Labels

Comments

@Soresu
Copy link

Soresu commented Oct 4, 2019

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

Info

  • Platform: Windows 10 x64
  • Vetur version: 0.22.4
  • VS Code version: 1.38.1
  • Already reinstalled Visual Studio Code, Vetur
  • Happens on multiple PC
  • Tried to remove other plugins

Problem

Intellisense stopped working properly in Vue files. Although it works in the first opened vue file or if it was opened in the previous session.
Downgrading to Vetur 0.22.3 fixed the issue.

Reproducible Case

  1. Close all tabs in the current project
  2. Close and open Visual Studio Code
  3. Open a vue file
  4. Wait until the plugins are loaded
  5. Hovering over/Ctrl+space at imported objects, variables doesn't show any info
  6. Close and open Visual Studio Code
  7. Intellisense works in the previously opened file
@borradaniele
Copy link

Same here, linking between files does not work with cmd and intellisense does not shows up, already tried to uninstall and reinstall.
Seems like occasionally it starts working again for some times and then stops again, not sure about the events chain that causes this tho.

Platform: Mac OS Mojave 10.14.6
VS Code version: 1.38.1
Vetur version: 0.22.4

If you need more info or log let me know.

@alexsasharegan
Copy link
Contributor

Same on Linux.

Vetur: 0.22.4

VSCode Stats:
Version: 1.38.1
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:30:08.229Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Linux x64 5.0.0-31-generic

@yoyo930021
Copy link
Member

yoyo930021 commented Oct 5, 2019

#1317 (comment)
+1

@Sheng-Long
Copy link

Same issue for me, although it always seems to work in at least one file, but not the others

@hkk2018
Copy link

hkk2018 commented Oct 9, 2019

+1

@sploders101 sploders101 mentioned this issue Oct 9, 2019
3 tasks
@matthew-ch
Copy link

Similar issue for my project using typescript.

VSCode version: 1.39.0
OS: macOS Catalina 10.15
Vetur version: 0.22.4

Downgrading to 0.22.3 works.

@Ttou
Copy link

Ttou commented Oct 11, 2019

+1

@sppera
Copy link

sppera commented Oct 11, 2019

+1

  • Platform: Linux fedora 5.2.18-200.fc30.x86_64
  • Vetur version: 0.22.4
  • VS Code version: 1.39.1

@wfischer42
Copy link

Similar issue.
Specifically, TypeScript errors only show up in the first file I open after launching VSCode.
This was true using both TSLint Vue and ESLint to validate.

Downgrading to 0.22.3 worked for me too.

@ktsn ktsn changed the title Intellisense stopped working in the new version Intellisense / type checking stopped working in v0.22.4 Oct 14, 2019
@ktsn ktsn added the bug label Oct 14, 2019
@SunshowerC
Copy link

same here.
Platform: Mac
Vetur version: 0.22.4

@imakan
Copy link

imakan commented Oct 15, 2019

Downgrading to 0.22.3 worked for me

@Yancy1028
Copy link

my english is bad,but I know how to reproduce the problem.
in my new application,
1st use any "*.vue" file in "router.ts",and close all opened vue file,
2nd resert VSCode,and then open a normal vue file,that's ok,
3rd open any one vue file is "router.ts" used.that is not work.

it's look like ,vue file is import on other *".ts" file,vue IntelliSense not work.

@amirafzali
Copy link

Platform: Mac
Vetur version: 0.22.4

Only one file has working intellisense at a given time. Language server keeps crashing.
Downgrading to 0.22.3 fixed the problem.

@rchl
Copy link
Collaborator

rchl commented Oct 16, 2019

Guys, there is no need for more confirmations. Just use the reaction icon if you need to say "me too"

@tomasbjerre
Copy link

Same here. It works for a while after reinstall.
Workaround: CTRL-P and type: > Reinstall Extension and pick Vetur.

@petternordholm
Copy link

Hi!

Did some debugging on this issue. AFAIK, the problem is related to:
javascript.ts:languageServiceIncludesFile

This method is called with the .vue file and return false. This will bypass validation, hovering, etc. and return an empty result.

For instance:

    doValidation(doc: TextDocument): Diagnostic[] {
      const { scriptDoc, service } = updateCurrentVueTextDocument(doc);
      if (!languageServiceIncludesFile(service, doc.uri)) {
        return [];
      }

In our tsconfig.json, we are not including vue file since these will be pulled in by the compiler anyway when our entry point ts files are compiled.

So,

export function languageServiceIncludesFile(ls: ts.LanguageService, documentUri: string): boolean {
  const filePaths = ls.getProgram()!.getRootFileNames();
  const filePath = getFilePath(documentUri);
  const found = filePaths.includes(filePath);
  return found;
}

filePaths will not contain our vue files, only ts files, and the method will return false.

@yoyo930021
Copy link
Member

Hi!

Did some debugging on this issue. AFAIK, the problem is related to:
javascript.ts:languageServiceIncludesFile

This method is called with the .vue file and return false. This will bypass validation, hovering, etc. and return an empty result.

For instance:

    doValidation(doc: TextDocument): Diagnostic[] {
      const { scriptDoc, service } = updateCurrentVueTextDocument(doc);
      if (!languageServiceIncludesFile(service, doc.uri)) {
        return [];
      }

In our tsconfig.json, we are not including vue file since these will be pulled in by the compiler anyway when our entry point ts files are compiled.

So,

export function languageServiceIncludesFile(ls: ts.LanguageService, documentUri: string): boolean {
  const filePaths = ls.getProgram()!.getRootFileNames();
  const filePath = getFilePath(documentUri);
  const found = filePaths.includes(filePath);
  return found;
}

filePaths will not contain our vue files, only ts files, and the method will return false.

#1450 PR will fixed.

@petternordholm
Copy link

Kudos @yoyo930021 .. Great work! Hope we can get this PR merged ASAP!

It is driving me crazy. I will apply your changes on my local VLS

@josh-hemphill
Copy link

I want to make sure this is my only issue, did this also break all emmet/bracket-closing functions as well?

@tomasbjerre
Copy link

If anyone wants to install a previous version, you can install it like this:
image

octref added a commit that referenced this issue Oct 21, 2019
@octref
Copy link
Member

octref commented Oct 21, 2019

Should be fixed in 0.22.5. Thanks to @yoyo930021 for fixing it! Sorry I had been traveling and just catching up with notifications.

@GordonBlahut
Copy link

0.22.5 still doesn't fix this for me. Downgrading to 0.22.3 works.

Windows 10 x64, VS Code 1.39.2
Tried uninstalling Vetur, deleting from extensions directory and reinstalling.

@octref
Copy link
Member

octref commented Oct 21, 2019

@GordonBlahut Does it reproduce on the sample project? https://github.com/octref/veturpack
If not, can you open a new bug report with reproducible steps?

@douglasg14b
Copy link

douglasg14b commented Oct 22, 2019

I'm also having this issue, v0.22.4 & 0.22.5 both have this issue for me.

Manually downgrading to v0.22.3 resolves it.

@douglasg14b
Copy link

Why is the issue closed?

@Neme12
Copy link

Neme12 commented Oct 22, 2019

I'm still encountering this issue after upgrading to 0.22.5. In fact it no longer works even in the first opened file.

@matthew-ch
Copy link

For me version 0.22.5 works, both in ts and non-ts projects.

@deankinane
Copy link

deankinane commented Oct 22, 2019

InelliSense now completely broken in 0.22.5.
Doesn't work in first open file or file opened from previous session.

Have tested both TS and JS and neither work.

Downgrading to 0.22.4 fixes the issue for the first opened file.

Downgrading to 0.22.3 fixes the issue for all files.

Environment details:
VS Code: 1.39.2
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.17134

@Soresu
Copy link
Author

Soresu commented Oct 22, 2019

The new 0.22.5 still has the problem. Moreover, step 7 of the reproducible case is now broken too.

@yoyo930021
Copy link
Member

yoyo930021 commented Oct 22, 2019

I think to have another problem causes on this issue.
Maybe #1469

If (use windows OS and broken) {
    pick +1 reaction.
} else {
    pick -1 reaction.
}

@Soresu @Neme12 @douglasg14b @GordonBlahut

@yoyo930021
Copy link
Member

yoyo930021 commented Oct 22, 2019

I think have an error fix in #1450.

I fix it on #1472.
Have anyone can verify it?

@praveenpuglia
Copy link

I don't know. I used 0.22.5 for most part of the day today. Haven't seen problems. Help me see the problem?

@petternordholm
Copy link

I don't know. I used 0.22.5 for most part of the day today. Haven't seen problems. Help me see the problem?

@praveenpuglia I think the problem is related to windows and windows filepaths. Are you running VSCode on linux or mac ?

@praveenpuglia
Copy link

praveenpuglia commented Oct 23, 2019

macOS Catalina - 10.15

@octref
Copy link
Member

octref commented Oct 23, 2019

Fix for Windows is released on 0.22.6.

@Soresu
Copy link
Author

Soresu commented Oct 23, 2019

@octref Seems like 0.22.6 fixed the issue.

@lzinga
Copy link

lzinga commented Dec 3, 2019

I believe I am still getting this issue. I have been able to get the import intellisense paths to work by using this post on reddit. However when I try to access anything from the imported file there is no intellisense.
Inside the imported file the following exists.

import axios from 'axios'

export const test = {
	async get(id) {
		// ..
	}
}

Intellisense doesn't even exist for any Vue elements either. I am at a complete halt in my development because of this issue that I can't seem to get past. I am somewhat new to dealing with js but have been programming for quite a few years now and have been frustrated for over a week now.

@yoyo930021
Copy link
Member

@lzinga please give more info for this.
Create new issue, and use issue template.

@Niekvdm
Copy link

Niekvdm commented Feb 5, 2020

Issue arrised again in 0.23.0 see #1589

@ykamal
Copy link

ykamal commented May 11, 2020

Bumping this. Same problem. Suddenly stopped working.
Version: 1.45.0 (user setup)
Commit: d69a79b73808559a91206d73d7717ff5f798f23c
Date: 2020-05-07T16:18:48.860Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363
Installing/Reinstalling Vetur didn't help.

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.