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

No definition found message #12

Closed subramn closed 5 years ago

subramn commented 5 years ago

After importing Fomantic UI or Bootstrap styles example - @import "~fomantic-ui/dist/semantic.min.css";

if i try to go to the style defined in the min.css, getting a message - "No definition found"

are there any settings i am missing

pucelle commented 5 years ago

Hi, subramn, Can you provide:

  1. Part of your HTML source codes, especially the place you choose go to definition.
  2. Part of your CSS source codes, where should find the definition.
  3. Is the HTML and CSS source codes in the same VSCode work space folder?

Thanks.

subramn commented 5 years ago

My html <h1 class="ui header"> Title is {{title}} </h1>

CSS Resides here @import "~fomantic-ui/dist/semantic.min.css"; \node_modules\fomantic-ui\dist everything is in same folder.

code

pucelle commented 5 years ago

Hi, subramn, it work like this: Every CSS files in node_modules (sepcified by excludeGlobPatterns option) will be ignored and can't be found, so you will not get any definitions from them.

Change the excludeGlobPatterns to not include node_modules should let it work, but I think it's not a good solution.

I will implement a functionality to load all the imported and linked CSS files as places to look for CSS definitions, even though they are in node_modules.

The fix should be released in one or two days, Thanks.

subramn commented 5 years ago

Thanks for quick response. i tried excludeGlobPatterns - no luck. i will wait for your fix. thanks again

pucelle commented 5 years ago

Hi, subramn, sorry I just work on this from today. Can you provide How your HTML file linked or imported the CSS file? In my last reply, I thought the @import "~fomantic-ui/dist/semantic.min.css"; is the code where your HTML file import CSS file. but after I checked documents of Fomantic UI, it seems that it's a code piece in theme.config.

subramn commented 5 years ago

I have installed fomantic-ui and added reference to stylesheet through import statement in styles.css

@import "~fomantic-ui/dist/semantic.min.css";

the above statement references semantic.min.css located under npm_modules/fomantic-ui/dist/semantic.min.css

pucelle commented 5 years ago

Hi, subramn, Version 1.6.0 has just released, Please help to check if it works. Thanks.

subramn commented 5 years ago

i tried. No luck

this the log. file does exist. I am not sure why it says file doesnt exist and next line it says file loaded. file exists under d:\Projects\myapps\Angular\Angular8-Template\node_modules\fomantic-ui\dist\semantic.css'

[8:00:54] d:\Projects\myapps\Angular\Angular8-Template\src\styles.css loaded from document [Error - 8:00:54 AM] [8:00:54] Error: ENOENT: no such file or directory, open 'd:\Projects\myapps\Angular\Angular8-Template\src\node_modules\fomantic-ui\dist\semantic.css' [8:00:54] d:\Projects\myapps\Angular\Angular8-Template\src\node_modules\fomantic-ui\dist\semantic.css loaded [8:00:55] No reference found, 0 ms cost

pucelle commented 5 years ago

I will check it, Thanks.

pucelle commented 5 years ago

Hi, The xxx loaded is mistake, the file was actually failed to read. But after I searched about the error text, they says that the only cause of the error is the file is not exist in the path. So can you help to check if the file in the path is exactly exist, or may the path is d:\Projects\myapps\Angular\Angular8-Template\node_modules\fomantic-ui\dist\semantic.css, no src?

subramn commented 5 years ago

the file exists in following path d:\Projects\myapps\Angular\Angular8-Template\node_modules\fomantic-ui\dist\semantic.css

No src.

pucelle commented 5 years ago

OK, I understand it, I will fix it soon. Thanks.

pucelle commented 5 years ago

V1.6.1 released, please help to check, Thanks.

subramn commented 5 years ago

Thanks. i tested it and it works. thank you

pucelle commented 5 years ago

You are welcome, Thanks for your feedback and replies.