From a37745ca64983846aa88a2db6bf3a0fb260cc6ea Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 20 Oct 2025 18:17:59 +0000 Subject: [PATCH 1/2] Merge bb1959653e967d040456772e1e26d721e68fec73 into d8aafb3197ebecd7faf919eaa39e77c5805cbff8 --- src/harness/fourslashInterfaceImpl.ts | 3 +++ .../reference/jsxClassAttributeResolution.errors.txt | 2 +- .../reference/jsxClassAttributeResolution.js | 2 +- tests/cases/compiler/jsxClassAttributeResolution.tsx | 2 +- .../codeFixMissingTypeAnnotationOnExports47.ts | 2 +- .../codeFixMissingTypeAnnotationOnExports48.ts | 2 +- .../fourslash/completionsThisProperties_globalType.ts | 3 +-- .../cases/fourslash/completionsWithDeprecatedTag9.ts | 11 ++++++++--- tests/cases/fourslash/organizeImportsReactJsx.ts | 2 +- tests/cases/fourslash/organizeImportsReactJsxDev.ts | 2 +- .../importSuggestionsCache_invalidPackageJson.ts | 2 +- 11 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/harness/fourslashInterfaceImpl.ts b/src/harness/fourslashInterfaceImpl.ts index db6127dc106e0..6178b2723f13e 100644 --- a/src/harness/fourslashInterfaceImpl.ts +++ b/src/harness/fourslashInterfaceImpl.ts @@ -279,6 +279,9 @@ export class Verify extends VerifyNegatable { return this.state.verifyCompletions(optionsArray[0]); } for (const options of optionsArray) { + if (options.preferences && Object.keys(options).length === 1 && optionsArray.length > 1 && optionsArray.indexOf(options) > 0) { + throw new Error("Did you mean to put 'preferences' in the previous 'verify.completions' object argument instead of their own object?"); + } this.state.verifyCompletions(options); } return { diff --git a/tests/baselines/reference/jsxClassAttributeResolution.errors.txt b/tests/baselines/reference/jsxClassAttributeResolution.errors.txt index 354df1ee641a2..acbf1c2b1b062 100644 --- a/tests/baselines/reference/jsxClassAttributeResolution.errors.txt +++ b/tests/baselines/reference/jsxClassAttributeResolution.errors.txt @@ -12,7 +12,7 @@ file.tsx(2,19): error TS2741: Property 'ref' is missing in type '{}' but require "name": "@types/react", "version": "0.0.1", "main": "", - "types": "index.d.ts", + "types": "index.d.ts" } ==== node_modules/@types/react/index.d.ts (0 errors) ==== interface IntrinsicClassAttributesAlias { diff --git a/tests/baselines/reference/jsxClassAttributeResolution.js b/tests/baselines/reference/jsxClassAttributeResolution.js index 7fa77a36324a3..7169f506028bc 100644 --- a/tests/baselines/reference/jsxClassAttributeResolution.js +++ b/tests/baselines/reference/jsxClassAttributeResolution.js @@ -8,7 +8,7 @@ export const a = ; "name": "@types/react", "version": "0.0.1", "main": "", - "types": "index.d.ts", + "types": "index.d.ts" } //// [index.d.ts] interface IntrinsicClassAttributesAlias { diff --git a/tests/cases/compiler/jsxClassAttributeResolution.tsx b/tests/cases/compiler/jsxClassAttributeResolution.tsx index 32263ecd794ee..527741ac77675 100644 --- a/tests/cases/compiler/jsxClassAttributeResolution.tsx +++ b/tests/cases/compiler/jsxClassAttributeResolution.tsx @@ -8,7 +8,7 @@ export const a = ; "name": "@types/react", "version": "0.0.1", "main": "", - "types": "index.d.ts", + "types": "index.d.ts" } // @filename: node_modules/@types/react/index.d.ts interface IntrinsicClassAttributesAlias { diff --git a/tests/cases/fourslash/codeFixMissingTypeAnnotationOnExports47.ts b/tests/cases/fourslash/codeFixMissingTypeAnnotationOnExports47.ts index 7cb1d83a0e01c..e2bbfe9b840bb 100644 --- a/tests/cases/fourslash/codeFixMissingTypeAnnotationOnExports47.ts +++ b/tests/cases/fourslash/codeFixMissingTypeAnnotationOnExports47.ts @@ -9,7 +9,7 @@ // @filename: node_modules/react/package.json ////{ //// "name": "react", -//// "types": "index.d.ts", +//// "types": "index.d.ts" ////} // @filename: node_modules/react/index.d.ts diff --git a/tests/cases/fourslash/codeFixMissingTypeAnnotationOnExports48.ts b/tests/cases/fourslash/codeFixMissingTypeAnnotationOnExports48.ts index 4d1a33fe565e6..77f10ff0548f7 100644 --- a/tests/cases/fourslash/codeFixMissingTypeAnnotationOnExports48.ts +++ b/tests/cases/fourslash/codeFixMissingTypeAnnotationOnExports48.ts @@ -9,7 +9,7 @@ // @filename: node_modules/react/package.json ////{ //// "name": "react", -//// "types": "index.d.ts", +//// "types": "index.d.ts" ////} // @filename: node_modules/react/index.d.ts diff --git a/tests/cases/fourslash/completionsThisProperties_globalType.ts b/tests/cases/fourslash/completionsThisProperties_globalType.ts index 19d63008c87d1..3b4b81db3b1e4 100644 --- a/tests/cases/fourslash/completionsThisProperties_globalType.ts +++ b/tests/cases/fourslash/completionsThisProperties_globalType.ts @@ -23,8 +23,7 @@ test.markerNames().forEach(marker => { kind: "var", kindModifiers: "declare", sortText: completion.SortText.GlobalsOrKeywords - }] - }, { + }], preferences: { includeInsertTextCompletions: true } diff --git a/tests/cases/fourslash/completionsWithDeprecatedTag9.ts b/tests/cases/fourslash/completionsWithDeprecatedTag9.ts index 0a1e2c0c5ad94..30850e192c1ff 100644 --- a/tests/cases/fourslash/completionsWithDeprecatedTag9.ts +++ b/tests/cases/fourslash/completionsWithDeprecatedTag9.ts @@ -11,19 +11,24 @@ ////class Foo { //// foo: number; //// m() { -//// foo/**/ +//// [|foo|]/**/ //// } ////} verify.completions({ marker: "", includes: [{ + name: "foo", + insertText: "this.foo", + kind: "property", + source: completion.CompletionSource.ThisProperty, + sortText: completion.SortText.SuggestedClassMembers, + }, { name: "foo", kind: "var", kindModifiers: "deprecated,declare", sortText: completion.SortText.Deprecated(completion.SortText.GlobalsOrKeywords), - }] -}, { + }], preferences: { includeInsertTextCompletions: true } diff --git a/tests/cases/fourslash/organizeImportsReactJsx.ts b/tests/cases/fourslash/organizeImportsReactJsx.ts index 6e5ccb7bdaee5..4d959b20473be 100644 --- a/tests/cases/fourslash/organizeImportsReactJsx.ts +++ b/tests/cases/fourslash/organizeImportsReactJsx.ts @@ -13,7 +13,7 @@ // @filename: node_modules/react/package.json ////{ //// "name": "react", -//// "types": "index.d.ts", +//// "types": "index.d.ts" ////} // @filename: node_modules/react/index.d.ts diff --git a/tests/cases/fourslash/organizeImportsReactJsxDev.ts b/tests/cases/fourslash/organizeImportsReactJsxDev.ts index de2be31661717..80ba8ff0c270d 100644 --- a/tests/cases/fourslash/organizeImportsReactJsxDev.ts +++ b/tests/cases/fourslash/organizeImportsReactJsxDev.ts @@ -13,7 +13,7 @@ // @filename: node_modules/react/package.json ////{ //// "name": "react", -//// "types": "index.d.ts", +//// "types": "index.d.ts" ////} // @filename: node_modules/react/index.d.ts diff --git a/tests/cases/fourslash/server/importSuggestionsCache_invalidPackageJson.ts b/tests/cases/fourslash/server/importSuggestionsCache_invalidPackageJson.ts index 0f313a071ff87..4c9aad57289e8 100644 --- a/tests/cases/fourslash/server/importSuggestionsCache_invalidPackageJson.ts +++ b/tests/cases/fourslash/server/importSuggestionsCache_invalidPackageJson.ts @@ -3,7 +3,7 @@ // @Filename: /home/src/workspaces/project/jsconfig.json ////{ //// "compilerOptions": { -//// "module": "commonjs", +//// "module": "commonjs" //// }, ////} From 84dacfda7ac15a3ac1a1e95b648e94260e3be962 Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Mon, 20 Oct 2025 11:37:34 -0700 Subject: [PATCH 2/2] Revert jsconfig change --- .../server/importSuggestionsCache_invalidPackageJson.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cases/fourslash/server/importSuggestionsCache_invalidPackageJson.ts b/tests/cases/fourslash/server/importSuggestionsCache_invalidPackageJson.ts index 4c9aad57289e8..0f313a071ff87 100644 --- a/tests/cases/fourslash/server/importSuggestionsCache_invalidPackageJson.ts +++ b/tests/cases/fourslash/server/importSuggestionsCache_invalidPackageJson.ts @@ -3,7 +3,7 @@ // @Filename: /home/src/workspaces/project/jsconfig.json ////{ //// "compilerOptions": { -//// "module": "commonjs" +//// "module": "commonjs", //// }, ////}