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

[Feature request] Find references from HTML to HTML #32

Closed jportoles closed 3 years ago

jportoles commented 4 years ago

Sometimes you may want to look up references for a class or a id name while browsing an HTML file. Currently you can highlight a selector in a CSS file and then press Shift+F12 to find other HTML files where it appears. I suggest that it should be possible to highlight an id or a class within a HTML file, and then press Shift+F12 to find instances of it in other HTML files. It's a small thing but since the functionality is already there in CSS files, why not?

pucelle commented 4 years ago

Yes, you are right, this feature sounds good, and it's not hard to implement it since I already have a module to collect classes and ids from HTML files.

The only problem is I'm busy these days, I planed more features for this plugin but still don't have time. So I can't promise a date, but I will do it once I have some time.

jportoles commented 4 years ago

If you give me some pointers on where to look, I could maybe take a look and try a pull request. My TypeScript isn't great but it doesn't hurt to try :)

On Thu, Feb 27, 2020 at 11:13 AM Freeman Chen notifications@github.com wrote:

Yes, you are right, this feature sounds good, and it's not hard to implement it since I already have a module to collect classes and ids from HTML file. The only problem is I'm busy these days, I planed more features for this plugin but still don't have time, So I can't promise a date, but I will do it once I have some time.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pucelle/vscode-css-navigation/issues/32?email_source=notifications&email_token=AAKFGHWXRKRMBHO5MMJ72IDRE6G4VA5CNFSM4K4SDAGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENDYO3I#issuecomment-591890285, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKFGHQYILRSHXPUEXFE55TRE6G4VANCNFSM4K4SDAGA .

pucelle commented 4 years ago

https://github.com/pucelle/vscode-css-navigation/blob/74a72519baa585a5777248ca5aa0aeb0a4b91010/server/src/server.ts#L135 Check function here and you can dive inside from it.

But the functionality doesn't process things in a linear mode, it works more like a system. You may find it's hard to extend before you know what it works.

Otherwise, You may see there are many English syntax mistakes in my codes, Sorry for this because English is not my mother language.

pucelle commented 3 years ago

v1.10.1 just released, please try it, thanks.