diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index d13e12a6f19..23a3e01245c 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -7487,7 +7487,7 @@ namespace ts { export function getDirectoryPath(path: Path): Path; /** * Returns the path except for its basename. Semantics align with NodeJS's `path.dirname` - * except that we support URL's as well. + * except that we support URLs as well. * * ```ts * getDirectoryPath("/path/to/file.ext") === "/path/to" diff --git a/tests/cases/fourslash/completionsImport_filteredByPackageJson.ts b/tests/cases/fourslash/completionsImport_filteredByPackageJson.ts new file mode 100644 index 00000000000..1f6b1ac60eb --- /dev/null +++ b/tests/cases/fourslash/completionsImport_filteredByPackageJson.ts @@ -0,0 +1,44 @@ +/// + +//@noEmit: true + +//@Filename: /package.json +////{ +//// "dependencies": { +//// "react": "*" +//// } +////} + +//@Filename: /node_modules/@types/react/index.d.ts +////export declare var React: any; + +//@Filename: /node_modules/@types/react/package.json +////{ +//// "name": "react" +////} + +//@Filename: /node_modules/@types/fake-react/index.d.ts +////export declare var ReactFake: any; + +//@Filename: /node_modules/@types/fake-react/package.json +////{ +//// "name": "fake-react" +////} + +//@Filename: /src/index.ts +////const x = Re/**/ + +verify.completions({ + marker: test.marker(""), + isNewIdentifierLocation: true, + includes: { + name: "React", + hasAction: true, + source: "/node_modules/@types/react/index", + sortText: completion.SortText.AutoImportSuggestions + }, + excludes: "ReactFake", + preferences: { + includeCompletionsForModuleExports: true + } +});