typescript-svelte-plugin 0.3.49 → 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 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
@@ -5,13 +5,13 @@ const utils_1 = require("../utils");
5
5
  const sveltekit_1 = require("./sveltekit");
6
6
  function decorateHover(ls, info, ts, logger) {
7
7
  const getQuickInfoAtPosition = ls.getQuickInfoAtPosition;
8
- ls.getQuickInfoAtPosition = (fileName, position) => {
8
+ ls.getQuickInfoAtPosition = (fileName, position, ...rest) => {
9
9
  const result = (0, sveltekit_1.getVirtualLS)(fileName, info, ts);
10
10
  if (!result)
11
- return getQuickInfoAtPosition(fileName, position);
11
+ return getQuickInfoAtPosition(fileName, position, ...rest);
12
12
  const { languageService, toOriginalPos, toVirtualPos } = result;
13
13
  const virtualPos = toVirtualPos(position);
14
- const quickInfo = languageService.getQuickInfoAtPosition(fileName, virtualPos);
14
+ const quickInfo = languageService.getQuickInfoAtPosition(fileName, virtualPos, ...rest);
15
15
  if (!quickInfo)
16
16
  return quickInfo;
17
17
  const source = languageService.getProgram()?.getSourceFile(fileName);
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
- for (const child of node.getChildren()) {
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
- continue;
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
- for (const child of node.getChildren()) {
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
- continue;
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
- for (const child of node.getChildren()) {
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.49",
3
+ "version": "0.3.51",
4
4
  "description": "A TypeScript Plugin providing Svelte intellisense",
5
5
  "main": "dist/src/index.js",
6
6
  "keywords": [
@@ -19,11 +19,11 @@
19
19
  "devDependencies": {
20
20
  "@types/node": "^18.0.0",
21
21
  "svelte": "^4.2.19",
22
- "typescript": "^5.8.2"
22
+ "typescript": "^5.9.2"
23
23
  },
24
24
  "dependencies": {
25
25
  "@jridgewell/sourcemap-codec": "^1.5.0",
26
- "svelte2tsx": "~0.7.35"
26
+ "svelte2tsx": "~0.7.53"
27
27
  },
28
28
  "scripts": {
29
29
  "build": "tsc -p ./",