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

[Feature request] CSS Modules support for "Find All References" / "Peek References" #90

Closed theinfinit closed 5 months ago

theinfinit commented 6 months ago

Hi Pucelle, how hard would it be to add CSS Modules support for "Find All References" and "Peek References"?

Example of CSS Module reference in Vue:

<!-- App.vue -->
<script setup lang="ts">
import s from './styles.module.css'
</script>

<template>
  <div :class="s.h_screen"></div>
</template>

And definition of styles.module.css

/* styles.module.css */
.h_screen {
  height: 100vh;
}

Currently "Find All References" and "Peek References" options work only for standard CSS classes, but how hard would it be to implement the same functionality for CSS Modules?

Cheers ✌️

pucelle commented 5 months ago

Let me check....

pucelle commented 5 months ago

Sorry, this plugin has no plan to directly process any "JavaScript Expression Like" syntax.

pucelle commented 5 months ago

But I can check in some codes to parse a CSS like syntax, and process :class="s.h_screen" to be like class="h_screen".

pucelle commented 5 months ago

Will be released in coming version 1.14.1

theinfinit commented 5 months ago

Oh, that's fantastic, Pucelle! Thank you for your hard work.

Have a great day 😇