Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 5 additions & 1 deletion src/compiler/moduleNameResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2212,7 +2212,11 @@ function loadEntrypointsFromExportMap(
scope.packageDirectory,
extensionsToExtensionsArray(extensions),
/*excludes*/ undefined,
[changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was turning *.d.ts into *.d.d.ts

[
isDeclarationFileName(target)
? target.replace("*", "**/*")

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding

This replaces only the first occurrence of "*".
: changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target)),
Comment on lines +2217 to +2218
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't wait for CodeQL to complain about these

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding

This replaces only the first occurrence of "*".
],
).forEach(entry => {
entrypoints = appendIfUnique(entrypoints, {
path: entry,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/// <reference path="../fourslash.ts" />

// @Filename: /node_modules/pkg/package.json
//// {
//// "name": "pkg",
//// "version": "1.0.0",
//// "exports": {
//// "./core/*": {
//// "types": "./lib/core/*.d.ts",
//// "default": "./lib/core/*.js"
//// }
//// }
//// }

// @Filename: /node_modules/pkg/lib/core/test.d.ts
//// export function test(): void;

// @Filename: /package.json
//// {
//// "type": "module",
//// "dependencies": {
//// "pkg": "1.0.0"
//// }
//// }

// @Filename: /tsconfig.json
//// {
//// "compilerOptions": {
//// "module": "nodenext"
//// }
//// }

// @Filename: /main.ts
//// /**/

verify.completions({
marker: "",
includes: [
{
name: "test",
source: "pkg/core/test",
sourceDisplay: "pkg/core/test",
hasAction: true,
sortText: completion.SortText.AutoImportSuggestions
},
],
preferences: {
includeCompletionsForModuleExports: true,
allowIncompleteCompletions: true
}
});