🤖 Pick PR #62641 (Fix fourslash tests) into tsgo-port (#62642)

Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
Co-authored-by: Andrew Branch <andrew@wheream.io>
This commit is contained in:
TypeScript Bot
2025-10-20 12:51:20 -07:00
committed by GitHub
parent 0933ab5946
commit 050a6f8127
10 changed files with 19 additions and 12 deletions
+3
View File
@@ -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 {
@@ -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<T> {
@@ -8,7 +8,7 @@ export const a = <App></App>;
"name": "@types/react",
"version": "0.0.1",
"main": "",
"types": "index.d.ts",
"types": "index.d.ts"
}
//// [index.d.ts]
interface IntrinsicClassAttributesAlias<T> {
@@ -8,7 +8,7 @@ export const a = <App></App>;
"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<T> {
@@ -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
@@ -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
@@ -23,8 +23,7 @@ test.markerNames().forEach(marker => {
kind: "var",
kindModifiers: "declare",
sortText: completion.SortText.GlobalsOrKeywords
}]
}, {
}],
preferences: {
includeInsertTextCompletions: true
}
@@ -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
}
@@ -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
@@ -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