Skip to content

Commit 68d5aee

Browse files
allow multiple css definitions search
1 parent f0050e1 commit 68d5aee

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

vscode-ext/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vscode-ext/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "next-css-lint",
33
"displayName": "Next.Js CSS linter",
44
"description": "Display unused CSS classes in Next.Js projects and search for class definitions",
5-
"version": "1.7.4",
5+
"version": "1.7.5",
66
"license": "MIT",
77
"repository": "https://github.com/Andcool-Systems/css-linter",
88
"author": {

vscode-ext/src/extension.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,16 +172,18 @@ export class CssModuleDefinitionProvider implements vscode.DefinitionProvider {
172172
const fileContent = readFileSync(resolvedPath, 'utf-8');
173173
const lines = fileContent.split('\n');
174174

175+
const definitions: vscode.Location[] = [];
176+
175177
for (let i = 0; i < lines.length; i++) {
176178
let line = lines[i].trimStart();
177179
if (line.match(new RegExp(`\\.${propertyName}(?![a-zA-Z0-9-_])`))) {
178180
const definitionUri = vscode.Uri.file(resolvedPath);
179181
const definitionPosition = new vscode.Position(i, 0);
180-
return new vscode.Location(definitionUri, definitionPosition);
182+
definitions.push(new vscode.Location(definitionUri, definitionPosition));
181183
}
182184
}
183185

184-
return null;
186+
return definitions;
185187
}
186188

187189
private resolveImportPath(document: vscode.TextDocument, importPath: string): string | null {

0 commit comments

Comments
 (0)