@ktjs/ts-plugin 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/config.js +1 -0
- package/dist/kfor-highlighting.js +1 -0
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ TypeScript language service plugin for KT.js `k-for` scope variables in TSX.
|
|
|
10
10
|
- Provides hover type info and member completions for inferred aliases.
|
|
11
11
|
- Supports hover type info inside `k-for` expression strings (`item in users`) for alias/source identifiers.
|
|
12
12
|
- Adds `k-for` inline semantic highlighting in string expressions (for example alias/keyword/source in `k-for="item in list"`).
|
|
13
|
-
- Highlights directive attribute names (`k-for`, `k-if`, `k-else`, `k-else-if`, `k-model`, `k-html`) with semantic token colors.
|
|
13
|
+
- Highlights directive attribute names (`k-for`, `k-key`, `k-if`, `k-else`, `k-else-if`, `k-model`, `k-html`) with semantic token colors.
|
|
14
14
|
- Supports Vue-like syntax:
|
|
15
15
|
- `k-for="item in list"`
|
|
16
16
|
- `k-for="(item, i) in list"`
|
|
@@ -55,6 +55,7 @@ If VS Code still does not load the plugin, make sure it uses your workspace Type
|
|
|
55
55
|
{
|
|
56
56
|
"name": "@ktjs/ts-plugin",
|
|
57
57
|
"forAttr": "k-for",
|
|
58
|
+
"keyAttr": "k-key",
|
|
58
59
|
"ifAttr": "k-if",
|
|
59
60
|
"elseAttr": "k-else",
|
|
60
61
|
"elseIfAttr": "k-else-if",
|
package/dist/config.js
CHANGED
|
@@ -9,6 +9,7 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
9
9
|
function resolveConfig(config) {
|
|
10
10
|
return {
|
|
11
11
|
forAttr: config?.forAttr || 'k-for',
|
|
12
|
+
keyAttr: config?.keyAttr || 'k-key',
|
|
12
13
|
ifAttr: config?.ifAttr || 'k-if',
|
|
13
14
|
elseAttr: config?.elseAttr || 'k-else',
|
|
14
15
|
elseIfAttr: config?.elseIfAttr || 'k-else-if',
|
|
@@ -154,6 +154,7 @@ function parseKForAttributeTokens(attr, sourceFile, ts, allowOfKeyword) {
|
|
|
154
154
|
function collectDirectiveAttributeTokens(opening, sourceFile, ts, config) {
|
|
155
155
|
const directiveNames = new Set([
|
|
156
156
|
config.forAttr,
|
|
157
|
+
config.keyAttr,
|
|
157
158
|
config.ifAttr,
|
|
158
159
|
config.elseAttr,
|
|
159
160
|
config.elseIfAttr,
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type tsModule from 'typescript/lib/tsserverlibrary';
|
|
2
2
|
export interface KForPluginConfig {
|
|
3
3
|
forAttr?: string;
|
|
4
|
+
keyAttr?: string;
|
|
4
5
|
ifAttr?: string;
|
|
5
6
|
elseAttr?: string;
|
|
6
7
|
elseIfAttr?: string;
|
|
@@ -10,6 +11,7 @@ export interface KForPluginConfig {
|
|
|
10
11
|
}
|
|
11
12
|
export interface ResolvedConfig {
|
|
12
13
|
forAttr: string;
|
|
14
|
+
keyAttr: string;
|
|
13
15
|
ifAttr: string;
|
|
14
16
|
elseAttr: string;
|
|
15
17
|
elseIfAttr: string;
|