You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`DotAccessCompletionProvider` for dot syntax (`styles.className`) — matches reference expressions preceded by `.`; auto-converts hyphenated names to bracket syntax on insertion
39
39
40
-
### Annotation & quick fix (warnings on unknown classes)
41
-
**Entry:**`CssModulesClassAnnotator` — for both bracket and dot syntax, checks if the referenced class exists in the stylesheet. If not, shows a warning with `SimpleCssSelectorFix` which creates the missing CSS ruleset and navigates the editor to it.
42
-
43
40
### Hover documentation
44
41
**Entry:**`SimpleDocumentationProvider` — renders the CSS ruleset content when hovering over a class name in JS/TS.
45
42
46
43
### Core utility
47
44
48
45
`src/main/kotlin/com/peppa/css/completion/QCssModulesUtil.kt` is the central utility file:
49
46
50
-
-**`restoreAllSelector(stylesheetFile)`** — parses a stylesheet and returns a map of class name → pointer to CSS ruleset. Handles `&` parent selectors (SCSS/LESS) via `processAmpersandSelectors`, plain class selectors via `processAllSelectorSuffixes`, and recursively resolves `@import`/`@use` statements (with partial/underscore naming conventions and `~` node-style resolution).
47
+
-**`restoreAllSelector(stylesheetFile)`** — parses a stylesheet and returns a map of class name → pointer to CSS ruleset. Handles nested selector expansion via `processAmpersandSelectors`, plain class selectors via `processAllSelectorSuffixes`, and recursively resolves CSS `@import` statements.
51
48
-**`findReferenceStyleFile(element)`** — resolves a JS expression back to the `StylesheetFile` it imports (handles direct imports, default imports, re-exports).
52
49
-**`generateLookupElementList(stylesheetFile)`** — builds completion `LookupElement`s from the parsed selector map.
IntelliJ/WebStorm plugin for CSS Modules in JavaScript and TypeScript. Provides code completion, go-to-definition navigation, quick documentation, and missing-class quick fixes for `import styles from './file.css'`.
7
+
IntelliJ/WebStorm plugin for CSS Modules in JavaScript and TypeScript. Provides code completion, go-to-definition navigation, and quick documentation for `import styles from './file.css'`.
8
8
9
9
## Features
10
10
11
11
-**Completion** — class name completion for bracket syntax (`styles['...']`) and dot syntax (`styles....`); hyphenated names auto-convert to bracket syntax on insertion
12
12
-**Navigation** — Ctrl+Click / Go to Definition on a class name jumps to the CSS ruleset
13
13
-**Quick documentation** — hover over a class name to see the corresponding CSS block
14
-
-**Annotations** — unknown class names are highlighted with a quick fix to create the missing ruleset
15
-
-**Sass/SCSS/LESS** — resolves parent selectors (`&`), `@import`, `@use`, and `@forward`
0 commit comments