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 in react application #22

Closed JiDai closed 5 years ago

JiDai commented 5 years ago

Hi,

I just created a react app with create-react-app. I tried to use the go to definition feature but VSCode did not find any definition in className :

  return (
    <div className="App">

    </div>
  );

If I try to force completion in className attribute it does not work either.

Workspace symbols are working.

The plugin is well installed and VSCode is restarted. VSCode and the plugin are up to date.

pucelle commented 5 years ago

Hi, JiDai, Sorry I'm on vocation these days, I will start to handle this issue from tomorrow, Thanks.

pucelle commented 5 years ago

Hi, JiDai, Version 1.7.2 was just released and it should work now.

The plugin has already supported parsing jsx class names but I didn't realize that jsx syntax can work in js files. So now the plugin will also parse jsx class names for js files.

Thanks.

JiDai commented 5 years ago

Thanks it works. But when I try to Find all references from a CSS declaration, the search results does not contain the js file but only the HTML files using the class.

pucelle commented 5 years ago

Few person care about the Find all references, so it doesn't support JSX syntax yet. I created another issue about this: https://github.com/pucelle/vscode-css-navigation/issues/23, and scheduled to about 20th of September.

JiDai commented 5 years ago

Ok, for me this feature is very useful :) Thanks for all 👍