diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 6a1aa70bf3e..8f83f0bc3f0 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -796,8 +796,8 @@ namespace FourSlash { } private verifyCompletionEntry(actual: ts.CompletionEntry, expected: FourSlashInterface.ExpectedCompletionEntry) { - const { insertText, replacementSpan, hasAction, isRecommended, kind, text, documentation, tags, source, sourceDisplay } = typeof expected === "string" - ? { insertText: undefined, replacementSpan: undefined, hasAction: undefined, isRecommended: undefined, kind: undefined, text: undefined, documentation: undefined, tags: undefined, source: undefined, sourceDisplay: undefined } + const { insertText, replacementSpan, hasAction, isRecommended, kind, kindModifiers, text, documentation, tags, source, sourceDisplay } = typeof expected === "string" + ? { insertText: undefined, replacementSpan: undefined, hasAction: undefined, isRecommended: undefined, kind: undefined, kindModifiers: undefined, text: undefined, documentation: undefined, tags: undefined, source: undefined, sourceDisplay: undefined } : expected; if (actual.insertText !== insertText) { @@ -811,8 +811,12 @@ namespace FourSlash { this.raiseError(`Expected completion replacementSpan to be ${stringify(convertedReplacementSpan)}, got ${stringify(actual.replacementSpan)}`); } - if (kind !== undefined) assert.equal(actual.kind, kind); - if (typeof expected !== "string" && "kindModifiers" in expected) assert.equal(actual.kindModifiers, expected.kindModifiers); + if (kind !== undefined || kindModifiers !== undefined) { + assert.equal(actual.kind, kind); + if (actual.kindModifiers !== (kindModifiers || "")) { + this.raiseError(`Bad kind modifiers for ${actual.name}: Expected ${kindModifiers || ""}, actual ${actual.kindModifiers}`); + } + } assert.equal(actual.hasAction, hasAction); assert.equal(actual.isRecommended, isRecommended); @@ -4916,7 +4920,7 @@ namespace FourSlashInterface { readonly hasAction?: boolean, // If not specified, will assert that this is false. readonly isRecommended?: boolean; // If not specified, will assert that this is false. readonly kind?: string, // If not specified, won't assert about this - readonly kindModifiers?: string; + readonly kindModifiers?: string, // Must be paired with 'kind' readonly text?: string; readonly documentation?: string; readonly sourceDisplay?: string; diff --git a/src/services/completions.ts b/src/services/completions.ts index 0e0bf50cf83..af9cc3d240a 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -101,9 +101,23 @@ namespace ts.Completions { function convertPathCompletions(pathCompletions: ReadonlyArray): CompletionInfo { const isGlobalCompletion = false; // We don't want the editor to offer any other completions, such as snippets, inside a comment. const isNewIdentifierLocation = true; // The user may type in a path that doesn't yet exist, creating a "new identifier" with respect to the collection of identifiers the server is aware of. - const entries = pathCompletions.map(({ name, kind, span }) => ({ name, kind, kindModifiers: ScriptElementKindModifier.none, sortText: "0", replacementSpan: span })); + const entries = pathCompletions.map(({ name, kind, span, extension }): CompletionEntry => + ({ name, kind, kindModifiers: kindModifiersFromExtension(extension), sortText: "0", replacementSpan: span })); return { isGlobalCompletion, isMemberCompletion: false, isNewIdentifierLocation, entries }; } + function kindModifiersFromExtension(extension: Extension | undefined): ScriptElementKindModifier { + switch (extension) { + case Extension.Dts: return ScriptElementKindModifier.dtsModifier; + case Extension.Js: return ScriptElementKindModifier.jsModifier; + case Extension.Json: return ScriptElementKindModifier.jsonModifier; + case Extension.Jsx: return ScriptElementKindModifier.jsxModifier; + case Extension.Ts: return ScriptElementKindModifier.tsModifier; + case Extension.Tsx: return ScriptElementKindModifier.tsxModifier; + case undefined: return ScriptElementKindModifier.none; + default: + return Debug.assertNever(extension); + } + } function jsdocCompletionInfo(entries: CompletionEntry[]): CompletionInfo { return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries }; @@ -638,7 +652,7 @@ namespace ts.Completions { switch (completion.kind) { case StringLiteralCompletionKind.Paths: { const match = find(completion.paths, p => p.name === name); - return match && createCompletionDetails(name, ScriptElementKindModifier.none, match.kind, [textPart(name)]); + return match && createCompletionDetails(name, kindModifiersFromExtension(match.extension), match.kind, [textPart(name)]); } case StringLiteralCompletionKind.Properties: { const match = find(completion.symbols, s => s.name === name); diff --git a/src/services/pathCompletions.ts b/src/services/pathCompletions.ts index d1c365c7117..97ed722dd16 100644 --- a/src/services/pathCompletions.ts +++ b/src/services/pathCompletions.ts @@ -3,17 +3,22 @@ namespace ts.Completions.PathCompletions { export interface NameAndKind { readonly name: string; readonly kind: ScriptElementKind.scriptElement | ScriptElementKind.directory | ScriptElementKind.externalModuleName; + readonly extension: Extension | undefined; } export interface PathCompletion extends NameAndKind { readonly span: TextSpan | undefined; } - function nameAndKind(name: string, kind: NameAndKind["kind"]): NameAndKind { - return { name, kind }; + function nameAndKind(name: string, kind: NameAndKind["kind"], extension: Extension | undefined): NameAndKind { + return { name, kind, extension }; } + function directoryResult(name: string): NameAndKind { + return nameAndKind(name, ScriptElementKind.directory, /*extension*/ undefined); + } + function addReplacementSpans(text: string, textStart: number, names: ReadonlyArray): ReadonlyArray { const span = getDirectoryFragmentTextSpan(text, textStart); - return names.map(({ name, kind }): PathCompletion => ({ name, kind, span })); + return names.map(({ name, kind, extension }): PathCompletion => ({ name, kind, extension, span })); } export function getStringLiteralCompletionsFromModuleNames(sourceFile: SourceFile, node: LiteralExpression, compilerOptions: CompilerOptions, host: LanguageServiceHost, typeChecker: TypeChecker): ReadonlyArray { @@ -129,7 +134,7 @@ namespace ts.Completions.PathCompletions { * * both foo.ts and foo.tsx become foo */ - const foundFiles = createMap(); + const foundFiles = createMap(); // maps file to its extension for (let filePath of files) { filePath = normalizePath(filePath); if (exclude && comparePaths(filePath, exclude, scriptPath, ignoreCase) === Comparison.EqualTo) { @@ -137,14 +142,11 @@ namespace ts.Completions.PathCompletions { } const foundFileName = includeExtensions || fileExtensionIs(filePath, Extension.Json) ? getBaseFileName(filePath) : removeFileExtension(getBaseFileName(filePath)); - - if (!foundFiles.has(foundFileName)) { - foundFiles.set(foundFileName, true); - } + foundFiles.set(foundFileName, tryGetExtensionFromPath(filePath)); } - forEachKey(foundFiles, foundFile => { - result.push(nameAndKind(foundFile, ScriptElementKind.scriptElement)); + foundFiles.forEach((ext, foundFile) => { + result.push(nameAndKind(foundFile, ScriptElementKind.scriptElement, ext)); }); } @@ -155,7 +157,7 @@ namespace ts.Completions.PathCompletions { for (const directory of directories) { const directoryName = getBaseFileName(normalizePath(directory)); if (directoryName !== "@types") { - result.push(nameAndKind(directoryName, ScriptElementKind.directory)); + result.push(directoryResult(directoryName)); } } } @@ -183,10 +185,10 @@ namespace ts.Completions.PathCompletions { if (!hasProperty(paths, path)) continue; const patterns = paths[path]; if (patterns) { - for (const { name, kind } of getCompletionsForPathMapping(path, patterns, fragment, baseDirectory, fileExtensions, host)) { + for (const { name, kind, extension } of getCompletionsForPathMapping(path, patterns, fragment, baseDirectory, fileExtensions, host)) { // Path mappings may provide a duplicate way to get to something we've already added, so don't add again. if (!result.some(entry => entry.name === name)) { - result.push(nameAndKind(name, kind)); + result.push(nameAndKind(name, kind, extension)); } } } @@ -200,7 +202,7 @@ namespace ts.Completions.PathCompletions { * Modules from node_modules (i.e. those listed in package.json) * This includes all files that are found in node_modules/moduleName/ with acceptable file extensions */ - function getCompletionEntriesForNonRelativeModules(fragment: string, scriptPath: string, compilerOptions: CompilerOptions, host: LanguageServiceHost, typeChecker: TypeChecker): NameAndKind[] { + function getCompletionEntriesForNonRelativeModules(fragment: string, scriptPath: string, compilerOptions: CompilerOptions, host: LanguageServiceHost, typeChecker: TypeChecker): ReadonlyArray { const { baseUrl, paths } = compilerOptions; const result: NameAndKind[] = []; @@ -217,7 +219,7 @@ namespace ts.Completions.PathCompletions { const fragmentDirectory = getFragmentDirectory(fragment); for (const ambientName of getAmbientModuleCompletions(fragment, fragmentDirectory, typeChecker)) { - result.push(nameAndKind(ambientName, ScriptElementKind.externalModuleName)); + result.push(nameAndKind(ambientName, ScriptElementKind.externalModuleName, /*extension*/ undefined)); } getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, fragmentDirectory, extensionOptions, result); @@ -230,7 +232,7 @@ namespace ts.Completions.PathCompletions { for (const moduleName of enumerateNodeModulesVisibleToScript(host, scriptPath)) { if (!result.some(entry => entry.name === moduleName)) { foundGlobal = true; - result.push(nameAndKind(moduleName, ScriptElementKind.externalModuleName)); + result.push(nameAndKind(moduleName, ScriptElementKind.externalModuleName, /*extension*/ undefined)); } } } @@ -265,7 +267,7 @@ namespace ts.Completions.PathCompletions { getModulesForPathsPattern(remainingFragment, baseUrl, pattern, fileExtensions, host)); function justPathMappingName(name: string): ReadonlyArray { - return startsWith(name, fragment) ? [{ name, kind: ScriptElementKind.directory }] : emptyArray; + return startsWith(name, fragment) ? [directoryResult(name)] : emptyArray; } } @@ -301,15 +303,21 @@ namespace ts.Completions.PathCompletions { // doesn't support. For now, this is safer but slower const includeGlob = normalizedSuffix ? "**/*" : "./*"; - const matches = tryReadDirectory(host, baseDirectory, fileExtensions, /*exclude*/ undefined, [includeGlob]).map(name => ({ name, kind: ScriptElementKind.scriptElement })); - const directories = tryGetDirectories(host, baseDirectory).map(d => combinePaths(baseDirectory, d)).map(name => ({ name, kind: ScriptElementKind.directory })); - - // Trim away prefix and suffix - return mapDefined(concatenate(matches, directories), ({ name, kind }) => { - const normalizedMatch = normalizePath(name); - const inner = withoutStartAndEnd(normalizedMatch, completePrefix, normalizedSuffix); - return inner !== undefined ? { name: removeLeadingDirectorySeparator(removeFileExtension(inner)), kind } : undefined; + const matches = mapDefined(tryReadDirectory(host, baseDirectory, fileExtensions, /*exclude*/ undefined, [includeGlob]), match => { + const extension = tryGetExtensionFromPath(match); + const name = trimPrefixAndSuffix(match); + return name === undefined ? undefined : nameAndKind(removeFileExtension(name), ScriptElementKind.scriptElement, extension); }); + const directories = mapDefined(tryGetDirectories(host, baseDirectory).map(d => combinePaths(baseDirectory, d)), dir => { + const name = trimPrefixAndSuffix(dir); + return name === undefined ? undefined : directoryResult(name); + }); + return [...matches, ...directories]; + + function trimPrefixAndSuffix(path: string): string | undefined { + const inner = withoutStartAndEnd(normalizePath(path), completePrefix, normalizedSuffix); + return inner === undefined ? undefined : removeLeadingDirectorySeparator(inner); + } } function withoutStartAndEnd(s: string, start: string, end: string): string | undefined { @@ -382,7 +390,10 @@ namespace ts.Completions.PathCompletions { if (options.types && !contains(options.types, packageName)) continue; if (fragmentDirectory === undefined) { - pushResult(packageName); + if (!seen.has(packageName)) { + result.push(nameAndKind(packageName, ScriptElementKind.externalModuleName, /*extension*/ undefined)); + seen.set(packageName, true); + } } else { const baseDirectory = combinePaths(directory, typeDirectoryName); @@ -393,13 +404,6 @@ namespace ts.Completions.PathCompletions { } } } - - function pushResult(moduleName: string) { - if (!seen.has(moduleName)) { - result.push(nameAndKind(moduleName, ScriptElementKind.externalModuleName)); - seen.set(moduleName, true); - } - } } function findPackageJsons(directory: string, host: LanguageServiceHost): string[] { diff --git a/src/services/types.ts b/src/services/types.ts index a43da2b6465..d517c61906a 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -1126,7 +1126,14 @@ namespace ts { ambientModifier = "declare", staticModifier = "static", abstractModifier = "abstract", - optionalModifier = "optional" + optionalModifier = "optional", + + dtsModifier = ".d.ts", + tsModifier = ".ts", + tsxModifier = ".tsx", + jsModifier = ".js", + jsxModifier = ".jsx", + jsonModifier = ".json", } export const enum ClassificationTypeNames { diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 2ea0d677709..ccc9557e948 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -5369,7 +5369,13 @@ declare namespace ts { ambientModifier = "declare", staticModifier = "static", abstractModifier = "abstract", - optionalModifier = "optional" + optionalModifier = "optional", + dtsModifier = ".d.ts", + tsModifier = ".ts", + tsxModifier = ".tsx", + jsModifier = ".js", + jsxModifier = ".jsx", + jsonModifier = ".json" } enum ClassificationTypeNames { comment = "comment", diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 91c8c397501..8f047351750 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -5369,7 +5369,13 @@ declare namespace ts { ambientModifier = "declare", staticModifier = "static", abstractModifier = "abstract", - optionalModifier = "optional" + optionalModifier = "optional", + dtsModifier = ".d.ts", + tsModifier = ".ts", + tsxModifier = ".tsx", + jsModifier = ".js", + jsxModifier = ".jsx", + jsonModifier = ".json" } enum ClassificationTypeNames { comment = "comment", diff --git a/tests/cases/fourslash/completionEntryForClassMembers2.ts b/tests/cases/fourslash/completionEntryForClassMembers2.ts index 1048b5b47d0..2ea00966ad3 100644 --- a/tests/cases/fourslash/completionEntryForClassMembers2.ts +++ b/tests/cases/fourslash/completionEntryForClassMembers2.ts @@ -189,18 +189,18 @@ ////} const validInstanceMembersOfBaseClassB: ReadonlyArray = [ - { name: "protectedMethod", text: "(method) B.protectedMethod(): void" }, + { name: "protectedMethod", text: "(method) B.protectedMethod(): void", kindModifiers: "protected" }, { name: "getValue", text: "(method) B.getValue(): string | boolean" }, ]; const validStaticMembersOfBaseClassB: ReadonlyArray = [ - { name: "staticMethod", text: "(method) B.staticMethod(): void" }, + { name: "staticMethod", text: "(method) B.staticMethod(): void", kindModifiers: "static" }, ]; const privateMembersOfBaseClassB: ReadonlyArray = [ { name: "privateMethod", text: "(method) B.privateMethod(): void" }, ]; const protectedPropertiesOfBaseClassB0: ReadonlyArray = [ - { name: "protectedMethod", text: "(method) B0.protectedMethod(): void" }, - { name: "protectedMethod1", text: "(method) B0.protectedMethod1(): void" }, + { name: "protectedMethod", text: "(method) B0.protectedMethod(): void", kindModifiers: "protected" }, + { name: "protectedMethod1", text: "(method) B0.protectedMethod1(): void", kindModifiers: "protected" }, ]; const publicPropertiesOfBaseClassB0: ReadonlyArray = [ { name: "getValue", text: "(method) B0.getValue(): string | boolean" }, @@ -214,12 +214,12 @@ const validInstanceMembersOfBaseClassB0_2 : ReadonlyArray = [ - { name: "staticMethod", text: "(method) B0.staticMethod(): void" }, - { name: "staticMethod1", text: "(method) B0.staticMethod1(): void" }, + { name: "staticMethod", text: "(method) B0.staticMethod(): void", kindModifiers: "static" }, + { name: "staticMethod1", text: "(method) B0.staticMethod1(): void", kindModifiers: "static" }, ]; const privateMembersOfBaseClassB0: ReadonlyArray = [ - { name: "privateMethod", text: "(method) B0.privateMethod(): void" }, - { name: "privateMethod1", text: "(method) B0.privateMethod1(): void" }, + { name: "privateMethod", text: "(method) B0.privateMethod(): void", kindModifiers: "private" }, + { name: "privateMethod1", text: "(method) B0.privateMethod1(): void", kindModifiers: "private" }, ]; const membersOfI: ReadonlyArray = [ { name: "methodOfInterface", text: "(method) I.methodOfInterface(): number" }, diff --git a/tests/cases/fourslash/completionForStringLiteral_details.ts b/tests/cases/fourslash/completionForStringLiteral_details.ts index f7ef83f6f39..8c6e4d36481 100644 --- a/tests/cases/fourslash/completionForStringLiteral_details.ts +++ b/tests/cases/fourslash/completionForStringLiteral_details.ts @@ -18,7 +18,7 @@ ////o["/*prop*/"]; verify.completions( - { marker: "path", includes: { name: "other", text: "other", kind: "script" }, isNewIdentifierLocation: true }, + { marker: "path", includes: { name: "other", text: "other", kind: "script", kindModifiers: ".ts" }, isNewIdentifierLocation: true }, { marker: "type", exact: { name: "a", text: "a", kind: "string" } }, { marker: "prop", diff --git a/tests/cases/fourslash/completionInJsDocQualifiedNames.ts b/tests/cases/fourslash/completionInJsDocQualifiedNames.ts index f5ce027f131..eec6f18f592 100644 --- a/tests/cases/fourslash/completionInJsDocQualifiedNames.ts +++ b/tests/cases/fourslash/completionInJsDocQualifiedNames.ts @@ -11,4 +11,13 @@ /////** @type {Foo./**/} */ ////const x = 0; -verify.completions({ marker: "", includes: { name: "T", text: "type T = number", documentation: "tee", kind: "type" } }); +verify.completions({ + marker: "", + includes: { + name: "T", + text: "type T = number", + documentation: "tee", + kind: "type", + kindModifiers: "export,declare", + }, +}); diff --git a/tests/cases/fourslash/completionListOfGenericSymbol.ts b/tests/cases/fourslash/completionListOfGenericSymbol.ts index 804b2c1d297..380407d2390 100644 --- a/tests/cases/fourslash/completionListOfGenericSymbol.ts +++ b/tests/cases/fourslash/completionListOfGenericSymbol.ts @@ -13,12 +13,14 @@ verify.completions({ text: "(property) Array.length: number", documentation: "Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.", kind: "property", + kindModifiers: "declare", }, { name: "toString", text: "(method) Array.toString(): string", documentation: "Returns a string representation of an array.", kind: "method", + kindModifiers: "declare", }, ], }); diff --git a/tests/cases/fourslash/completionsImportBaseUrl.ts b/tests/cases/fourslash/completionsImportBaseUrl.ts index 413c7984215..d3fa4d7033e 100644 --- a/tests/cases/fourslash/completionsImportBaseUrl.ts +++ b/tests/cases/fourslash/completionsImportBaseUrl.ts @@ -23,6 +23,7 @@ verify.completions({ sourceDisplay: "./a", text: "const foo: 0", kind: "const", + kindModifiers: "export", hasAction: true, }, preferences: { includeCompletionsForModuleExports: true }, diff --git a/tests/cases/fourslash/completionsImport_compilerOptionsModule.ts b/tests/cases/fourslash/completionsImport_compilerOptionsModule.ts index a5b8b0c07c2..6d1c22aec0c 100644 --- a/tests/cases/fourslash/completionsImport_compilerOptionsModule.ts +++ b/tests/cases/fourslash/completionsImport_compilerOptionsModule.ts @@ -27,6 +27,6 @@ verify.completions({ marker: ["b", "c", "d"], excludes: "foo", preferences: { includeCompletionsForModuleExports: true } }); verify.completions({ marker: ["c2", "d2"], - includes: [{ name: "foo", source: "/node_modules/a/index", text: "const foo: 0", kind: "const", hasAction: true, sourceDisplay: "a" }], + includes: [{ name: "foo", source: "/node_modules/a/index", text: "const foo: 0", kind: "const", kindModifiers: "export,declare", hasAction: true, sourceDisplay: "a" }], preferences: { includeCompletionsForModuleExports: true }, }); diff --git a/tests/cases/fourslash/completionsImport_defaultFalsePositive.ts b/tests/cases/fourslash/completionsImport_defaultFalsePositive.ts index 65088dc7756..e077e18105b 100644 --- a/tests/cases/fourslash/completionsImport_defaultFalsePositive.ts +++ b/tests/cases/fourslash/completionsImport_defaultFalsePositive.ts @@ -14,9 +14,15 @@ goTo.file("/a.ts"); verify.completions({ marker: "", - includes: [ - { name: "concat", source: "/node_modules/bar/concat", sourceDisplay: "bar/concat", text: "const concat: 0", kind: "const", hasAction: true }, - ], + includes: { + name: "concat", + source: "/node_modules/bar/concat", + sourceDisplay: "bar/concat", + text: "const concat: 0", + kind: "const", + kindModifiers: "export,declare", + hasAction: true, + }, preferences: { includeCompletionsForModuleExports: true }, }); diff --git a/tests/cases/fourslash/completionsImport_default_addToNamedImports.ts b/tests/cases/fourslash/completionsImport_default_addToNamedImports.ts index 35c06d5a550..8bd9f194758 100644 --- a/tests/cases/fourslash/completionsImport_default_addToNamedImports.ts +++ b/tests/cases/fourslash/completionsImport_default_addToNamedImports.ts @@ -16,6 +16,7 @@ verify.completions({ sourceDisplay: "./a", text: "function foo(): void", kind: "function", + kindModifiers: "export", hasAction: true, }, preferences: { includeCompletionsForModuleExports: true }, diff --git a/tests/cases/fourslash/completionsImport_default_addToNamespaceImport.ts b/tests/cases/fourslash/completionsImport_default_addToNamespaceImport.ts index 0a52a7103ee..8debd787641 100644 --- a/tests/cases/fourslash/completionsImport_default_addToNamespaceImport.ts +++ b/tests/cases/fourslash/completionsImport_default_addToNamespaceImport.ts @@ -9,7 +9,15 @@ verify.completions({ marker: "", - includes: { name: "foo", source: "/a", sourceDisplay: "./a", text: "function foo(): void", kind: "function", hasAction: true }, + includes: { + name: "foo", + source: "/a", + sourceDisplay: "./a", + text: "function foo(): void", + kind: "function", + kindModifiers: "export", + hasAction: true, + }, preferences: { includeCompletionsForModuleExports: true }, }); verify.applyCodeActionFromCompletion("", { diff --git a/tests/cases/fourslash/completionsImport_default_alreadyExistedWithRename.ts b/tests/cases/fourslash/completionsImport_default_alreadyExistedWithRename.ts index d3027bb18cf..b04a7cacffe 100644 --- a/tests/cases/fourslash/completionsImport_default_alreadyExistedWithRename.ts +++ b/tests/cases/fourslash/completionsImport_default_alreadyExistedWithRename.ts @@ -9,7 +9,15 @@ verify.completions({ marker: "", - includes: { name: "foo", source: "/a", sourceDisplay: "./a", text: "function foo(): void", kind: "function", hasAction: true }, + includes: { + name: "foo", + source: "/a", + sourceDisplay: "./a", + text: "function foo(): void", + kind: "function", + kindModifiers: "export", + hasAction: true, + }, preferences: { includeCompletionsForModuleExports: true }, }); verify.applyCodeActionFromCompletion("", { diff --git a/tests/cases/fourslash/completionsImport_default_anonymous.ts b/tests/cases/fourslash/completionsImport_default_anonymous.ts index 46b333beb29..8aa9dfb5af6 100644 --- a/tests/cases/fourslash/completionsImport_default_anonymous.ts +++ b/tests/cases/fourslash/completionsImport_default_anonymous.ts @@ -14,10 +14,7 @@ goTo.marker("0"); const preferences: FourSlashInterface.UserPreferences = { includeCompletionsForModuleExports: true }; verify.completions( - { - marker: "0", - exact: ["undefined", ...completion.statementKeywordsWithTypes], - }, + { marker: "0", exact: ["undefined", ...completion.statementKeywordsWithTypes], preferences }, { marker: "1", includes: { name: "fooBar", source: "/src/foo-bar", sourceDisplay: "./foo-bar", text: "(property) default: 0", kind: "property", hasAction: true }, diff --git a/tests/cases/fourslash/completionsImport_default_didNotExistBefore.ts b/tests/cases/fourslash/completionsImport_default_didNotExistBefore.ts index 69138fa9815..259a22d637b 100644 --- a/tests/cases/fourslash/completionsImport_default_didNotExistBefore.ts +++ b/tests/cases/fourslash/completionsImport_default_didNotExistBefore.ts @@ -10,7 +10,15 @@ verify.completions({ marker: "", - includes: { name: "foo", source: "/a", sourceDisplay: "./a", text: "function foo(): void", kind: "function", hasAction: true }, + includes: { + name: "foo", + source: "/a", + sourceDisplay: "./a", + text: "function foo(): void", + kind: "function", + kindModifiers: "export", + hasAction: true, + }, preferences: { includeCompletionsForModuleExports: true }, }); verify.applyCodeActionFromCompletion("", { diff --git a/tests/cases/fourslash/completionsImport_default_fromMergedDeclarations.ts b/tests/cases/fourslash/completionsImport_default_fromMergedDeclarations.ts index c4cfcb98531..551cfb54e75 100644 --- a/tests/cases/fourslash/completionsImport_default_fromMergedDeclarations.ts +++ b/tests/cases/fourslash/completionsImport_default_fromMergedDeclarations.ts @@ -17,7 +17,15 @@ verify.completions({ marker: "", - includes: { name: "M", source: "m", sourceDisplay: "m", text: "class M", kind: "class", hasAction: true }, + includes: { + name: "M", + source: "m", + sourceDisplay: "m", + text: "class M", + kind: "class", + kindModifiers: "export,declare", + hasAction: true, + }, preferences: { includeCompletionsForModuleExports: true }, }); verify.applyCodeActionFromCompletion("", { diff --git a/tests/cases/fourslash/completionsImport_matching.ts b/tests/cases/fourslash/completionsImport_matching.ts index 92c09b49644..c6dbac369b9 100644 --- a/tests/cases/fourslash/completionsImport_matching.ts +++ b/tests/cases/fourslash/completionsImport_matching.ts @@ -17,7 +17,7 @@ verify.completions({ marker: "", includes: ["bdf", "abcdef", "BDF"].map(name => - ({ name, source: "/a", text: `function ${name}(): void`, hasAction: true, kind: "function", sourceDisplay: "./a" })), + ({ name, source: "/a", text: `function ${name}(): void`, hasAction: true, kind: "function", kindModifiers: "export", sourceDisplay: "./a" })), excludes: ["abcde", "dbf"], preferences: { includeCompletionsForModuleExports: true }, }) diff --git a/tests/cases/fourslash/completionsImport_multipleWithSameName.ts b/tests/cases/fourslash/completionsImport_multipleWithSameName.ts index 7df6fbfd874..ae552f437fe 100644 --- a/tests/cases/fourslash/completionsImport_multipleWithSameName.ts +++ b/tests/cases/fourslash/completionsImport_multipleWithSameName.ts @@ -20,10 +20,26 @@ goTo.marker(""); verify.completions({ marker: "", exact: [ - { name: "foo", text: "var foo: number", kind: "var" }, + { name: "foo", text: "var foo: number", kind: "var", kindModifiers: "declare" }, "undefined", - { name: "foo", source: "/a", sourceDisplay: "./a", text: "const foo: 0", kind: "const", hasAction: true }, - { name: "foo", source: "/b", sourceDisplay: "./b", text: "const foo: 1", kind: "const", hasAction: true }, + { + name: "foo", + source: "/a", + sourceDisplay: "./a", + text: "const foo: 0", + kind: "const", + kindModifiers: "export", + hasAction: true, + }, + { + name: "foo", + source: "/b", + sourceDisplay: "./b", + text: "const foo: 1", + kind: "const", + kindModifiers: "export", + hasAction: true, + }, ...completion.statementKeywordsWithTypes, ], preferences: { includeCompletionsForModuleExports: true }, diff --git a/tests/cases/fourslash/completionsImport_named_addToNamedImports.ts b/tests/cases/fourslash/completionsImport_named_addToNamedImports.ts index 3442d90e05b..78df2659ade 100644 --- a/tests/cases/fourslash/completionsImport_named_addToNamedImports.ts +++ b/tests/cases/fourslash/completionsImport_named_addToNamedImports.ts @@ -10,7 +10,15 @@ verify.completions({ marker: "", - includes: { name: "foo", source: "/a", sourceDisplay: "./a", text: "function foo(): void", kind: "function", hasAction: true }, + includes: { + name: "foo", + source: "/a", + sourceDisplay: "./a", + text: "function foo(): void", + kind: "function", + kindModifiers: "export", + hasAction: true, + }, preferences: { includeCompletionsForModuleExports: true }, }); verify.applyCodeActionFromCompletion("", { diff --git a/tests/cases/fourslash/completionsImport_named_didNotExistBefore.ts b/tests/cases/fourslash/completionsImport_named_didNotExistBefore.ts index 321f27ce760..10a0c124e4d 100644 --- a/tests/cases/fourslash/completionsImport_named_didNotExistBefore.ts +++ b/tests/cases/fourslash/completionsImport_named_didNotExistBefore.ts @@ -15,7 +15,7 @@ verify.completions({ exact: [ { name: "Test2", text: "(alias) function Test2(): void\nimport Test2", kind: "alias" }, "undefined", - { name: "Test1", source: "/a", sourceDisplay: "./a", text: "function Test1(): void", kind: "function", hasAction: true }, + { name: "Test1", source: "/a", sourceDisplay: "./a", text: "function Test1(): void", kind: "function", kindModifiers: "export", hasAction: true }, ...completion.statementKeywordsWithTypes, ], preferences: { includeCompletionsForModuleExports: true }, diff --git a/tests/cases/fourslash/completionsImport_named_exportEqualsNamespace.ts b/tests/cases/fourslash/completionsImport_named_exportEqualsNamespace.ts index c6c9bc45b2c..4f4b579fe49 100644 --- a/tests/cases/fourslash/completionsImport_named_exportEqualsNamespace.ts +++ b/tests/cases/fourslash/completionsImport_named_exportEqualsNamespace.ts @@ -13,7 +13,15 @@ verify.completions({ marker: "", - includes: { name: "foo", source: "/a", sourceDisplay: "./a", text: "const N.foo: 0", kind: "const", hasAction: true }, + includes: { + name: "foo", + source: "/a", + sourceDisplay: "./a", + text: "const N.foo: 0", + kind: "const", + kindModifiers: "export,declare", + hasAction: true, + }, preferences: { includeCompletionsForModuleExports: true }, }); verify.applyCodeActionFromCompletion("", { diff --git a/tests/cases/fourslash/completionsImport_named_exportEqualsNamespace_merged.ts b/tests/cases/fourslash/completionsImport_named_exportEqualsNamespace_merged.ts index f68c03f5602..ec70d205479 100644 --- a/tests/cases/fourslash/completionsImport_named_exportEqualsNamespace_merged.ts +++ b/tests/cases/fourslash/completionsImport_named_exportEqualsNamespace_merged.ts @@ -18,6 +18,14 @@ verify.completions({ marker: "", - includes: { name: "foo", source: "n", sourceDisplay: "n", text: "const N.foo: number", kind: "const", hasAction: true }, + includes: { + name: "foo", + source: "n", + sourceDisplay: "n", + text: "const N.foo: number", + kind: "const", + kindModifiers: "export,declare", + hasAction: true, + }, preferences: { includeCompletionsForModuleExports: true }, }); diff --git a/tests/cases/fourslash/completionsImport_named_namespaceImportExists.ts b/tests/cases/fourslash/completionsImport_named_namespaceImportExists.ts index 4416b3703c9..52c33209ca3 100644 --- a/tests/cases/fourslash/completionsImport_named_namespaceImportExists.ts +++ b/tests/cases/fourslash/completionsImport_named_namespaceImportExists.ts @@ -9,7 +9,15 @@ verify.completions({ marker: "", - includes: { name: "foo", source: "/a", sourceDisplay: "./a", text: "function foo(): void", kind: "function", hasAction: true }, + includes: { + name: "foo", + source: "/a", + sourceDisplay: "./a", + text: "function foo(): void", + kind: "function", + kindModifiers: "export", + hasAction: true, + }, preferences: { includeCompletionsForModuleExports: true }, }); verify.applyCodeActionFromCompletion("", { diff --git a/tests/cases/fourslash/completionsImport_notFromIndex.ts b/tests/cases/fourslash/completionsImport_notFromIndex.ts index 4ab8eaf1012..e6aa3e680b1 100644 --- a/tests/cases/fourslash/completionsImport_notFromIndex.ts +++ b/tests/cases/fourslash/completionsImport_notFromIndex.ts @@ -18,7 +18,15 @@ for (const [marker, sourceDisplay] of [["0", "./src"], ["1", "./a"], ["2", "../a"]]) { verify.completions({ marker, - includes: { name: "x", source: "/src/a", sourceDisplay, text: "const x: 0", kind: "const", hasAction: true }, + includes: { + name: "x", + source: "/src/a", + sourceDisplay, + text: "const x: 0", + kind: "const", + kindModifiers: "export", + hasAction: true, + }, preferences: { includeCompletionsForModuleExports: true }, }); verify.applyCodeActionFromCompletion(marker, { diff --git a/tests/cases/fourslash/completionsImport_ofAlias_preferShortPath.ts b/tests/cases/fourslash/completionsImport_ofAlias_preferShortPath.ts index 81d195d0175..f5efa9cd912 100644 --- a/tests/cases/fourslash/completionsImport_ofAlias_preferShortPath.ts +++ b/tests/cases/fourslash/completionsImport_ofAlias_preferShortPath.ts @@ -20,7 +20,7 @@ verify.completions({ marker: "", exact: [ "undefined", - { name: "foo", source: "/foo/lib/foo", sourceDisplay: "./foo", text: "const foo: 0", kind: "const", hasAction: true }, + { name: "foo", source: "/foo/lib/foo", sourceDisplay: "./foo", text: "const foo: 0", kind: "const", kindModifiers: "export", hasAction: true }, ...completion.statementKeywordsWithTypes, ], preferences: { includeCompletionsForModuleExports: true }, diff --git a/tests/cases/fourslash/completionsImport_previousTokenIsSemicolon.ts b/tests/cases/fourslash/completionsImport_previousTokenIsSemicolon.ts index 36649451530..7099c4b3072 100644 --- a/tests/cases/fourslash/completionsImport_previousTokenIsSemicolon.ts +++ b/tests/cases/fourslash/completionsImport_previousTokenIsSemicolon.ts @@ -9,6 +9,14 @@ verify.completions({ marker: "", - includes: { name: "foo", source: "/a", sourceDisplay: "./a", text: "function foo(): void", kind: "function", hasAction: true }, + includes: { + name: "foo", + source: "/a", + sourceDisplay: "./a", + text: "function foo(): void", + kind: "function", + kindModifiers: "export", + hasAction: true, + }, preferences: { includeCompletionsForModuleExports: true }, }); diff --git a/tests/cases/fourslash/completionsImport_reExportDefault.ts b/tests/cases/fourslash/completionsImport_reExportDefault.ts index ae8af9c1d35..8e38faa0b05 100644 --- a/tests/cases/fourslash/completionsImport_reExportDefault.ts +++ b/tests/cases/fourslash/completionsImport_reExportDefault.ts @@ -17,8 +17,23 @@ verify.completions({ exact: [ ...completion.globalsVars, "undefined", - { name: "foo", source: "/a/b/impl", sourceDisplay: "./a", text: "function foo(): void", kind: "function", hasAction: true }, - { name: "foo", source: "/a/index", sourceDisplay: "./a", text: "(alias) function foo(): void\nexport foo", kind: "alias", hasAction: true }, + { + name: "foo", + source: "/a/b/impl", + sourceDisplay: "./a", + text: "function foo(): void", + kind: "function", + kindModifiers: "export", + hasAction: true, + }, + { + name: "foo", + source: "/a/index", + sourceDisplay: "./a", + text: "(alias) function foo(): void\nexport foo", + kind: "alias", + hasAction: true, + }, ...completion.globalKeywords, ], preferences: { includeCompletionsForModuleExports: true }, diff --git a/tests/cases/fourslash/completionsImport_require.ts b/tests/cases/fourslash/completionsImport_require.ts index 6002366ce02..892a2495485 100644 --- a/tests/cases/fourslash/completionsImport_require.ts +++ b/tests/cases/fourslash/completionsImport_require.ts @@ -11,7 +11,15 @@ verify.completions({ marker: "b", - includes: { name: "foo", source: "/a", sourceDisplay: "./a", text: "const foo: 0", kind: "const", hasAction: true }, + includes: { + name: "foo", + source: "/a", + sourceDisplay: "./a", + text: "const foo: 0", + kind: "const", + kindModifiers: "export", + hasAction: true, + }, preferences: { includeCompletionsForModuleExports: true }, }); verify.applyCodeActionFromCompletion("b", { diff --git a/tests/cases/fourslash/completionsInJsxTag.ts b/tests/cases/fourslash/completionsInJsxTag.ts index e2921aecd15..1977333b62b 100644 --- a/tests/cases/fourslash/completionsInJsxTag.ts +++ b/tests/cases/fourslash/completionsInJsxTag.ts @@ -19,4 +19,13 @@ //// } ////} -verify.completions({ marker: ["1", "2"], exact: { name: "foo", text: "(JSX attribute) foo: string", documentation: "Doc", kind: "JSX attribute" } }); +verify.completions({ + marker: ["1", "2"], + exact: { + name: "foo", + text: "(JSX attribute) foo: string", + documentation: "Doc", + kind: "JSX attribute", + kindModifiers: "declare", + }, +}); diff --git a/tests/cases/fourslash/completionsJsxAttribute.ts b/tests/cases/fourslash/completionsJsxAttribute.ts index c4d1513a6ee..4c02e1fd355 100644 --- a/tests/cases/fourslash/completionsJsxAttribute.ts +++ b/tests/cases/fourslash/completionsJsxAttribute.ts @@ -17,8 +17,8 @@ ////
; const exact: ReadonlyArray = [ - { name: "foo", kind: "JSX attribute", text: "(JSX attribute) foo: boolean", documentation: "Doc" }, - { name: "bar", kind: "JSX attribute", text: "(JSX attribute) bar: string" }, + { name: "foo", kind: "JSX attribute", kindModifiers: "declare", text: "(JSX attribute) foo: boolean", documentation: "Doc" }, + { name: "bar", kind: "JSX attribute", kindModifiers: "declare", text: "(JSX attribute) bar: string" }, ]; verify.completions({ marker: "", exact }); edit.insert("f"); diff --git a/tests/cases/fourslash/completionsOptionalKindModifier.ts b/tests/cases/fourslash/completionsOptionalKindModifier.ts index 1592fb5d10b..a8c2eb5d63b 100644 --- a/tests/cases/fourslash/completionsOptionalKindModifier.ts +++ b/tests/cases/fourslash/completionsOptionalKindModifier.ts @@ -8,7 +8,7 @@ verify.completions({ marker: "a", exact: [ - { name: "a", kindModifiers: "optional" }, - { name: "method", kindModifiers: "optional" }, + { name: "a", kind: "property", kindModifiers: "optional" }, + { name: "method", kind: "method", kindModifiers: "optional" }, ], }); diff --git a/tests/cases/fourslash/completionsPaths.ts b/tests/cases/fourslash/completionsPaths.ts index e875e3e2147..8dc33a5f45b 100644 --- a/tests/cases/fourslash/completionsPaths.ts +++ b/tests/cases/fourslash/completionsPaths.ts @@ -24,6 +24,14 @@ ////const foo = require(`x//*4*/`); verify.completions( - { marker: "1", exact: ["y", "x"], isNewIdentifierLocation: true }, - { marker: ["2", "3", "4"], exact: ["bar", "foo"], isNewIdentifierLocation: true }, + { + marker: "1", + exact: ["y", "x"].map(name => ({ name, kind: "directory" })), + isNewIdentifierLocation: true, + }, + { + marker: ["2", "3", "4"], + exact: ["bar", "foo"].map(name => ({ name, kind: "script", kindModifiers: ".d.ts" })), + isNewIdentifierLocation: true, + }, ); diff --git a/tests/cases/fourslash/completionsPathsJsonModule.ts b/tests/cases/fourslash/completionsPathsJsonModule.ts index fb3370c69c9..06600834a0b 100644 --- a/tests/cases/fourslash/completionsPathsJsonModule.ts +++ b/tests/cases/fourslash/completionsPathsJsonModule.ts @@ -9,4 +9,8 @@ // @Filename: /project/index.ts ////import { } from "/**/"; -verify.completions({ marker: "", exact: "test.json", isNewIdentifierLocation: true }); +verify.completions({ + marker: "", + exact: { name: "test.json", kind: "script", kindModifiers: ".json" }, + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/completionsPathsRelativeJsonModule.ts b/tests/cases/fourslash/completionsPathsRelativeJsonModule.ts index a0c9f92e545..2f9c1bcf6e2 100644 --- a/tests/cases/fourslash/completionsPathsRelativeJsonModule.ts +++ b/tests/cases/fourslash/completionsPathsRelativeJsonModule.ts @@ -9,4 +9,8 @@ // @Filename: /project/index.ts ////import { } from ".//**/"; -verify.completions({ marker: "", exact: "test.json", isNewIdentifierLocation: true }); +verify.completions({ + marker: "", + exact: { name: "test.json", kind: "script", kindModifiers: ".json" }, + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/completionsPaths_fromTypings.ts b/tests/cases/fourslash/completionsPaths_fromTypings.ts index 65547b3111d..c7382784cbf 100644 --- a/tests/cases/fourslash/completionsPaths_fromTypings.ts +++ b/tests/cases/fourslash/completionsPaths_fromTypings.ts @@ -13,6 +13,9 @@ verify.completions( { marker: "0", exact: [], isNewIdentifierLocation: true }, - { marker: "1", exact: ["bar", "index"], isNewIdentifierLocation: true }, - { marker: "2", exact: ["bar", "index"], isNewIdentifierLocation: true }, + { + marker: ["1", "2"], + exact: ["bar", "index"].map(name => ({ name, kind: "script", kindModifiers: ".d.ts" })), + isNewIdentifierLocation: true, + }, ); diff --git a/tests/cases/fourslash/completionsPaths_importType.ts b/tests/cases/fourslash/completionsPaths_importType.ts index 4d351f2494e..3541f2c39e7 100644 --- a/tests/cases/fourslash/completionsPaths_importType.ts +++ b/tests/cases/fourslash/completionsPaths_importType.ts @@ -17,7 +17,19 @@ /////** @type {import("/*3*/")} */ verify.completions( - { marker: "1", exact: "package", isNewIdentifierLocation: true }, - { marker: "2", exact: ["lib", "ns", "user", "node_modules"], isNewIdentifierLocation: true }, - { marker: "3", exact: ["package"], isNewIdentifierLocation: true }, + { + marker: ["1", "3"], + exact: { name: "package", kind: "directory" }, + isNewIdentifierLocation: true, + }, + { + marker: "2", + exact: [ + { name: "lib", kind: "script", kindModifiers: ".d.ts" }, + { name: "ns", kind: "script", kindModifiers: ".ts" }, + { name: "user", kind: "script", kindModifiers: ".js" }, + { name: "node_modules", kind: "directory" }, + ], + isNewIdentifierLocation: true + }, ); diff --git a/tests/cases/fourslash/completionsPaths_kinds.ts b/tests/cases/fourslash/completionsPaths_kinds.ts index 984ed17df22..e986457f7a0 100644 --- a/tests/cases/fourslash/completionsPaths_kinds.ts +++ b/tests/cases/fourslash/completionsPaths_kinds.ts @@ -22,6 +22,9 @@ verify.completions({ marker: ["0", "1"], - exact: [{ name: "b", kind: "script" }, { name: "dir", kind: "directory" }], + exact: [ + { name: "b", kind: "script", kindModifiers: ".ts" }, + { name: "dir", kind: "directory" }, + ], isNewIdentifierLocation: true }); diff --git a/tests/cases/fourslash/completionsPaths_pathMapping.ts b/tests/cases/fourslash/completionsPaths_pathMapping.ts index 9bff5424e5d..381fe5b7d38 100644 --- a/tests/cases/fourslash/completionsPaths_pathMapping.ts +++ b/tests/cases/fourslash/completionsPaths_pathMapping.ts @@ -22,6 +22,18 @@ const [r0, r1] = test.ranges(); verify.completions( - { marker: "0", exact: ["a", "b", "dir"], isNewIdentifierLocation: true }, - { marker: "1", exact: "x", isNewIdentifierLocation: true }, + { + marker: "0", + exact: [ + { name: "a", kind: "script", kindModifiers: ".ts" }, + { name: "b", kind: "script", kindModifiers: ".ts" }, + { name: "dir", kind: "directory" }, + ], + isNewIdentifierLocation: true, + }, + { + marker: "1", + exact: { name: "x", kind: "script", kindModifiers: ".ts" }, + isNewIdentifierLocation: true, + }, ); diff --git a/tests/cases/fourslash/completionsPaths_pathMapping_parentDirectory.ts b/tests/cases/fourslash/completionsPaths_pathMapping_parentDirectory.ts index f870af30656..c34f6e5db88 100644 --- a/tests/cases/fourslash/completionsPaths_pathMapping_parentDirectory.ts +++ b/tests/cases/fourslash/completionsPaths_pathMapping_parentDirectory.ts @@ -16,4 +16,8 @@ //// } ////} -verify.completions({ marker: "", exact: ["x"], isNewIdentifierLocation: true }); +verify.completions({ + marker: "", + exact: { name: "x", kind: "script", kindModifiers: ".ts" }, + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/completionsPaths_pathMapping_relativePath.ts b/tests/cases/fourslash/completionsPaths_pathMapping_relativePath.ts index a86e5bcb0d3..b059a977eb9 100644 --- a/tests/cases/fourslash/completionsPaths_pathMapping_relativePath.ts +++ b/tests/cases/fourslash/completionsPaths_pathMapping_relativePath.ts @@ -19,4 +19,8 @@ //// } ////} -verify.completions({ marker: "", exact: ["a", "b"], isNewIdentifierLocation: true }); +verify.completions({ + marker: "", + exact: ["a", "b"].map(name => ({ name, kind: "script", kindModifiers: ".ts" })), + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/completionsPaths_pathMapping_topLevel.ts b/tests/cases/fourslash/completionsPaths_pathMapping_topLevel.ts index 9b9c67abbfc..a448abe2dff 100644 --- a/tests/cases/fourslash/completionsPaths_pathMapping_topLevel.ts +++ b/tests/cases/fourslash/completionsPaths_pathMapping_topLevel.ts @@ -13,4 +13,8 @@ //// } ////} -verify.completions({ marker: "", exact: ["src", "foo/"], isNewIdentifierLocation: true }); +verify.completions({ + marker: "", + exact: ["src", "foo/"].map(name => ({ name, kind: "directory" })), + isNewIdentifierLocation: true, +}); diff --git a/tests/cases/fourslash/completionsRecommended_import.ts b/tests/cases/fourslash/completionsRecommended_import.ts index 4f58827f742..50e3c7b00aa 100644 --- a/tests/cases/fourslash/completionsRecommended_import.ts +++ b/tests/cases/fourslash/completionsRecommended_import.ts @@ -24,6 +24,7 @@ const classEntry = (isConstructor: boolean): FourSlashInterface.ExpectedCompleti source: "/a", sourceDisplay: "./a", kind: "class", + kindModifiers: "export", text: isConstructor ? "constructor Cls(): Cls" : "class Cls", hasAction: true, isRecommended: true, diff --git a/tests/cases/fourslash/completionsRecommended_local.ts b/tests/cases/fourslash/completionsRecommended_local.ts index 76690b7dbbd..51b43746a78 100644 --- a/tests/cases/fourslash/completionsRecommended_local.ts +++ b/tests/cases/fourslash/completionsRecommended_local.ts @@ -27,6 +27,7 @@ const abs = (ctr: boolean): FourSlashInterface.ExpectedCompletionEntry => ({ name: "Abs", text: ctr ? "constructor Abs(): Abs" : "class Abs", kind: "class", + kindModifiers: "abstract", }); verify.completions( diff --git a/tests/cases/fourslash/completionsRecommended_namespace.ts b/tests/cases/fourslash/completionsRecommended_namespace.ts index 9cf98f43b59..0d6e19e7106 100644 --- a/tests/cases/fourslash/completionsRecommended_namespace.ts +++ b/tests/cases/fourslash/completionsRecommended_namespace.ts @@ -23,10 +23,22 @@ ////alpha.f(new /*c1*/); verify.completions( - { marker: ["a0", "a1"], includes: { name: "Name", text: "namespace Name", kind: "module", isRecommended: true } }, + { + marker: ["a0", "a1"], + includes: { name: "Name", text: "namespace Name", kind: "module", kindModifiers: "export", isRecommended: true }, + }, { marker: ["b0", "b1"], - includes: { name: "Name", source: "/a", sourceDisplay: "./a", text: "namespace Name", kind: "module", hasAction: true, isRecommended: true, }, + includes: { + name: "Name", + source: "/a", + sourceDisplay: "./a", + text: "namespace Name", + kind: "module", + kindModifiers: "export", + hasAction: true, + isRecommended: true, + }, preferences: { includeCompletionsForModuleExports: true }, }, { marker: ["c0", "c1"], includes: { name: "alpha", text: "import alpha", kind: "alias", isRecommended: true } }, diff --git a/tests/cases/fourslash/exportDefaultClass.ts b/tests/cases/fourslash/exportDefaultClass.ts index da22984757a..5943eb75697 100644 --- a/tests/cases/fourslash/exportDefaultClass.ts +++ b/tests/cases/fourslash/exportDefaultClass.ts @@ -5,4 +5,4 @@ ////} //// /*2*/ -verify.completions({ marker: test.markers(), includes: { name: "C", text: "class C", kind: "class" } }); +verify.completions({ marker: test.markers(), includes: { name: "C", text: "class C", kind: "class", kindModifiers: "export" } }); diff --git a/tests/cases/fourslash/exportDefaultFunction.ts b/tests/cases/fourslash/exportDefaultFunction.ts index 3b7882e025d..4597c8a4e45 100644 --- a/tests/cases/fourslash/exportDefaultFunction.ts +++ b/tests/cases/fourslash/exportDefaultFunction.ts @@ -7,5 +7,5 @@ verify.completions({ marker: test.markers(), - includes: { name: "func", text: "function func(): void", kind: "function" }, + includes: { name: "func", text: "function func(): void", kind: "function", kindModifiers: "export" }, }); diff --git a/tests/cases/fourslash/getJavaScriptCompletions1.ts b/tests/cases/fourslash/getJavaScriptCompletions1.ts index fd677b12354..51db240642b 100644 --- a/tests/cases/fourslash/getJavaScriptCompletions1.ts +++ b/tests/cases/fourslash/getJavaScriptCompletions1.ts @@ -6,4 +6,4 @@ ////var v; ////v./**/ -verify.completions({ marker: "", includes: { name: "toExponential", kind: "method" } }); +verify.completions({ marker: "", includes: { name: "toExponential", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/getJavaScriptCompletions10.ts b/tests/cases/fourslash/getJavaScriptCompletions10.ts index 0eaccdb26b9..f12d5a5acf3 100644 --- a/tests/cases/fourslash/getJavaScriptCompletions10.ts +++ b/tests/cases/fourslash/getJavaScriptCompletions10.ts @@ -7,4 +7,4 @@ //// */ ////function f() { this./**/ } -verify.completions({ marker: "", includes: { name: "toExponential", kind: "method" } }); +verify.completions({ marker: "", includes: { name: "toExponential", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/getJavaScriptCompletions11.ts b/tests/cases/fourslash/getJavaScriptCompletions11.ts index 9b15b09a277..e48beb09c3b 100644 --- a/tests/cases/fourslash/getJavaScriptCompletions11.ts +++ b/tests/cases/fourslash/getJavaScriptCompletions11.ts @@ -9,7 +9,7 @@ verify.completions({ marker: "", includes: [ - { name: "toExponential", kind: "method" }, - { name: "charCodeAt", kind: "method" }, + { name: "toExponential", kind: "method", kindModifiers: "declare" }, + { name: "charCodeAt", kind: "method", kindModifiers: "declare" }, ], }); diff --git a/tests/cases/fourslash/getJavaScriptCompletions12.ts b/tests/cases/fourslash/getJavaScriptCompletions12.ts index a819f26e250..5534b20b8ea 100644 --- a/tests/cases/fourslash/getJavaScriptCompletions12.ts +++ b/tests/cases/fourslash/getJavaScriptCompletions12.ts @@ -24,7 +24,7 @@ ////var test1 = function(x) { return x./*4*/ }, test2 = function(a) { return a./*5*/ }; verify.completions( - { marker: "1", includes: { name: "charCodeAt", kind: "method" } }, - { marker: ["2", "3", "4"], includes: { name: "toExponential", kind: "method" } }, + { marker: "1", includes: { name: "charCodeAt", kind: "method", kindModifiers: "declare" } }, + { marker: ["2", "3", "4"], includes: { name: "toExponential", kind: "method", kindModifiers: "declare" } }, { marker: "5", includes: { name: "test1", kind: "warning" } }, ); diff --git a/tests/cases/fourslash/getJavaScriptCompletions16.ts b/tests/cases/fourslash/getJavaScriptCompletions16.ts index 8f698004eb4..112bef3c24b 100644 --- a/tests/cases/fourslash/getJavaScriptCompletions16.ts +++ b/tests/cases/fourslash/getJavaScriptCompletions16.ts @@ -24,7 +24,7 @@ goTo.marker('body'); edit.insert('.'); -verify.completions({ includes: { name: "toFixed", kind: "method" } }); +verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); edit.backspace(); verify.signatureHelp({ @@ -35,4 +35,4 @@ verify.signatureHelp({ goTo.marker('method'); edit.insert('.'); -verify.completions({ includes: { name: "toFixed", kind: "method" } }); +verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/getJavaScriptCompletions18.ts b/tests/cases/fourslash/getJavaScriptCompletions18.ts index bad58889efb..efe0e7513d9 100644 --- a/tests/cases/fourslash/getJavaScriptCompletions18.ts +++ b/tests/cases/fourslash/getJavaScriptCompletions18.ts @@ -13,8 +13,8 @@ goTo.marker('a'); edit.insert('.'); -verify.completions({ includes: { name: "toFixed", kind: "method" } }); +verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); goTo.marker('b'); edit.insert('.'); -verify.completions({ includes: { name: "substr", kind: "method" } }); +verify.completions({ includes: { name: "substr", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/getJavaScriptCompletions19.ts b/tests/cases/fourslash/getJavaScriptCompletions19.ts index 0c90a32a322..54624eb3e4c 100644 --- a/tests/cases/fourslash/getJavaScriptCompletions19.ts +++ b/tests/cases/fourslash/getJavaScriptCompletions19.ts @@ -18,8 +18,8 @@ goTo.marker('str'); edit.insert('.'); -verify.completions({ includes: { name: "substr", kind: "method" } }); +verify.completions({ includes: { name: "substr", kind: "method", kindModifiers: "declare" } }); goTo.marker('num'); edit.insert('.'); -verify.completions({ includes: { name: "toFixed", kind: "method" } }); +verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/getJavaScriptCompletions2.ts b/tests/cases/fourslash/getJavaScriptCompletions2.ts index 4425e4a76e8..b7e4fa6a73a 100644 --- a/tests/cases/fourslash/getJavaScriptCompletions2.ts +++ b/tests/cases/fourslash/getJavaScriptCompletions2.ts @@ -6,4 +6,4 @@ ////var v; ////v./**/ -verify.completions({ marker: "", includes: { name: "valueOf", kind: "method" } }); +verify.completions({ marker: "", includes: { name: "valueOf", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/getJavaScriptCompletions3.ts b/tests/cases/fourslash/getJavaScriptCompletions3.ts index da2a05c0cfb..6f96d0dd324 100644 --- a/tests/cases/fourslash/getJavaScriptCompletions3.ts +++ b/tests/cases/fourslash/getJavaScriptCompletions3.ts @@ -6,4 +6,4 @@ ////var v; ////v./**/ -verify.completions({ marker: "", includes: { name: "concat", kind: "method" } }); \ No newline at end of file +verify.completions({ marker: "", includes: { name: "concat", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/getJavaScriptCompletions4.ts b/tests/cases/fourslash/getJavaScriptCompletions4.ts index 841c60d91b4..8036493512d 100644 --- a/tests/cases/fourslash/getJavaScriptCompletions4.ts +++ b/tests/cases/fourslash/getJavaScriptCompletions4.ts @@ -6,4 +6,4 @@ ////function foo(a,b) { } ////foo(1,2)./**/ -verify.completions({ marker: "", includes: { name: "toExponential", kind: "method" } }); +verify.completions({ marker: "", includes: { name: "toExponential", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/getJavaScriptCompletions5.ts b/tests/cases/fourslash/getJavaScriptCompletions5.ts index 85808d46626..937a3488016 100644 --- a/tests/cases/fourslash/getJavaScriptCompletions5.ts +++ b/tests/cases/fourslash/getJavaScriptCompletions5.ts @@ -10,4 +10,4 @@ //// let x = foo; //// foo(1)./**/ -verify.completions({ marker: "", includes: { name: "toExponential", kind: "method" } }); +verify.completions({ marker: "", includes: { name: "toExponential", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/getJavaScriptCompletions8.ts b/tests/cases/fourslash/getJavaScriptCompletions8.ts index 6ac9387b10c..73673d878d3 100644 --- a/tests/cases/fourslash/getJavaScriptCompletions8.ts +++ b/tests/cases/fourslash/getJavaScriptCompletions8.ts @@ -8,4 +8,4 @@ ////var v; ////v()./**/ -verify.completions({ marker: "", includes: { name: "toExponential", kind: "method" } }); +verify.completions({ marker: "", includes: { name: "toExponential", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/getJavaScriptCompletions9.ts b/tests/cases/fourslash/getJavaScriptCompletions9.ts index de9a9c068db..90500ed9d48 100644 --- a/tests/cases/fourslash/getJavaScriptCompletions9.ts +++ b/tests/cases/fourslash/getJavaScriptCompletions9.ts @@ -8,4 +8,4 @@ ////var v; ////new v()./**/ -verify.completions({ marker: "", includes: { name: "toExponential", kind: "method" } }); +verify.completions({ marker: "", includes: { name: "toExponential", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/getJavaScriptQuickInfo8.ts b/tests/cases/fourslash/getJavaScriptQuickInfo8.ts index 9b047869896..76a4ea64a9b 100644 --- a/tests/cases/fourslash/getJavaScriptQuickInfo8.ts +++ b/tests/cases/fourslash/getJavaScriptQuickInfo8.ts @@ -21,9 +21,9 @@ goTo.marker('1'); edit.insert('.'); -verify.completions({ includes: { name: "toFixed", kind: "method" } }); +verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); edit.backspace(); goTo.marker('2'); edit.insert('.'); -verify.completions({ includes: { name: "substr", kind: "method" } }); +verify.completions({ includes: { name: "substr", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/importJsNodeModule1.ts b/tests/cases/fourslash/importJsNodeModule1.ts index e5177d19a88..c66a466781c 100644 --- a/tests/cases/fourslash/importJsNodeModule1.ts +++ b/tests/cases/fourslash/importJsNodeModule1.ts @@ -13,4 +13,4 @@ goTo.marker(); edit.insert('.'); verify.completions({ includes: ["n", "s", "b"].map(name => ({ name, kind: "property" })) }); edit.insert('n.'); -verify.completions({ includes: { name: "toFixed", kind: "method" } }); +verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/importJsNodeModule2.ts b/tests/cases/fourslash/importJsNodeModule2.ts index 34ed62814ad..0ceae59b215 100644 --- a/tests/cases/fourslash/importJsNodeModule2.ts +++ b/tests/cases/fourslash/importJsNodeModule2.ts @@ -23,4 +23,4 @@ verify.completions({ ], }); edit.insert('n.'); -verify.completions({ includes: { name: "toFixed", kind: "method" } }); +verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/importJsNodeModule3.ts b/tests/cases/fourslash/importJsNodeModule3.ts index 761a2ef3e45..4f3777724e1 100644 --- a/tests/cases/fourslash/importJsNodeModule3.ts +++ b/tests/cases/fourslash/importJsNodeModule3.ts @@ -26,11 +26,11 @@ goTo.marker(); edit.insert('.'); verify.completions({ includes: ["n", "s", "b"].map(name => ({ name, kind: "property" })) });; edit.insert('n.'); -verify.completions({ includes: { name: "toFixed", kind: "method" } }); +verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); edit.backspace(4); edit.insert('y.'); -verify.completions({ includes: { name: "toUpperCase", kind: "method" } }); +verify.completions({ includes: { name: "toUpperCase", kind: "method", kindModifiers: "declare" } }); edit.backspace(2); edit.insert('z('); verify.signatureHelp({ diff --git a/tests/cases/fourslash/importJsNodeModule4.ts b/tests/cases/fourslash/importJsNodeModule4.ts index 08e9b936985..0358f682a0c 100644 --- a/tests/cases/fourslash/importJsNodeModule4.ts +++ b/tests/cases/fourslash/importJsNodeModule4.ts @@ -14,4 +14,4 @@ goTo.marker(); edit.insert('.'); verify.completions({ includes: ["n", "s", "b"].map(name => ({ name, kind: "property" })) });; edit.insert('n.'); -verify.completions({ includes: { name: "toFixed", kind: "method" } }); +verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/javaScriptClass4.ts b/tests/cases/fourslash/javaScriptClass4.ts index eae26f500cd..5b66c1e2909 100644 --- a/tests/cases/fourslash/javaScriptClass4.ts +++ b/tests/cases/fourslash/javaScriptClass4.ts @@ -18,4 +18,4 @@ goTo.marker(); edit.insert('.baz.'); -verify.completions({ includes: { name: "substr", kind: "method" } }); +verify.completions({ includes: { name: "substr", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/javaScriptModules13.ts b/tests/cases/fourslash/javaScriptModules13.ts index 3f462f343ee..62987047862 100644 --- a/tests/cases/fourslash/javaScriptModules13.ts +++ b/tests/cases/fourslash/javaScriptModules13.ts @@ -24,4 +24,4 @@ verify.completions({ marker: "", includes: "y", excludes: "invisible" }); edit.insert('x.'); verify.completions({ includes: { name: "a", kind: "property" } }); edit.insert('a.'); -verify.completions({ includes: { name: "toFixed", kind: "method" } }); +verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/javaScriptModules15.ts b/tests/cases/fourslash/javaScriptModules15.ts index 7a000c53a2c..f81e6d090cf 100644 --- a/tests/cases/fourslash/javaScriptModules15.ts +++ b/tests/cases/fourslash/javaScriptModules15.ts @@ -22,4 +22,4 @@ goTo.marker(); edit.insert('.'); verify.completions({ includes: ["s", "b", "n"].map(name => ({ name, kind: "property" })) }); edit.insert('n.'); -verify.completions({ includes: { name: "toFixed", kind: "method" } }); +verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/javaScriptModules16.ts b/tests/cases/fourslash/javaScriptModules16.ts index 715e5d84da4..7c3bb31436d 100644 --- a/tests/cases/fourslash/javaScriptModules16.ts +++ b/tests/cases/fourslash/javaScriptModules16.ts @@ -22,4 +22,4 @@ verify.completions({ ], }); edit.insert('n.'); -verify.completions({ includes: { name: "toFixed", kind: "method" } }); +verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/javaScriptModules17.ts b/tests/cases/fourslash/javaScriptModules17.ts index 02cddc4006f..09174c81579 100644 --- a/tests/cases/fourslash/javaScriptModules17.ts +++ b/tests/cases/fourslash/javaScriptModules17.ts @@ -13,4 +13,4 @@ goTo.marker(); edit.insert('.'); verify.completions({ includes: ["n", "s", "b"].map(name => ({ name, kind: "property" })) }); edit.insert('n.'); -verify.completions({ includes: { name: "toFixed", kind: "method" } }); +verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/javaScriptModules19.ts b/tests/cases/fourslash/javaScriptModules19.ts index 37304c4593a..1fe4ae3cfd1 100644 --- a/tests/cases/fourslash/javaScriptModules19.ts +++ b/tests/cases/fourslash/javaScriptModules19.ts @@ -22,4 +22,4 @@ verify.completions({ marker: "", includes: "y", excludes: "invisible" }); edit.insert('x.'); verify.completions({ includes: { name: "a", kind: "property" } }); edit.insert('a.'); -verify.completions({ includes: { name: "toFixed", kind: "method" } }); +verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/javaScriptPrototype1.ts b/tests/cases/fourslash/javaScriptPrototype1.ts index e586b124e44..983af3fe9f8 100644 --- a/tests/cases/fourslash/javaScriptPrototype1.ts +++ b/tests/cases/fourslash/javaScriptPrototype1.ts @@ -28,7 +28,7 @@ edit.backspace(); // Members of a class method (1) goTo.marker('2'); edit.insert('.'); -verify.completions({ includes: { name: "length", kind: "property" } }); +verify.completions({ includes: { name: "length", kind: "property", kindModifiers: "declare" } }); edit.backspace(); // Members of the invocation of a class method (1) diff --git a/tests/cases/fourslash/javaScriptPrototype2.ts b/tests/cases/fourslash/javaScriptPrototype2.ts index 79169e47b0c..f8c2e56e1a9 100644 --- a/tests/cases/fourslash/javaScriptPrototype2.ts +++ b/tests/cases/fourslash/javaScriptPrototype2.ts @@ -26,7 +26,7 @@ edit.backspace(); // Verify the type of the instance property goTo.marker('2'); edit.insert('.'); -verify.completions({ includes: { name: "toFixed", kind: "method" } }); +verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); goTo.marker('3'); edit.insert('.'); diff --git a/tests/cases/fourslash/jsDocFunctionSignatures3.ts b/tests/cases/fourslash/jsDocFunctionSignatures3.ts index c519a1dcc72..443c482e65e 100644 --- a/tests/cases/fourslash/jsDocFunctionSignatures3.ts +++ b/tests/cases/fourslash/jsDocFunctionSignatures3.ts @@ -23,10 +23,10 @@ goTo.marker('1'); edit.insert('.'); -verify.completions({ includes: { name: "substr", kind: "method" } }); +verify.completions({ includes: { name: "substr", kind: "method", kindModifiers: "declare" } }); edit.backspace(); goTo.marker('2'); edit.insert('.'); -verify.completions({ includes: { name: "toFixed", kind: "method" } }); +verify.completions({ includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); edit.backspace(); diff --git a/tests/cases/fourslash/jsDocGenerics1.ts b/tests/cases/fourslash/jsDocGenerics1.ts index 70e13851cf7..810d8fce664 100644 --- a/tests/cases/fourslash/jsDocGenerics1.ts +++ b/tests/cases/fourslash/jsDocGenerics1.ts @@ -23,4 +23,4 @@ //// var x; //// x[0].a./*3*/ -verify.completions({ marker: test.markers(), includes: { name: "toFixed", kind: "method" } }); +verify.completions({ marker: test.markers(), includes: { name: "toFixed", kind: "method", kindModifiers: "declare" } }); diff --git a/tests/cases/fourslash/jsFileJsdocTypedefTagTypeExpressionCompletion.ts b/tests/cases/fourslash/jsFileJsdocTypedefTagTypeExpressionCompletion.ts index d3c4aafc938..a117bae1b11 100644 --- a/tests/cases/fourslash/jsFileJsdocTypedefTagTypeExpressionCompletion.ts +++ b/tests/cases/fourslash/jsFileJsdocTypedefTagTypeExpressionCompletion.ts @@ -26,10 +26,10 @@ const values: ReadonlyArray = const typeMembers: ReadonlyArray = [ { name: "NumberLike", kind: "type" }, { name: "People", kind: "type" }, - { name: "O", kind: "module" }, + { name: "O", kind: "module", kindModifiers: "export" }, ]; function warnings(entries: ReadonlyArray): ReadonlyArray { - return entries.map(e => ({ ...e, kind: "warning" })); + return entries.map(e => ({ ...e, kind: "warning", kindModifiers: undefined })); } verify.completions( diff --git a/tests/cases/fourslash/jsFileJsdocTypedefTagTypeExpressionCompletion3.ts b/tests/cases/fourslash/jsFileJsdocTypedefTagTypeExpressionCompletion3.ts index 0c939191808..efe73d9c023 100644 --- a/tests/cases/fourslash/jsFileJsdocTypedefTagTypeExpressionCompletion3.ts +++ b/tests/cases/fourslash/jsFileJsdocTypedefTagTypeExpressionCompletion3.ts @@ -44,7 +44,7 @@ verify.completions( { marker: "typeFooMember", exact: [ - { name: "Namespace", kind: "module" }, + { name: "Namespace", kind: "module", kindModifiers: "export" }, ...warnings(["Foo", "value", "property1", "method1", "method3", "method4", "foo", "age", "SomeType", "x", "x1"]), ], }, @@ -84,7 +84,7 @@ verify.completions( marker: "valueMemberOfFoo", exact: [ { name: "prototype", kind: "property" }, - { name: "method1", kind: "method" }, + { name: "method1", kind: "method", kindModifiers: "static" }, ...completion.functionMembers, ...warnings(["Foo", "value", "property1", "method3", "method4", "foo", "age", "Namespace", "SomeType", "x", "x1"]), ], diff --git a/tests/cases/fourslash/jsdocTypedefTagTypeExpressionCompletion.ts b/tests/cases/fourslash/jsdocTypedefTagTypeExpressionCompletion.ts index 21cea81e57b..7beeab84c57 100644 --- a/tests/cases/fourslash/jsdocTypedefTagTypeExpressionCompletion.ts +++ b/tests/cases/fourslash/jsdocTypedefTagTypeExpressionCompletion.ts @@ -41,11 +41,11 @@ verify.completions( }, { marker: "typeFooMember", - exact: { name: "Namespace", kind: "module" }, + exact: { name: "Namespace", kind: "module", kindModifiers: "export" }, }, { marker: "NamespaceMember", - exact: { name: "SomeType", kind: "interface" }, + exact: { name: "SomeType", kind: "interface", kindModifiers: "export" }, }, { marker: "globalValue", @@ -71,7 +71,7 @@ verify.completions( marker: "valueMemberOfFoo", exact: [ "prototype", - { name: "method1", kind: "method" }, + { name: "method1", kind: "method", kindModifiers: "static" }, ...completion.functionMembers, ], }, diff --git a/tests/cases/fourslash/noImportCompletionsInOtherJavaScriptFile.ts b/tests/cases/fourslash/noImportCompletionsInOtherJavaScriptFile.ts index 681ea8f04d7..71ed84d7768 100644 --- a/tests/cases/fourslash/noImportCompletionsInOtherJavaScriptFile.ts +++ b/tests/cases/fourslash/noImportCompletionsInOtherJavaScriptFile.ts @@ -23,6 +23,7 @@ verify.completions({ sourceDisplay: "./node_modules/foo/index", text: "const fail: number", kind: "const", + kindModifiers: "export,declare", hasAction: true, }, preferences: { includeCompletionsForModuleExports: true },