mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-10 00:20:22 -06:00
Fix fourslash tests (#62641)
This commit is contained in:
parent
16a52ed693
commit
84f4856709
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user