gencer / SCSS-Everywhere

A Visual Studio Code extension that provides CSS class and ID atttribute completion with incremental build and usage explorer for the HTML class attribute based on the CSS/Template files in your workspace. Also supports React's className attribute.
https://marketplace.visualstudio.com/items?itemName=gencer.html-slim-scss-css-class-completion
MIT License
24 stars 9 forks source link

[Future request] Go to Definition #61

Open kanlukasz opened 3 years ago

kanlukasz commented 3 years ago

Hello

I'm not sure if this is out of scope of this plugin, but maybe not. Could you please consider adding a function like Go To Definition for CSS / SCSS. Is it possible?

By the way, your plug is very good. Thank you!

gencer commented 3 years ago

Hi @kanlukasz this is a bit out of scope of this extension. But I will leave this open maybe someday we can revisit here too.

At the moment I do not see enough reason to proceed for such action because this will lead me to write a Language Server which I just don't want to get in by myself at the moment. Without language server, it is still can be achieved somehow, but, this will increase both startup time and update time on your workspace horribly.

onetrev commented 3 years ago

Hey @kanlukasz ... I think you may find that CSS Navigation actually does what you are looking for. It would be great if this extension could do the same as I find if you have both going you get some duplication, but neither one does everything I need all in one.

SharakPL commented 1 year ago

Isn't this already available? All you need is

  "html-css-class-completion.enableFindUsage": true,
  "html-css-class-completion.enableScssFindUsage": true,

in VSCode settings. It will show where suggested class was defined.

kanlukasz commented 1 year ago

It will show where suggested class was defined.

Hmmm, I'm trying to test it now, but I don't understand how it's supposed to show the definitions. Can you elaborate more or show any example?

SharakPL commented 1 year ago

You get the link to the file with definition so it's basically the same behaviour

kanlukasz commented 1 year ago

Are you talking about it? image

If so:

By the way, from what I can see now, there is generally something wrong with the indexing for php files (but that is a matter for a separate issue)

I'm testing this on a fresh portable installation without any additional add-ons (but with SCSS-Everywhere, of course)

My settings: image

OS for quick tests:

Have you tested this on a fresh and clear VSCode? Maybe you just have some another add-on that supports this linking for css files

SharakPL commented 1 year ago

I also noticed only some classes have links to definition files (mainly .scss). Needs improvement for sure. Also paths can be broken for nested files: links work well but path shown in the link often has \ missing in the middle eg. \themes\default_dev\scss\main.scss instead of \themes\default\_dev\scss\main.scss