Skip to content

Commit 90baf76

Browse files
committed
fix keywords
1 parent 010d2b9 commit 90baf76

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
# QSSEditor
1+
# QSSEditor
2+
3+
QSS Editor Proxy For Qt Designer
4+
5+
## QQ Group
6+
7+
[PyQt 学习](https://jq.qq.com/?_wv=1027&k=5QVVEdF)
8+
9+
## Notice
10+
11+
Must Install Proxy Server from [QSSEditor](https://github.com/PyQt5/QSSEditor/releases) first
12+
13+
## Configure
14+
15+
`vscode` Setting Panel, search `QSSEditor`
16+
17+
- auto apply
18+
- server host
19+
- server port
20+
21+
## Preview
22+
23+
![QSSEditor](https://github.com/PyQt5/QSSEditor/raw/main/QSSEditor.gif)

src/extension.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@ function activate(context) {
3333
}));
3434

3535
// 注册跳转定义
36-
context.subscriptions.push(vscode.languages.registerDefinitionProvider({
36+
context.subscriptions.push(vscode.languages.registerDefinitionProvider([{
3737
scheme: 'file',
3838
language: 'css',
3939
pattern: '**/*.{css,qss,style}'
4040
}, {
41+
scheme: 'untitled',
42+
language: 'css',
43+
pattern: '**/*.{css,qss,style}'
44+
}], {
4145
provideDefinition
4246
}));
4347

src/keywords.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const vscode = require('vscode');
22

3+
var g_words = new Set();
34
var g_items = [];
45

56
function register(context) {
@@ -17,8 +18,9 @@ function register(context) {
1718
};
1819

1920
function add(name) {
20-
if (name == undefined || name.trim() == "") return;
21-
g_items.push(new vscode.CompletionItem(name, vscode.CompletionItemKind.Keyword));
21+
if (name == undefined || name.trim() == "" || g_words.has(name.trim())) return;
22+
g_words.add(name.trim());
23+
g_items.push(new vscode.CompletionItem(name.trim(), vscode.CompletionItemKind.Keyword));
2224
};
2325

2426
module.exports = {

0 commit comments

Comments
 (0)