typescript-svelte-plugin 0.3.50 → 0.3.51
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/CHANGELOG.md +9 -0
- package/dist/src/utils.js +8 -8
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.51
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- perf: various optimization with ast walk ([#2969](https://github.com/sveltejs/language-tools/pull/2969))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`5b9a4ac`](https://github.com/sveltejs/language-tools/commit/5b9a4ac9f5949f709667d43a16766475bc5a63d8)]:
|
|
10
|
+
- svelte2tsx@0.7.53
|
|
11
|
+
|
|
3
12
|
See https://github.com/sveltejs/language-tools/releases
|
package/dist/src/utils.js
CHANGED
|
@@ -101,14 +101,14 @@ function get$storeOffsetOf$storeDeclaration(text, storePosition) {
|
|
|
101
101
|
function findNodeAtSpan(node, span, predicate) {
|
|
102
102
|
const { start, length } = span;
|
|
103
103
|
const end = start + length;
|
|
104
|
-
|
|
104
|
+
return node.forEachChild((child) => {
|
|
105
105
|
const childStart = child.getStart();
|
|
106
106
|
if (end <= childStart) {
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
109
|
const childEnd = child.getEnd();
|
|
110
110
|
if (start >= childEnd) {
|
|
111
|
-
|
|
111
|
+
return;
|
|
112
112
|
}
|
|
113
113
|
if (start === childStart && end === childEnd) {
|
|
114
114
|
if (!predicate) {
|
|
@@ -122,20 +122,20 @@ function findNodeAtSpan(node, span, predicate) {
|
|
|
122
122
|
if (foundInChildren) {
|
|
123
123
|
return foundInChildren;
|
|
124
124
|
}
|
|
125
|
-
}
|
|
125
|
+
});
|
|
126
126
|
}
|
|
127
127
|
/**
|
|
128
128
|
* Finds node somewhere at position.
|
|
129
129
|
*/
|
|
130
130
|
function findNodeAtPosition(node, pos, predicate) {
|
|
131
|
-
|
|
131
|
+
return node.forEachChild((child) => {
|
|
132
132
|
const childStart = child.getStart();
|
|
133
133
|
if (pos < childStart) {
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
const childEnd = child.getEnd();
|
|
137
137
|
if (pos > childEnd) {
|
|
138
|
-
|
|
138
|
+
return;
|
|
139
139
|
}
|
|
140
140
|
const foundInChildren = findNodeAtPosition(child, pos, predicate);
|
|
141
141
|
if (foundInChildren) {
|
|
@@ -147,7 +147,7 @@ function findNodeAtPosition(node, pos, predicate) {
|
|
|
147
147
|
if (predicate(child)) {
|
|
148
148
|
return child;
|
|
149
149
|
}
|
|
150
|
-
}
|
|
150
|
+
});
|
|
151
151
|
}
|
|
152
152
|
/**
|
|
153
153
|
* True if is `export const/let/function`
|
|
@@ -175,9 +175,9 @@ function gatherDescendants(node, predicate, dest = []) {
|
|
|
175
175
|
dest.push(node);
|
|
176
176
|
}
|
|
177
177
|
else {
|
|
178
|
-
|
|
178
|
+
node.forEachChild((child) => {
|
|
179
179
|
gatherDescendants(child, predicate, dest);
|
|
180
|
-
}
|
|
180
|
+
});
|
|
181
181
|
}
|
|
182
182
|
return dest;
|
|
183
183
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typescript-svelte-plugin",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.51",
|
|
4
4
|
"description": "A TypeScript Plugin providing Svelte intellisense",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@jridgewell/sourcemap-codec": "^1.5.0",
|
|
26
|
-
"svelte2tsx": "~0.7.
|
|
26
|
+
"svelte2tsx": "~0.7.53"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "tsc -p ./",
|