https://github.com/vanjs-org/vanjs-importtag
VS Code extension for importing tag function at the cursor
https://github.com/vanjs-org/vanjs-importtag
Last synced: 9 months ago
JSON representation
VS Code extension for importing tag function at the cursor
- Host: GitHub
- URL: https://github.com/vanjs-org/vanjs-importtag
- Owner: vanjs-org
- License: mit
- Created: 2023-09-08T17:07:47.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-08T18:09:32.000Z (almost 3 years ago)
- Last Synced: 2025-06-25T23:01:48.934Z (12 months ago)
- Language: TypeScript
- Homepage:
- Size: 118 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# vanjs-importtag README
This is the VS Code extension for the command that can import tag functions at the cursor.
## Command Reference
### `VanJS: import tag` (`vanjs-importtag.import`)
Import the tag function at the cursor. For instance, if the symbol at the cursor is `span`, this commands will add `span` into tag function importing line. It supports the importing line in this way:
```js
const {a, div, li, p, ul} = van.tags
```
and also in this way:
```js
const {state, tags: {a, div, li, p, ul}} = van
```
All the tag functions in the importing line will be ordered alphabetically.
Note that this command will preserve the existing spacing style for the tag function list. Thus whether your current code file is in a compact style, like this:
```js
const {a, div, li, p, ul} = van.tags
```
or in a normal style, like this:
```js
const { a, div, li, p, ul } = van.tags
```
this command won't change the existing style in the current file.
If your importing line is empty:
```js
const {} = van.tags
```
this command will choose the normal spacing style, as this one is preferred by more people.
You can bind the command with a shortcut of your preference. For instance, the following snippet:
```json
{
"key": "ctrl+/ t",
"command": "vanjs-importtag.import"
},
```
will bind the command with shortcut `ctrl+/ t`.
## See Also:
https://github.com/vanjs-org/vanjsHelper: The VS Code extension as my personal helper for writing **VanJS** code and **Mini-Van** code. Specifically, it defines commands that are helpful for building the https://vanjs.org/ website.