Fix fourslash tests (#62641)

This commit is contained in:
Andrew Branch 2025-10-20 12:47:59 -07:00 committed by GitHub
parent 16a52ed693
commit 84f4856709
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 19 additions and 12 deletions

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 {

View File

@ -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> {

View File

@ -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> {

View File

@ -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> {

View File

@ -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

View File

@ -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

View File

@ -23,8 +23,7 @@ test.markerNames().forEach(marker => {
kind: "var",
kindModifiers: "declare",
sortText: completion.SortText.GlobalsOrKeywords
}]
}, {
}],
preferences: {
includeInsertTextCompletions: true
}

View File

@ -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
}

View File

@ -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

View File

@ -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