typescript-svelte-plugin 0.3.38 → 0.3.39

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/dist/src/index.js CHANGED
@@ -48,7 +48,7 @@ function init(modules) {
48
48
  if (snapshot) {
49
49
  const originalText = snapshot.getText(0, snapshot.getLength());
50
50
  const startIdx = originalText.indexOf(`declare module '*.svelte' {`);
51
- const endIdx = originalText.indexOf(`}`, originalText.indexOf(';', startIdx)) + 1;
51
+ const endIdx = originalText.indexOf(`\n}`, startIdx + 1) + 2;
52
52
  return modules.typescript.ScriptSnapshot.fromString(originalText.substring(0, startIdx) +
53
53
  ' '.repeat(endIdx - startIdx) +
54
54
  originalText.substring(endIdx));
@@ -10,10 +10,11 @@ function decorateInlayHints(ls, info, ts, logger) {
10
10
  return provideInlayHints(fileName, span, preferences);
11
11
  }
12
12
  const { languageService, toVirtualPos, toOriginalPos } = result;
13
+ const start = toVirtualPos(span.start);
13
14
  return languageService
14
15
  .provideInlayHints(fileName, {
15
- start: toVirtualPos(span.start),
16
- length: span.length
16
+ start,
17
+ length: toVirtualPos(span.start + span.length) - start
17
18
  }, preferences)
18
19
  .map((hint) => ({
19
20
  ...hint,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typescript-svelte-plugin",
3
- "version": "0.3.38",
3
+ "version": "0.3.39",
4
4
  "description": "A TypeScript Plugin providing Svelte intellisense",
5
5
  "main": "dist/src/index.js",
6
6
  "keywords": [