Skip to content

Commit 2f0f631

Browse files
committed
Edit docs
1 parent c5a4920 commit 2f0f631

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### 1.21 (Jan 10, 2021)
1+
### 1.21 (Sep 26, 2023)
22
* Added support for customized language setups. You can set arbitrary regex expression to trigger autocompletion of cached CSS class names.
33

44
### 1.20 (Dec 19, 2020)

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
> This repository is a fork of the original [zignd/HTML-CSS-Class-Completion](https://github.com/Zignd/HTML-CSS-Class-Completion). If you are currently using the original extension, please uninstall it first before installing this forked version.
2+
>
3+
> The primary addition in this fork is the `html-css-class-completion.CustomLanguages` configuration. This allows users to specify custom regex patterns, enabling CSS autocompletion in various languages.
4+
>
5+
> Here's an example showcasing how to set up autocompletion for different languages:
6+
>
7+
> ```jsonc
8+
> "html-css-class-completion.CustomizedLanguages": {
9+
> "rust": [
10+
> "class:\\s*\"([\\w- ]*$)",
11+
> "className:\\s*\"([\\w- ]*$)"
12+
> ],
13+
> "cpp": "auto\\s+class[nN]ame\\s*=\\s*\"([\\w- ]*$)" // Strings are also acceptable
14+
> }
15+
> ```
16+
>
17+
> Admittedly, I'm not experienced in vscode extension development and am still grasping the intricacies of regex. The regex patterns provided above were adapted from the original extension's source code. To assist in configuring your own setups, here are the original regex expressions from the extension's source code:
18+
>
19+
> ```js
20+
> const cssClassRegex = /@apply ([.\w- ]*$)/;
21+
> const htmlClassRegex = /class=["|']([\w- ]*$)/;
22+
> const jsAndJsxClassRegex = [/className=["|']([\w- ]*$)/, /class=["|']([\w- ]*$)/];
23+
> ```
24+
25+
126
# IntelliSense for CSS class names in HTML
227
328
A Visual Studio Code extension that provides CSS class name completion for the HTML `class` attribute based on the definitions found in your workspace or external files referenced through the `link` element.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "html-css-class-completion-everywhere",
33
"displayName": "IntelliSense for CSS class names in HTML + ♥️",
44
"description": "CSS class name completion for the HTML class attribute based on the definitions found in your workspace. This fork added autocompletion support based on customized regex expressions on arbitrary languages.",
5-
"version": "1.21.0",
5+
"version": "1.21.1",
66
"publisher": "kang-sw",
77
"engines": {
88
"vscode": "^1.52.0"
@@ -87,7 +87,7 @@
8787
"type": "object",
8888
"description": "A list of customized languages where suggestions are enabled with specified regex matching rules.",
8989
"default": {
90-
"rs": "class:\"([^\"]*)\""
90+
"rust": "r#class_name_here:\"([^\"]*)\""
9191
}
9292
}
9393
}

0 commit comments

Comments
 (0)