vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.75k stars 593 forks source link

Comparing files in source control breaks vetur #1481

Open Soresu opened 4 years ago

Soresu commented 4 years ago

Info

Problem

On source control panel, opening a file for compare throws an error in console. After that, the intellisense is gone until I reload the project. I'm using TFS, but as I see, Github is working fine.

c:\...\octref.vetur-0.22.6\server\node_modules\typescript\lib\typescript.js:125675
                throw error;
                ^

Error: Could not find source file: '\$\...\fileName.vue'.
    at getValidSourceFile (c:\...\octref.vetur-0.22.6\server\node_modules\typescript\lib\typescript.js:125671:29)
    at Object.getSyntacticDiagnostics (c:\...\octref.vetur-0.22.6\server\node_modules\typescript\lib\typescript.js:125879:52)
    at Object.doValidation (c:\...\octref.vetur-0.22.6\server\dist\modes\script\javascript.js:73:32)
    at languageModes.getAllLanguageModeRangesInDocument.forEach.lmr (c:\...\octref.vetur-0.22.6\server\dist\services\vls.js:359:51)
    at Array.forEach (<anonymous>)
    at VLS.doValidate (c:\...\octref.vetur-0.22.6\server\dist\services\vls.js:357:72)
    at VLS.validateTextDocument (c:\...\octref.vetur-0.22.6\server\dist\services\vls.js:351:34)
    at Timeout.pendingValidationRequests.(anonymous function).setTimeout [as _onTimeout] (c:\...\octref.vetur-0.22.6\server\dist\services\vls.js:340:18)
    at ontimeout (timers.js:425:11)
    at tryOnTimeout (timers.js:289:5)
[Info  - 16:35:19] Connection to server got closed. Server will restart.

Reproducible Case

  1. Open project
  2. Modify a vue file
  3. Source control -> Click for compare
  4. Intellisense stops working
octref commented 4 years ago

I'm using TFS, but as I see, Github is working fine.

What is the specific TFS setup I need to do? Do I just open a Vue project in git?

Soresu commented 4 years ago

@octref You have to set the "tfvc.location" variable at preferences. I followed this guide.

It must be something with the remote path.

"\$\...pathToFile..\file.vue" is missing according to the error message.
"c:/TFSREPO\...pathToFile..\file.vue" is the file's correct path.

I assume TFS shows a linked path, "\$\" should be resolved correctly.