Skip to content

Commit 9412929

Browse files
committed
Prepare for #102
1 parent 8fc6af9 commit 9412929

File tree

6 files changed

+28
-4
lines changed

6 files changed

+28
-4
lines changed

Diff for: CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# ChangeLog
22

33

4+
## [2.3.8]
5+
6+
- When finding references, will exclude current selector from reference list.
7+
But you will still find it exist until we can find a way to disable VSCode built-in CSS Reference feature.
8+
9+
410
## [2.3.7]
511

612
- Add `astro` to HTML file extension list.

Diff for: README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ You may open workspace symbol popup by `Go / Goto Symbol in Workspace`, or use s
7878
### Miscellaneous Features
7979

8080
- Can goto referenced files after clicking url part of `<link href="...">` or `@import "..."`, and several more.
81+
- Completions sort by numbers, e.g.: `.class1`, `.class2`, `.class10`.
8182

8283

8384

@@ -148,7 +149,7 @@ So please give your feedback, thanks.
148149

149150
### Should I reload this plugin after changed settings, or modified files?
150151

151-
No need to, this plugin will automatically restart after settings get changed, and reload files after they get changed.
152+
No need to, this plugin will automatically restart after settings get changed, and reload files after they get changed on VSCode or disk.
152153

153154
But if an imported file is out of current workspace, change it outside of VSCode will cause this plugin can't detect and re-parse it. You may simply open it in VSCode to make current plugin can track it.
154155

@@ -161,6 +162,13 @@ A frequently happened problem is css variable completion repetition -- vscode ha
161162
But this can be avoid by simply set `disableOwnCSSVariableCompletion` to `false`.
162163

163164

165+
### By finding references, I found the same selector where I started to find references from
166+
167+
From v2.3.8, this plugin will exclude the selector where you started to find references from.
168+
But VSCode built in CSS features would still provide references which will include it.
169+
We are still looking for a way to exclude it, see https://github.com/pucelle/vscode-css-navigation/issues/102
170+
171+
164172
### Can I change definition order to make Sass files are always come before CSS files?
165173

166174
No, VSCode always sort the definition results, seems in name order. If you don't like duplicate css definitions, you can remove the `css` in `activeCSSFileExtensions` option, or compile css file to the same folder, and keep `ignoreSameNameCSSFile` as `true`.

Diff for: client/test/fixture/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class App {
1919
}
2020
`
2121

22-
return (
22+
return (
2323
<div>
2424
<div id="id1" />
2525
<div class="class1" />

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "CSS Navigation",
44
"description": "Provides CSS Completion, Finding Definition, Finding References, Hover, Workspace Symbols services for HTML, JS, TS, JSX, Vue and more languages across whole workspace",
55
"icon": "images/logo.png",
6-
"version": "2.3.7",
6+
"version": "2.3.8",
77
"license": "MIT",
88
"publisher": "pucelle",
99
"homepage": "https://github.com/pucelle/vscode-css-navigation",

Diff for: server/src/languages/services/base-service.ts

+5
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,11 @@ export abstract class BaseService {
299299

300300
for (let part of this.getPartsByType(type)) {
301301

302+
// No include from part.
303+
if (part === fromPart) {
304+
continue
305+
}
306+
302307
// Filter by text.
303308
if (!PartComparer.isReferenceTextMatch(part, matchDefPart.type, texts)) {
304309
continue

Diff for: server/src/languages/trees/html-tree.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,16 @@ export class HTMLTokenTree extends HTMLTokenNode {
176176
}
177177
}
178178

179-
// For `Lupos.js`, completion `:class.|name|`
179+
// For `Lupos.js`, complete `:class.|name|` with class names.
180180
else if (this.isScriptSyntax() && name.startsWith(':class.')) {
181181
yield new Part(PartType.Class, attrName.text.slice(7), attrName.start + 7)
182182
}
183183

184+
// For `Lupos.js`, complete `:style.-` with CSS Variables.
185+
else if (this.isScriptSyntax() && name.startsWith(':style.-')) {
186+
yield new Part(PartType.CSSVariableAssignment, attrName.text.slice(7), attrName.start + 7)
187+
}
188+
184189
// For normal class attribute, or for `JSX`, `Lupos.js`, `Vue.js`
185190
else if (name === 'class' || name === 'className' || name === ':class') {
186191
if (attrValue) {

0 commit comments

Comments
 (0)