Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/harness/fourslashInterfaceImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/jsxClassAttributeResolution.js
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/compiler/jsxClassAttributeResolution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ test.markerNames().forEach(marker => {
kind: "var",
kindModifiers: "declare",
sortText: completion.SortText.GlobalsOrKeywords
}]
}, {
}],
preferences: {
includeInsertTextCompletions: true
}
Expand Down
11 changes: 8 additions & 3 deletions tests/cases/fourslash/completionsWithDeprecatedTag9.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/fourslash/organizeImportsReactJsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/fourslash/organizeImportsReactJsxDev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @Filename: /home/src/workspaces/project/jsconfig.json
////{
//// "compilerOptions": {
//// "module": "commonjs",
//// "module": "commonjs"
//// },
////}

Expand Down
Loading