pucelle / vscode-css-navigation

Allowing Go to definition from HTML to CSS, or Find References from CSS to HTML.
https://marketplace.visualstudio.com/items?itemName=pucelle.vscode-css-navigation
MIT License
64 stars 8 forks source link

The extension doesn't work until you open a blank tab #44

Closed kanlukasz closed 3 years ago

kanlukasz commented 3 years ago

Hi,

I haven't been paying attention to it lately, but this extension seems to stop working. I will try to show you a step-by-step reconstruction of my tests below. The description of the problem is long, but I would like to give you a full detailed situation

Easiest reproduction of the problem (the process shows how the extension is not working)

  1. Download portable VSCode version from https://code.visualstudio.com/#alt-downloads (64 bit zip)

  2. Create a directory data in the program folder to be able to run this instance with clean original settings

  3. Download you add-on from menu Extensions -> Search extensions (no other extensions are installed except yours now)

  4. Open folder with simple project

  5. Now everything looks like this: obraz

  6. Ok, now I'll try to:

    • auto-complete this css class in the html file
    • use go to option gif1
  7. As you can see in the gif video above, nothing works

The environment I am testing on

Version: 1.51.1
Commit: e5a624b788d92b8d34d1392e4c4d9789406efe8f
Date: 2020-11-10T23:34:32.027Z
Electron: 9.3.3
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19042
 Windows 10 20H2 Home Edition 19042.662

Additional notes:

AND NOW THE WEIRDEST THING

The extension starts working when I open a blank tab

The thing you may be interested in is Log (Extension host)

  1. After running VsCode with my project it looks like this:
    [2020-12-04 09:19:28.098] [exthost] [info] extension host started
    [2020-12-04 09:19:28.133] [exthost] [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication {"startup":false,"extensionId":{"value":"vscode.microsoft-authentication","_lower":"vscode.microsoft-authentication"},"activationEvent":"onAuthenticationRequest:microsoft"}
    [2020-12-04 09:19:28.133] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/username/VSCODE/resources/app/extensions/microsoft-authentication/dist/extension.js
    [2020-12-04 09:19:28.142] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch {"startup":true,"extensionId":{"value":"vscode.debug-auto-launch","_lower":"vscode.debug-auto-launch"},"activationEvent":"*"}
    [2020-12-04 09:19:28.142] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/username/VSCODE/resources/app/extensions/debug-auto-launch/dist/extension
    [2020-12-04 09:19:28.144] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet {"startup":true,"extensionId":{"value":"vscode.emmet","_lower":"vscode.emmet"},"activationEvent":"*"}
    [2020-12-04 09:19:28.144] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/username/VSCODE/resources/app/extensions/emmet/dist/node/emmetNodeMain
    [2020-12-04 09:19:28.157] [exthost] [info] ExtensionService#_doActivateExtension vscode.git {"startup":true,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":"*"}
    [2020-12-04 09:19:28.157] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/username/VSCODE/resources/app/extensions/git/dist/main
    [2020-12-04 09:19:28.171] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict {"startup":true,"extensionId":{"value":"vscode.merge-conflict","_lower":"vscode.merge-conflict"},"activationEvent":"*"}
    [2020-12-04 09:19:28.171] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/username/VSCODE/resources/app/extensions/merge-conflict/dist/mergeConflictMain
    [2020-12-04 09:19:28.173] [exthost] [info] ExtensionService#_doActivateExtension vscode.search-result {"startup":true,"extensionId":{"value":"vscode.search-result","_lower":"vscode.search-result"},"activationEvent":"*"}
    [2020-12-04 09:19:28.173] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/username/VSCODE/resources/app/extensions/search-result/dist/extension.js
    [2020-12-04 09:19:28.266] [exthost] [info] ExtensionService#_doActivateExtension vscode.github {"startup":true,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":"*"}
    [2020-12-04 09:19:28.266] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/username/VSCODE/resources/app/extensions/github/dist/extension.js
    [2020-12-04 09:19:28.269] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode.js-debug {"startup":false,"extensionId":{"value":"ms-vscode.js-debug","_lower":"ms-vscode.js-debug"},"activationEvent":"onCommand:extension.js-debug.clearAutoAttachVariables"}
    [2020-12-04 09:19:28.269] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/username/VSCODE/resources/app/extensions/ms-vscode.js-debug/src/extension.js
    [2020-12-04 09:19:28.336] [exthost] [info] eager extensions activated
    [2020-12-04 09:19:28.353] [exthost] [info] ExtensionService#_doActivateExtension vscode.github-authentication {"startup":false,"extensionId":{"value":"vscode.github-authentication","_lower":"vscode.github-authentication"},"activationEvent":"onAuthenticationRequest:github"}
    [2020-12-04 09:19:28.353] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/username/VSCODE/resources/app/extensions/github-authentication/dist/extension.js
  2. After opening the index.html and style.css tabs, the following lines appear there:
    [2020-12-04 09:19:48.120] [exthost] [info] ExtensionService#_doActivateExtension vscode.html-language-features {"startup":false,"extensionId":{"value":"vscode.html-language-features","_lower":"vscode.html-language-features"},"activationEvent":"onLanguage:html"}
    [2020-12-04 09:19:48.120] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/username/VSCODE/resources/app/extensions/html-language-features/client/dist/node/htmlClientMain
    [2020-12-04 09:19:49.473] [exthost] [info] ExtensionService#_doActivateExtension vscode.css-language-features {"startup":false,"extensionId":{"value":"vscode.css-language-features","_lower":"vscode.css-language-features"},"activationEvent":"onLanguage:css"}
    [2020-12-04 09:19:49.473] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/username/VSCODE/resources/app/extensions/css-language-features/client/dist/node/cssClientMain
  3. IMPORTANT LOG - here the extension starts working After opening blank empty tab, the following lines appear there:
    [2020-12-04 09:20:15.467] [exthost] [info] ExtensionService#_doActivateExtension pucelle.vscode-css-navigation {"startup":false,"extensionId":{"value":"pucelle.vscode-css-navigation","_lower":"pucelle.vscode-css-navigation"},"activationEvent":"onLanguage:plaintext"}
    [2020-12-04 09:20:15.467] [exthost] [info] ExtensionService#loadCommonJSModule file:///c:/Users/username/VSCODE/data/extensions/pucelle.vscode-css-navigation-1.9.0/client/out/extension
pucelle commented 3 years ago

Thanks, I will check it.

pucelle commented 3 years ago

Seems that this plugin only been activated for plaintext files. I remembered that when I made this plugin, plaintext means any readable types, but now it means Unknown language files (from https://code.visualstudio.com/docs/languages/overview#_changing-the-language-for-the-selected-file)

I already checked in new codes, hope it works. Otherwise I will implement more features, so it will be released at tomorrow, I will give a comment here after released.

pucelle commented 3 years ago

Just released v1.10.1, please check it, thanks.

kanlukasz commented 3 years ago

Seems to be working well now. I would like to thank you very much for your quick reply and quick fix. Thank you