diff --git a/package.json b/package.json index dc91050db..afe861991 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "lint": "prettier --check ." }, "dependencies": { - "typescript": "^5.2.2" + "typescript": "^5.3.2" }, "devDependencies": { "cross-env": "^7.0.2", diff --git a/packages/language-server/package.json b/packages/language-server/package.json index 14ae1ba12..38ba55fd7 100644 --- a/packages/language-server/package.json +++ b/packages/language-server/package.json @@ -47,7 +47,7 @@ }, "dependencies": { "@jridgewell/trace-mapping": "^0.3.17", - "@vscode/emmet-helper": "2.8.4", + "@vscode/emmet-helper": "2.9.2", "chokidar": "^3.4.1", "estree-walker": "^2.0.1", "fast-glob": "^3.2.7", @@ -57,9 +57,9 @@ "svelte": "^3.57.0", "svelte-preprocess": "~5.1.0", "svelte2tsx": "workspace:~", - "typescript": "^5.2.2", - "vscode-css-languageservice": "~6.2.0", - "vscode-html-languageservice": "~5.0.0", + "typescript": "^5.3.2", + "vscode-css-languageservice": "~6.2.10", + "vscode-html-languageservice": "~5.1.1", "vscode-languageserver": "8.0.2", "vscode-languageserver-protocol": "3.17.2", "vscode-languageserver-types": "3.17.2", diff --git a/packages/language-server/src/ls-config.ts b/packages/language-server/src/ls-config.ts index 135cdaf45..1511488b6 100644 --- a/packages/language-server/src/ls-config.ts +++ b/packages/language-server/src/ls-config.ts @@ -217,6 +217,8 @@ export interface TsUserPreferencesConfig { * only in typescript config */ includePackageJsonAutoImports?: ts.UserPreferences['includePackageJsonAutoImports']; + + preferTypeOnlyAutoImports?: ts.UserPreferences['preferTypeOnlyAutoImports']; } /** @@ -436,6 +438,8 @@ export class LSConfigManager { config.suggest?.classMemberSnippets?.enabled ?? true, includeCompletionsWithObjectLiteralMethodSnippets: config.suggest?.objectLiteralMethodSnippets?.enabled ?? true, + preferTypeOnlyAutoImports: config.preferences?.preferTypeOnlyAutoImports, + includeInlayEnumMemberValueHints: inlayHints?.enumMemberValues?.enabled, includeInlayFunctionLikeReturnTypeHints: inlayHints?.functionLikeReturnTypes?.enabled, includeInlayParameterNameHints: inlayHints?.parameterNames?.enabled, @@ -446,6 +450,7 @@ export class LSConfigManager { includeInlayPropertyDeclarationTypeHints: inlayHints?.propertyDeclarationTypes?.enabled, includeInlayVariableTypeHintsWhenTypeMatchesName: inlayHints?.variableTypes?.suppressWhenTypeMatchesName === false, + interactiveInlayHints: true }; } diff --git a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/$$props-usage/expectedv2.json b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/$$props-usage/expectedv2.json index f3bcbb39d..05d499239 100644 --- a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/$$props-usage/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/$$props-usage/expectedv2.json @@ -17,8 +17,8 @@ }, "severity": 1, "source": "ts", - "message": "Type '{ exported1: string; exported2: string; invalidProp: true; }' is not assignable to type '$$Props'.\n Object literal may only specify known properties, and '\"invalidProp\"' does not exist in type '$$Props'.", - "code": 2322, + "message": "Object literal may only specify known properties, and '\"invalidProp\"' does not exist in type '$$Props'.", + "code": 2353, "tags": [] }, { diff --git a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/$$slots/expectedv2.json b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/$$slots/expectedv2.json index 335db59a0..3b6982f62 100644 --- a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/$$slots/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/$$slots/expectedv2.json @@ -17,8 +17,8 @@ }, "severity": 1, "source": "ts", - "message": "Argument of type '{ valid1: true; invalidProp1: boolean; }' is not assignable to parameter of type '{ valid1: boolean; validPropWrongType1: string; }'.\n Object literal may only specify known properties, and '\"invalidProp1\"' does not exist in type '{ valid1: boolean; validPropWrongType1: string; }'.", - "code": 2345, + "message": "Object literal may only specify known properties, and '\"invalidProp1\"' does not exist in type '{ valid1: boolean; validPropWrongType1: string; }'.", + "code": 2353, "tags": [] }, { @@ -39,8 +39,8 @@ }, "severity": 1, "source": "ts", - "message": "Argument of type '{ valid2: true; invalidProp2: boolean; }' is not assignable to parameter of type '{ valid2: boolean; validPropWrongType2: string; }'.\n Object literal may only specify known properties, and '\"invalidProp2\"' does not exist in type '{ valid2: boolean; validPropWrongType2: string; }'.", - "code": 2345, + "message": "Object literal may only specify known properties, and '\"invalidProp2\"' does not exist in type '{ valid2: boolean; validPropWrongType2: string; }'.", + "code": 2353, "tags": [] }, { diff --git a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/checkjs-nostrict/component-props-js/expectedv2.json b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/checkjs-nostrict/component-props-js/expectedv2.json index f1cce55a4..2736e9a82 100644 --- a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/checkjs-nostrict/component-props-js/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/checkjs-nostrict/component-props-js/expectedv2.json @@ -11,8 +11,8 @@ "range": { "start": { "line": 8, "character": 57 }, "end": { "line": 8, "character": 68 } }, "severity": 1, "source": "js", - "message": "Type '{ required: string; optional1: string; optional2: string; doesntExist: true; }' is not assignable to type '{ required: string; optional1?: string; optional2?: string; }'.\n Object literal may only specify known properties, and '\"doesntExist\"' does not exist in type '{ required: string; optional1?: string; optional2?: string; }'.", - "code": 2322, + "message": "Object literal may only specify known properties, and '\"doesntExist\"' does not exist in type '{ required: string; optional1?: string; optional2?: string; }'.", + "code": 2353, "tags": [] }, { diff --git a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/checkjs-nostrict/component-props-ts/expectedv2.json b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/checkjs-nostrict/component-props-ts/expectedv2.json index 01731e0e3..d8a1f912f 100644 --- a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/checkjs-nostrict/component-props-ts/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/checkjs-nostrict/component-props-ts/expectedv2.json @@ -11,8 +11,8 @@ "range": { "start": { "line": 8, "character": 57 }, "end": { "line": 8, "character": 68 } }, "severity": 1, "source": "ts", - "message": "Type '{ required: string; optional1: string; optional2: string; doesntExist: true; }' is not assignable to type '{ required: string; optional1?: string; optional2?: string; }'.\n Object literal may only specify known properties, and '\"doesntExist\"' does not exist in type '{ required: string; optional1?: string; optional2?: string; }'.", - "code": 2322, + "message": "Object literal may only specify known properties, and '\"doesntExist\"' does not exist in type '{ required: string; optional1?: string; optional2?: string; }'.", + "code": 2353, "tags": [] }, { diff --git a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/checkjs/component-props-js/expectedv2.json b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/checkjs/component-props-js/expectedv2.json index 0716de3db..a8a0339c4 100644 --- a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/checkjs/component-props-js/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/checkjs/component-props-js/expectedv2.json @@ -19,8 +19,8 @@ "range": { "start": { "line": 8, "character": 57 }, "end": { "line": 8, "character": 68 } }, "severity": 1, "source": "js", - "message": "Type '{ required: string; optional1: string; optional2: string; doesntExist: true; }' is not assignable to type '{ required: string; optional1?: string | undefined; optional2?: string | undefined; }'.\n Object literal may only specify known properties, and '\"doesntExist\"' does not exist in type '{ required: string; optional1?: string | undefined; optional2?: string | undefined; }'.", - "code": 2322, + "message": "Object literal may only specify known properties, and '\"doesntExist\"' does not exist in type '{ required: string; optional1?: string | undefined; optional2?: string | undefined; }'.", + "code": 2353, "tags": [] }, { diff --git a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/checkjs/component-props-ts/expectedv2.json b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/checkjs/component-props-ts/expectedv2.json index 499d59ae6..67d80a6cd 100644 --- a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/checkjs/component-props-ts/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/checkjs/component-props-ts/expectedv2.json @@ -19,8 +19,8 @@ "range": { "start": { "line": 8, "character": 57 }, "end": { "line": 8, "character": 68 } }, "severity": 1, "source": "ts", - "message": "Type '{ required: string; optional1: string; optional2: string; doesntExist: true; }' is not assignable to type '{ required: string; optional1?: string | undefined; optional2?: string | undefined; }'.\n Object literal may only specify known properties, and '\"doesntExist\"' does not exist in type '{ required: string; optional1?: string | undefined; optional2?: string | undefined; }'.", - "code": 2322, + "message": "Object literal may only specify known properties, and '\"doesntExist\"' does not exist in type '{ required: string; optional1?: string | undefined; optional2?: string | undefined; }'.", + "code": 2353, "tags": [] }, { diff --git a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/custom-types/expected_svelte_4.json b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/custom-types/expected_svelte_4.json index 1199941d9..ae37bf13f 100644 --- a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/custom-types/expected_svelte_4.json +++ b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/custom-types/expected_svelte_4.json @@ -22,16 +22,16 @@ "range": { "start": { "line": 3, "character": 5 }, "end": { "line": 3, "character": 19 } }, "severity": 1, "source": "ts", - "message": "Argument of type '{ owntypefromold: string; }' is not assignable to parameter of type 'HTMLProps<\"div\", HTMLAttributes>'.\n Object literal may only specify known properties, and '\"owntypefromold\"' does not exist in type 'HTMLProps<\"div\", HTMLAttributes>'.", - "code": 2345, + "message": "Object literal may only specify known properties, and '\"owntypefromold\"' does not exist in type 'HTMLProps<\"div\", HTMLAttributes>'.", + "code": 2353, "tags": [] }, { "range": { "start": { "line": 4, "character": 8 }, "end": { "line": 4, "character": 23 } }, "severity": 1, "source": "ts", - "message": "Argument of type '{ \"on:ownclickfromold\": (e: any) => any; }' is not assignable to parameter of type 'HTMLProps<\"div\", HTMLAttributes>'.\n Object literal may only specify known properties, and '\"on:ownclickfromold\"' does not exist in type 'HTMLProps<\"div\", HTMLAttributes>'.", - "code": 2345, + "message": "Object literal may only specify known properties, and '\"on:ownclickfromold\"' does not exist in type 'HTMLProps<\"div\", HTMLAttributes>'.", + "code": 2353, "tags": [] }, { @@ -52,8 +52,8 @@ }, "severity": 1, "source": "ts", - "message": "Argument of type '{ doesnexist: string; }' is not assignable to parameter of type '{ attribute?: string; }'.\n Object literal may only specify known properties, and '\"doesnexist\"' does not exist in type '{ attribute?: string; }'.", - "code": 2345, + "message": "Object literal may only specify known properties, and '\"doesnexist\"' does not exist in type '{ attribute?: string; }'.", + "code": 2353, "tags": [] }, { @@ -74,8 +74,8 @@ }, "severity": 1, "source": "ts", - "message": "Argument of type '{ owntypefromold: boolean; }' is not assignable to parameter of type 'HTMLProps<\"div\", HTMLAttributes>'.\n Object literal may only specify known properties, and '\"owntypefromold\"' does not exist in type 'HTMLProps<\"div\", HTMLAttributes>'.", - "code": 2345, + "message": "Object literal may only specify known properties, and '\"owntypefromold\"' does not exist in type 'HTMLProps<\"div\", HTMLAttributes>'.", + "code": 2353, "tags": [] }, { @@ -96,8 +96,8 @@ }, "severity": 1, "source": "ts", - "message": "Argument of type '{ \"on:ownclickfromold\": (e: any) => any; }' is not assignable to parameter of type 'HTMLProps<\"div\", HTMLAttributes>'.\n Object literal may only specify known properties, and '\"on:ownclickfromold\"' does not exist in type 'HTMLProps<\"div\", HTMLAttributes>'.", - "code": 2345, + "message": "Object literal may only specify known properties, and '\"on:ownclickfromold\"' does not exist in type 'HTMLProps<\"div\", HTMLAttributes>'.", + "code": 2353, "tags": [] } ] diff --git a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/custom-types/expectedv2.json b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/custom-types/expectedv2.json index 8dcb509e5..e5d0e78ec 100644 --- a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/custom-types/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/custom-types/expectedv2.json @@ -17,8 +17,8 @@ }, "severity": 1, "source": "ts", - "message": "Argument of type '{ doesnexist: string; }' is not assignable to parameter of type '{ attribute?: string; }'.\n Object literal may only specify known properties, and '\"doesnexist\"' does not exist in type '{ attribute?: string; }'.", - "code": 2345, + "message": "Object literal may only specify known properties, and '\"doesnexist\"' does not exist in type '{ attribute?: string; }'.", + "code": 2353, "tags": [] }, { @@ -83,8 +83,8 @@ }, "severity": 1, "source": "ts", - "message": "Argument of type '{ doesnexist: string; }' is not assignable to parameter of type '{ attribute?: string; }'.\n Object literal may only specify known properties, and '\"doesnexist\"' does not exist in type '{ attribute?: string; }'.", - "code": 2345, + "message": "Object literal may only specify known properties, and '\"doesnexist\"' does not exist in type '{ attribute?: string; }'.", + "code": 2353, "tags": [] } ] diff --git a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/element-attributes/expectedv2.json b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/element-attributes/expectedv2.json index b8d019fec..cd4146a6f 100644 --- a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/element-attributes/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/element-attributes/expectedv2.json @@ -3,16 +3,16 @@ "range": { "start": { "line": 9, "character": 5 }, "end": { "line": 9, "character": 12 } }, "severity": 1, "source": "ts", - "message": "Argument of type '{ \"this-is\": string; }' is not assignable to parameter of type 'HTMLProps<\"div\", HTMLAttributes>'.\n Object literal may only specify known properties, and '\"this-is\"' does not exist in type 'HTMLProps<\"div\", HTMLAttributes>'.", - "code": 2345, + "message": "Object literal may only specify known properties, and '\"this-is\"' does not exist in type 'HTMLProps<\"div\", HTMLAttributes>'.", + "code": 2353, "tags": [] }, { "range": { "start": { "line": 10, "character": 6 }, "end": { "line": 10, "character": 9 } }, "severity": 1, "source": "ts", - "message": "Argument of type '{ bar: string; }' is not assignable to parameter of type 'HTMLProps<\"div\", HTMLAttributes>'.\n Object literal may only specify known properties, and 'bar' does not exist in type 'HTMLProps<\"div\", HTMLAttributes>'.", - "code": 2345, + "message": "Object literal may only specify known properties, and 'bar' does not exist in type 'HTMLProps<\"div\", HTMLAttributes>'.", + "code": 2353, "tags": [] } ] diff --git a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/element-events/expectedv2.json b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/element-events/expectedv2.json index e122fa256..2d2c0e7a7 100644 --- a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/element-events/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/element-events/expectedv2.json @@ -6,8 +6,8 @@ }, "severity": 1, "source": "ts", - "message": "Argument of type '{ \"on:wat\": () => string; }' is not assignable to parameter of type 'HTMLProps<\"div\", HTMLAttributes>'.\n Object literal may only specify known properties, and '\"on:wat\"' does not exist in type 'HTMLProps<\"div\", HTMLAttributes>'.", - "code": 2345, + "message": "Object literal may only specify known properties, and '\"on:wat\"' does not exist in type 'HTMLProps<\"div\", HTMLAttributes>'.", + "code": 2353, "tags": [] }, { diff --git a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/node16/expectedv2.json b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/node16/expectedv2.json index 055b33e7f..197e585ae 100644 --- a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/node16/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/node16/expectedv2.json @@ -3,7 +3,7 @@ "range": { "start": { "line": 5, "character": 22 }, "end": { "line": 5, "character": 29 } }, "severity": 1, "source": "ts", - "message": "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './bar.js'?", + "message": "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './bar.js'?", "code": 2835, "tags": [] } diff --git a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/svelte-element/expectedv2.json b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/svelte-element/expectedv2.json index f9b3e8d45..6df88be61 100644 --- a/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/svelte-element/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/diagnostics/fixtures/svelte-element/expectedv2.json @@ -17,8 +17,8 @@ }, "severity": 1, "source": "ts", - "message": "Argument of type '{ cellpadding: number; }' is not assignable to parameter of type 'HTMLProps<\"div\", HTMLAttributes>'.\n Object literal may only specify known properties, and '\"cellpadding\"' does not exist in type 'HTMLProps<\"div\", HTMLAttributes>'.", - "code": 2345, + "message": "Object literal may only specify known properties, and '\"cellpadding\"' does not exist in type 'HTMLProps<\"div\", HTMLAttributes>'.", + "code": 2353, "tags": [] } ] diff --git a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/action/expectedv2.json b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/action/expectedv2.json index 4dabf25af..675b6dad0 100644 --- a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/action/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/action/expectedv2.json @@ -1,28 +1,19 @@ [ { - "label": ": any", - "position": { - "line": 1, - "character": 23 - }, + "label": [{ "value": ": " }, { "value": "any" }], + "position": { "line": 1, "character": 23 }, "kind": 1, "paddingLeft": true }, { - "label": ": any", - "position": { - "line": 1, - "character": 26 - }, + "label": [{ "value": ": " }, { "value": "any" }], + "position": { "line": 1, "character": 26 }, "kind": 1, "paddingLeft": true }, { - "label": ": void", - "position": { - "line": 1, - "character": 27 - }, + "label": [{ "value": ": " }, { "value": "void" }], + "position": { "line": 1, "character": 27 }, "kind": 1, "paddingLeft": true } diff --git a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/animation/expectedv2.json b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/animation/expectedv2.json index 97cd73f9c..070547d40 100644 --- a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/animation/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/animation/expectedv2.json @@ -1,10 +1,17 @@ [ { - "label": ": { id: number; }[]", - "position": { - "line": 3, - "character": 13 - }, + "label": [ + { "value": ": " }, + { "value": "{" }, + { "value": " " }, + { "value": "id" }, + { "value": ": " }, + { "value": "number" }, + { "value": " " }, + { "value": "}" }, + { "value": "[]" } + ], + "position": { "line": 3, "character": 13 }, "kind": 1, "paddingLeft": true } diff --git a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/component-handler/expectedv2.json b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/component-handler/expectedv2.json index dc08238cf..7d567c1c2 100644 --- a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/component-handler/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/component-handler/expectedv2.json @@ -1,12 +1,24 @@ [ { - "label": ": void", + "label": [{ "value": ": " }, { "value": "void" }], "position": { "line": 5, "character": 30 }, "kind": 1, "paddingLeft": true }, { - "label": ": MouseEvent", + "label": [ + { "value": ": " }, + { + "value": "MouseEvent", + "location": { + "range": { + "start": { "line": 15586, "character": 10 }, + "end": { "line": 15586, "character": 20 } + }, + "uri": "/typescript/lib/lib.dom.d.ts" + } + } + ], "position": { "line": 9, "character": 22 }, "kind": 1, "paddingLeft": true diff --git a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/disable-argument-name-match/expectedv2.json b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/disable-argument-name-match/expectedv2.json index 4bba9e794..0d02ae7ce 100644 --- a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/disable-argument-name-match/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/disable-argument-name-match/expectedv2.json @@ -1,6 +1,6 @@ [ { - "label": ": void", + "label": [{ "value": ": " }, { "value": "void" }], "position": { "line": 1, "character": 33 }, "kind": 1, "paddingLeft": true diff --git a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/disable-type-name-match/expectedv2.json b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/disable-type-name-match/expectedv2.json index abfa8410b..9cb586e52 100644 --- a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/disable-type-name-match/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/disable-type-name-match/expectedv2.json @@ -1,6 +1,6 @@ [ { - "label": ": number", + "label": [{ "value": ": " }, { "value": "number" }], "position": { "line": 1, "character": 14 }, "kind": 1, "paddingLeft": true diff --git a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/each/expectedv2.json b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/each/expectedv2.json index 900db405e..1b0a25c52 100644 --- a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/each/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/each/expectedv2.json @@ -1,12 +1,12 @@ [ { - "label": ": number[]", + "label": [{ "value": ": " }, { "value": "number" }, { "value": "[]" }], "position": { "line": 1, "character": 11 }, "kind": 1, "paddingLeft": true }, { - "label": ": number", + "label": [{ "value": ": " }, { "value": "number" }], "position": { "line": 4, "character": 23 }, "kind": 1, "paddingLeft": true diff --git a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/element-handler/expectedv2.json b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/element-handler/expectedv2.json index aac643248..f736e622c 100644 --- a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/element-handler/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/element-handler/expectedv2.json @@ -1,6 +1,46 @@ [ { - "label": ": MouseEvent & { currentTarge...", + "label": [ + { "value": ": " }, + { + "value": "MouseEvent", + "location": { + "range": { + "start": { "line": 15586, "character": 10 }, + "end": { "line": 15586, "character": 20 } + }, + "uri": "/typescript/lib/lib.dom.d.ts" + } + }, + { "value": " & " }, + { "value": "{" }, + { "value": " " }, + { "value": "currentTarget" }, + { "value": ": " }, + { + "value": "EventTarget", + "location": { + "range": { + "start": { "line": 8192, "character": 10 }, + "end": { "line": 8192, "character": 21 } + }, + "uri": "/typescript/lib/lib.dom.d.ts" + } + }, + { "value": " & " }, + { + "value": "HTMLButtonElement", + "location": { + "range": { + "start": { "line": 9684, "character": 10 }, + "end": { "line": 9684, "character": 27 } + }, + "uri": "/typescript/lib/lib.dom.d.ts" + } + }, + { "value": " " }, + { "value": "}" } + ], "position": { "line": 5, "character": 19 }, "kind": 1, "paddingLeft": true diff --git a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/function-call-in-props/expectedv2.json b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/function-call-in-props/expectedv2.json index 42563e736..9b9f17c27 100644 --- a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/function-call-in-props/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/function-call-in-props/expectedv2.json @@ -1,6 +1,6 @@ [ { - "label": ": void", + "label": [{ "value": ": " }, { "value": "void" }], "position": { "line": 4, "character": 29 }, "kind": 1, "paddingLeft": true diff --git a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/property-declaration/expectedv2.json b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/property-declaration/expectedv2.json index a597d047d..d6c4f5726 100644 --- a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/property-declaration/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/property-declaration/expectedv2.json @@ -1 +1,8 @@ -[{ "label": ": number", "position": { "line": 2, "character": 9 }, "kind": 1, "paddingLeft": true }] +[ + { + "label": [{ "value": ": " }, { "value": "number" }], + "position": { "line": 2, "character": 9 }, + "kind": 1, + "paddingLeft": true + } +] diff --git a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/reactive-block/expectedv2.json b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/reactive-block/expectedv2.json index 4c8ddbad2..da9bb80c2 100644 --- a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/reactive-block/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/reactive-block/expectedv2.json @@ -1,6 +1,6 @@ [ { - "label": ": number", + "label": [{ "value": ": " }, { "value": "number" }], "position": { "line": 1, "character": 12 }, "kind": 1, "paddingLeft": true @@ -42,7 +42,7 @@ "paddingRight": true }, { - "label": ": any", + "label": [{ "value": ": " }, { "value": "any" }], "position": { "line": 10, "character": 24 }, "kind": 1, "paddingLeft": true diff --git a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/reactive-varable/expectedv2.json b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/reactive-varable/expectedv2.json index abe546e79..ef847bf0a 100644 --- a/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/reactive-varable/expectedv2.json +++ b/packages/language-server/test/plugins/typescript/features/inlayHints/fixtures/reactive-varable/expectedv2.json @@ -1,10 +1,7 @@ [ { - "label": ": number", - "position": { - "line": 1, - "character": 9 - }, + "label": [{ "value": ": " }, { "value": "number" }], + "position": { "line": 1, "character": 9 }, "kind": 1, "paddingLeft": true } diff --git a/packages/language-server/test/plugins/typescript/features/inlayHints/index.test.ts b/packages/language-server/test/plugins/typescript/features/inlayHints/index.test.ts index 578f8f0e9..5ea48854f 100644 --- a/packages/language-server/test/plugins/typescript/features/inlayHints/index.test.ts +++ b/packages/language-server/test/plugins/typescript/features/inlayHints/index.test.ts @@ -102,6 +102,13 @@ async function executeTest( for (const label of inlayHint.label) { if (label.location) { label.location.uri = label.location.uri.replace(workspaceUri, ''); + + const indexOfNodeModules = label.location.uri.lastIndexOf('node_modules'); + if (indexOfNodeModules !== -1) { + label.location.uri = + '' + + label.location.uri.slice(indexOfNodeModules + 'node_modules'.length); + } } } } diff --git a/packages/svelte-vscode/package.json b/packages/svelte-vscode/package.json index 58bea4295..4306e6b65 100644 --- a/packages/svelte-vscode/package.json +++ b/packages/svelte-vscode/package.json @@ -719,7 +719,7 @@ "@types/vscode": "^1.67", "js-yaml": "^3.14.0", "tslib": "^2.4.0", - "typescript": "^5.2.2", + "typescript": "^5.3.2", "vscode-tmgrammar-test": "^0.0.11" }, "dependencies": { diff --git a/packages/svelte2tsx/package.json b/packages/svelte2tsx/package.json index 80d94cc59..504253007 100644 --- a/packages/svelte2tsx/package.json +++ b/packages/svelte2tsx/package.json @@ -40,7 +40,7 @@ "svelte": "~3.57.0", "tiny-glob": "^0.2.6", "tslib": "^2.4.0", - "typescript": "^5.2.2" + "typescript": "^5.3.2" }, "peerDependencies": { "svelte": "^3.55 || ^4.0.0-next.0 || ^4.0 || ^5.0.0-next.0", diff --git a/packages/typescript-plugin/package.json b/packages/typescript-plugin/package.json index e4860ca03..e47708ffa 100644 --- a/packages/typescript-plugin/package.json +++ b/packages/typescript-plugin/package.json @@ -19,7 +19,7 @@ "license": "MIT", "devDependencies": { "@types/node": "^16.0.0", - "typescript": "^5.2.2" + "typescript": "^5.3.2" }, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.14", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 32e13dd27..7fc5f5783 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: typescript: - specifier: ^5.2.2 - version: 5.2.2 + specifier: ^5.3.2 + version: 5.3.2 devDependencies: cross-env: specifier: ^7.0.2 @@ -20,7 +20,7 @@ importers: version: 3.1.0 ts-node: specifier: ^10.0.0 - version: 10.9.1(@types/node@16.18.32)(typescript@5.2.2) + version: 10.9.1(@types/node@16.18.32)(typescript@5.3.2) packages/language-server: dependencies: @@ -28,8 +28,8 @@ importers: specifier: ^0.3.17 version: 0.3.18 '@vscode/emmet-helper': - specifier: 2.8.4 - version: 2.8.4 + specifier: 2.9.2 + version: 2.9.2 chokidar: specifier: ^3.4.1 version: 3.5.3 @@ -53,19 +53,19 @@ importers: version: 3.57.0 svelte-preprocess: specifier: ~5.1.0 - version: 5.1.0(svelte@3.57.0)(typescript@5.2.2) + version: 5.1.0(svelte@3.57.0)(typescript@5.3.2) svelte2tsx: specifier: workspace:~ version: link:../svelte2tsx typescript: - specifier: ^5.2.2 - version: 5.2.2 + specifier: ^5.3.2 + version: 5.3.2 vscode-css-languageservice: - specifier: ~6.2.0 - version: 6.2.5 + specifier: ~6.2.10 + version: 6.2.10 vscode-html-languageservice: - specifier: ~5.0.0 - version: 5.0.5 + specifier: ~5.1.1 + version: 5.1.1 vscode-languageserver: specifier: 8.0.2 version: 8.0.2 @@ -77,7 +77,7 @@ importers: version: 3.17.2 vscode-uri: specifier: ~3.0.0 - version: 3.0.7 + version: 3.0.8 devDependencies: '@types/estree': specifier: ^0.0.42 @@ -108,7 +108,7 @@ importers: version: 11.1.2 ts-node: specifier: ^10.0.0 - version: 10.9.1(@types/node@16.18.32)(typescript@5.2.2) + version: 10.9.1(@types/node@16.18.32)(typescript@5.3.2) packages/svelte-check: dependencies: @@ -135,10 +135,10 @@ importers: version: 3.57.0 svelte-preprocess: specifier: ^5.1.0 - version: 5.1.0(svelte@3.57.0)(typescript@5.2.2) + version: 5.1.0(svelte@3.57.0)(typescript@5.3.2) typescript: specifier: ^5.0.3 - version: 5.2.2 + version: 5.3.2 devDependencies: '@rollup/plugin-commonjs': specifier: ^24.0.0 @@ -154,7 +154,7 @@ importers: version: 5.0.2(rollup@3.7.5) '@rollup/plugin-typescript': specifier: ^10.0.0 - version: 10.0.1(rollup@3.7.5)(tslib@2.5.2)(typescript@5.2.2) + version: 10.0.1(rollup@3.7.5)(tslib@2.5.2)(typescript@5.3.2) '@types/sade': specifier: ^1.7.2 version: 1.7.4 @@ -184,7 +184,7 @@ importers: version: 3.17.2 vscode-uri: specifier: ~3.0.0 - version: 3.0.7 + version: 3.0.8 packages/svelte-vscode: dependencies: @@ -220,8 +220,8 @@ importers: specifier: ^2.4.0 version: 2.5.2 typescript: - specifier: ^5.2.2 - version: 5.2.2 + specifier: ^5.3.2 + version: 5.3.2 vscode-tmgrammar-test: specifier: ^0.0.11 version: 0.0.11 @@ -252,7 +252,7 @@ importers: version: 15.0.2(rollup@3.7.5) '@rollup/plugin-typescript': specifier: ^10.0.0 - version: 10.0.1(rollup@3.7.5)(tslib@2.5.2)(typescript@5.2.2) + version: 10.0.1(rollup@3.7.5)(tslib@2.5.2)(typescript@5.3.2) '@types/estree': specifier: ^0.0.42 version: 0.0.42 @@ -302,8 +302,8 @@ importers: specifier: ^2.4.0 version: 2.5.2 typescript: - specifier: ^5.2.2 - version: 5.2.2 + specifier: ^5.3.2 + version: 5.3.2 packages/typescript-plugin: dependencies: @@ -318,8 +318,8 @@ importers: specifier: ^16.0.0 version: 16.18.32 typescript: - specifier: ^5.2.2 - version: 5.2.2 + specifier: ^5.3.2 + version: 5.3.2 packages: @@ -455,7 +455,7 @@ packages: rollup: 3.7.5 dev: true - /@rollup/plugin-typescript@10.0.1(rollup@3.7.5)(tslib@2.5.2)(typescript@5.2.2): + /@rollup/plugin-typescript@10.0.1(rollup@3.7.5)(tslib@2.5.2)(typescript@5.3.2): resolution: {integrity: sha512-wBykxRLlX7EzL8BmUqMqk5zpx2onnmRMSw/l9M1sVfkJvdwfxogZQVNUM9gVMJbjRLDR5H6U0OMOrlDGmIV45A==} engines: {node: '>=14.0.0'} peerDependencies: @@ -472,7 +472,7 @@ packages: resolve: 1.22.2 rollup: 3.7.5 tslib: 2.5.2 - typescript: 5.2.2 + typescript: 5.3.2 dev: true /@rollup/pluginutils@5.0.2(rollup@3.7.5): @@ -638,19 +638,18 @@ packages: resolution: {integrity: sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==} dev: true - /@vscode/emmet-helper@2.8.4: - resolution: {integrity: sha512-lUki5QLS47bz/U8IlG9VQ+1lfxMtxMZENmU5nu4Z71eOD5j9FK0SmYGL5NiVJg9WBWeAU0VxRADMY2Qpq7BfVg==} + /@vscode/emmet-helper@2.9.2: + resolution: {integrity: sha512-MaGuyW+fa13q3aYsluKqclmh62Hgp0BpKIqS66fCxfOaBcVQ1OnMQxRRgQUYnCkxFISAQlkJ0qWWPyXjro1Qrg==} dependencies: emmet: 2.4.4 jsonc-parser: 2.3.1 - vscode-languageserver-textdocument: 1.0.8 + vscode-languageserver-textdocument: 1.0.11 vscode-languageserver-types: 3.17.2 - vscode-nls: 5.2.0 vscode-uri: 2.1.2 dev: false - /@vscode/l10n@0.0.13: - resolution: {integrity: sha512-A3uY356uOU9nGa+TQIT/i3ziWUgJjVMUrGGXSrtRiTwklyCFjGVWIOHoEIHbJpiyhDkJd9kvIWUOfXK1IkK8XQ==} + /@vscode/l10n@0.0.16: + resolution: {integrity: sha512-JT5CvrIYYCrmB+dCana8sUqJEcGB1ZDXNLMQ2+42bW995WmNoenijWMUdZfwmuQUTQcEVVIa2OecZzTYWUW9Cg==} dev: false /acorn-walk@8.2.0: @@ -1821,7 +1820,7 @@ packages: engines: {node: '>= 0.4'} dev: true - /svelte-preprocess@5.1.0(svelte@3.57.0)(typescript@5.2.2): + /svelte-preprocess@5.1.0(svelte@3.57.0)(typescript@5.3.2): resolution: {integrity: sha512-EkErPiDzHAc0k2MF5m6vBNmRUh338h2myhinUw/xaqsLs7/ZvsgREiLGj03VrSzbY/TB5ZXgBOsKraFee5yceA==} engines: {node: '>= 14.10.0'} requiresBuild: true @@ -1865,7 +1864,7 @@ packages: sorcery: 0.11.0 strip-indent: 3.0.0 svelte: 3.57.0 - typescript: 5.2.2 + typescript: 5.3.2 dev: false /svelte@3.57.0: @@ -1885,7 +1884,7 @@ packages: dependencies: is-number: 7.0.0 - /ts-node@10.9.1(@types/node@16.18.32)(typescript@5.2.2): + /ts-node@10.9.1(@types/node@16.18.32)(typescript@5.3.2): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -1911,7 +1910,7 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.2.2 + typescript: 5.3.2 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true @@ -1924,8 +1923,8 @@ packages: engines: {node: '>=4'} dev: true - /typescript@5.2.2: - resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} + /typescript@5.3.2: + resolution: {integrity: sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==} engines: {node: '>=14.17'} hasBin: true @@ -1951,22 +1950,22 @@ packages: unist-util-stringify-position: 3.0.3 dev: true - /vscode-css-languageservice@6.2.5: - resolution: {integrity: sha512-/1oyBZK3jfx6A0cA46FCUpy6OlqEsMT47LUIldCIP1YMKRYezJ9No+aNj9IM0AqhRZ92DxZ1DmU5lJ+biuiacA==} + /vscode-css-languageservice@6.2.10: + resolution: {integrity: sha512-sYUZPku4mQ06AWGCbMyjv2tdR6juBW6hTbVPFwbJvNVzdtEfBioQOgkdXg7yMJNWnXkvWSU1FL2kb4Vxu5Cdyw==} dependencies: - '@vscode/l10n': 0.0.13 - vscode-languageserver-textdocument: 1.0.8 - vscode-languageserver-types: 3.17.3 - vscode-uri: 3.0.7 + '@vscode/l10n': 0.0.16 + vscode-languageserver-textdocument: 1.0.11 + vscode-languageserver-types: 3.17.5 + vscode-uri: 3.0.8 dev: false - /vscode-html-languageservice@5.0.5: - resolution: {integrity: sha512-7788ZT+I7/UhFoI4+bzaAiGGZEW7X39kTeuytLtw6jJA6W7ez85bWKYoFDcwrPNmywj3n/IkU9Op9asaje44jg==} + /vscode-html-languageservice@5.1.1: + resolution: {integrity: sha512-JenrspIIG/Q+93R6G3L6HdK96itSisMynE0glURqHpQbL3dKAKzdm8L40lAHNkwJeBg+BBPpAshZKv/38onrTQ==} dependencies: - '@vscode/l10n': 0.0.13 - vscode-languageserver-textdocument: 1.0.8 - vscode-languageserver-types: 3.17.3 - vscode-uri: 3.0.7 + '@vscode/l10n': 0.0.16 + vscode-languageserver-textdocument: 1.0.11 + vscode-languageserver-types: 3.17.5 + vscode-uri: 3.0.8 dev: false /vscode-jsonrpc@8.0.2: @@ -2000,8 +1999,8 @@ packages: vscode-languageserver-types: 3.17.3 dev: false - /vscode-languageserver-textdocument@1.0.8: - resolution: {integrity: sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q==} + /vscode-languageserver-textdocument@1.0.11: + resolution: {integrity: sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==} dev: false /vscode-languageserver-types@3.17.2: @@ -2011,16 +2010,16 @@ packages: resolution: {integrity: sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==} dev: false + /vscode-languageserver-types@3.17.5: + resolution: {integrity: sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==} + dev: false + /vscode-languageserver@8.0.2: resolution: {integrity: sha512-bpEt2ggPxKzsAOZlXmCJ50bV7VrxwCS5BI4+egUmure/oI/t4OlFzi/YNtVvY24A2UDOZAgwFGgnZPwqSJubkA==} hasBin: true dependencies: vscode-languageserver-protocol: 3.17.2 - /vscode-nls@5.2.0: - resolution: {integrity: sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==} - dev: false - /vscode-oniguruma@1.7.0: resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} dev: true @@ -2045,8 +2044,9 @@ packages: resolution: {integrity: sha512-8TEXQxlldWAuIODdukIb+TR5s+9Ds40eSJrw+1iDDA9IFORPjMELarNQE3myz5XIkWWpdprmJjm1/SxMlWOC8A==} dev: false - /vscode-uri@3.0.7: - resolution: {integrity: sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA==} + /vscode-uri@3.0.8: + resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==} + dev: false /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}