pranaygp / vscode-css-peek

A vscode extension for peeking at CSS definitions from a class or id tag in HTML
MIT License
145 stars 32 forks source link

Support for Razor (*.cshtml) #75

Open fcaraujo opened 4 years ago

fcaraujo commented 4 years ago

Hi, I'm using the default config, and just tried to add 'cshtml' or 'razor'. After I saved, I restarted my vscode but it was not able to find any symbol by class name.

"css_peek.peekFromLanguages": [
  "html",
  "ejs",
  "erb",
  "php",
  "javascriptreact",
  "typescriptreact",
  "typescript",
  "javascript",
  "razor"
]

Thanks for your time.

pranaygp commented 4 years ago

Hmm, it seems like adding razor should work. Can you give me an example I can use to reproduce this issue?

Even better would be a tiny PR to this repo with a test case for .cshtml that fails. It's really easy to add such a test

  1. Add a .cshtml file in this folder
  2. Add a test case in this file, just like this one, that fails for the .cshtml file. https://github.com/pranaygp/vscode-css-peek/blob/f5968daa4ed1faa6428d94ade84a496aa04ad581/tests/src/suite/extension.test.ts#L57-L65
anuj-chauhan-2020 commented 3 years ago

I am not able to use peek definition in ASP.NET CORE 3.1 MVC project in which views are there . I am trying to navigate the css class name from a view file .cshtml but it says no definitions found for the . This extension is working pretty good in normal html files though.

pranaygp commented 3 years ago

This works just fine for me:

image

Make sure you're on the latest version of CSS Peek (4.0.0).

Please send me a .cshtml file I can try it with if the issue still occurs

anuj-chauhan-2020 commented 3 years ago

Attaching the folder hierarchy we use in .Net Core Web App in which it is not working . I have used your html and css file contents from tests folder . Please check Untitled

TerminalZero commented 1 year ago

Yes, as of version 4.2.0, "no definition could be found" persists .cshtml files in 2023. It's just not a supported file type, regardless of the settings added.