Skip to content

Commit

Permalink
Release 1.5.3 (#1023)
Browse files Browse the repository at this point in the history
* fix: cursors position (#1022)

* fix:  special object key in square brackets (#1021)

* feat: update version
  • Loading branch information
fyangstudio authored Jun 9, 2022
1 parent df39e2e commit 87c8566
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions extensions/style-helper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 1.1.1
- feat: change cursors position when auto complete the css class name [#1019](https://github.com/apptools-lab/AppWorks/issues/1019)
- fix: use square brackets when class name has special key [#1020](https://github.com/apptools-lab/AppWorks/issues/1020)

## 1.1.1

- chore: update taobao npm registry from `https://registry.npm.taobao.org` to `https://registry.npmmirror.com`
Expand Down
2 changes: 1 addition & 1 deletion extensions/style-helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "React Style Helper",
"description": "Easily write styles(CSS/LESS/SASS).",
"publisher": "iceworks-team",
"version": "1.1.1",
"version": "1.1.2",
"engines": {
"vscode": "^1.41.0"
},
Expand Down
2 changes: 1 addition & 1 deletion extensions/style-helper/src/cssClassAutoCompete/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function provideCompletionItems(document: vscode.TextDocument, position: vscode.
return unique(classNames).map((className) => {
const completionItem = new vscode.CompletionItem(`.${className}`, vscode.CompletionItemKind.Text);
completionItem.detail = 'AppWorks';
completionItem.insertText = `.${className} {\n \n}`;
completionItem.insertText = new vscode.SnippetString(`.${className} {\n $1\n}`);
completionItem.command = { command: 'style-helper.recordCompletionItemSelect', title: '' };
return completionItem;
});
Expand Down
10 changes: 9 additions & 1 deletion extensions/style-helper/src/styleInfoViewer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,17 @@ function provideCompletionItems(document: vscode.TextDocument, position: vscode.
) {
return findStyleSelectors(directory, styleDependencies).map((selector: string) => {
// Remove class selector `.`, When use styles.xxx.
const completionItem = new vscode.CompletionItem(selector.replace('.', ''), vscode.CompletionItemKind.Variable);
const item = selector.replace('.', '');
const completionItem = new vscode.CompletionItem(item, vscode.CompletionItemKind.Variable);
completionItem.detail = 'AppWorks';
completionItem.command = { command: 'style-helper.recordCompletionItemSelect', title: '' };
// stlye.xxx-xxx to stlye['xxx-xxx']
if (!/^[a-zA-Z]+$/.test(item)) {
completionItem.insertText = `['${item}']`;
completionItem.additionalTextEdits = [
vscode.TextEdit.delete(new vscode.Range(position.line, position.character - 1, position.line, position.character)),
];
}
return completionItem;
});
}
Expand Down

0 comments on commit 87c8566

Please sign in to comment.