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
66 stars 7 forks source link

Not working "CSSNavigation.alsoSearchDefinitionsInStyleTag": true #31

Closed tomozo77 closed 4 years ago

tomozo77 commented 4 years ago

I have defined one css. This "CSS Navigation" displayed two css. One of them is unrelated css. And that css was picked up. I corrected it by mistake.

I'm sorry, I'm not good at English, so I use translation software. Thanks.

pucelle commented 4 years ago

Never mind, My English is not good too!

Bug sorry I can't exactly know what's happening from your message, It seems that you got a wrong definition after checked "CSSNavigation.alsoSearchDefinitionsInStyleTag".

Do you mind to paste some of your code pieces here?

tomozo77 commented 4 years ago

Thank you for your reply.

"CSSNavigation.alsoSearchDefinitionsInStyleTag": true,
"CSSNavigation.excludeGlobPatterns": [],
"CSSNavigation.activeCSSFileExtensions": ["css"],
"CSSNavigation.activeHTMLFileExtensions": ["html"],

Thanks.

tomozo77 commented 4 years ago

<link rel="stylesheet" href="style1.css?<?php echo filemtime('style1.css') ?>">

Thanks.

pucelle commented 4 years ago

Hi, tomozo77,I can't tell what's happening from codes you pasted. Can you take a screenshot about the plugin wrongly picked CSS definition and show what it picked and not picked?

You may also package some codes of you app and upload it if you don't mind.

Otherwise, when option alsoSearchDefinitionsInStyleTag checked, the plugin will search additional CSS definitions from <style>...</style>, not from <link rel="stylesheet" href="style1.css....

tomozo77 commented 4 years ago

test Thanks.

tomozo77 commented 4 years ago

inline test2 Thanks.

tomozo77 commented 4 years ago

I installed this extension only on another PC.

When I ran it there, the results were the same.

Is it working properly on your PC?

tomozo77 commented 4 years ago

It will take some time, so it will end once. We expect for the next version up. Thanks.

pucelle commented 4 years ago

Hi, tomozo77, Sorry about not responding you for days, we are on Chinese New Year vacation these days, And I'm just back to coding.

From the screenshots, everything works as expected, when alsoSearchDefinitionsInStyleTag checked, it searches CSS definitions from your current HTML file by the class name top_lf. If found, it will always be shown as the first selected (I can't control the order), although it may be not the right definition you want.

If you don't like it, just uncheck the alsoSearchDefinitionsInStyleTag. It's welcome if you have some questions or suggestions.

tomozo77 commented 4 years ago

I'm sorry. I was misunderstanding.

I thought that "CSSNavigation.alsoSearchDefinitionsInStyleTag" should be searched first from "<link rel = stylesheet".

Thank you.

pucelle commented 4 years ago

Never mind.