-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Add string literal completions for package.json
imports
field
#57718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
238651d
2adb14c
22b6148
08eaa16
083c5b8
b48f752
07f6c3c
117415a
db0d416
294c7da
0d0b881
475c0b1
a0ea1b9
c00448b
e96bd5a
c36d20a
0f4a6f8
6759383
48b2c78
56a1563
b84468a
a80cdfa
96209a9
17b2aae
22e4d49
a18104e
36bed48
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -201,6 +201,7 @@ import { | |||||||||||||||||||||||||||
getParseTreeNode, | ||||||||||||||||||||||||||||
getPathComponents, | ||||||||||||||||||||||||||||
getPathFromPathComponents, | ||||||||||||||||||||||||||||
getRelativePathFromDirectory, | ||||||||||||||||||||||||||||
getRelativePathToDirectoryOrUrl, | ||||||||||||||||||||||||||||
getResolutionModeOverride, | ||||||||||||||||||||||||||||
getRootLength, | ||||||||||||||||||||||||||||
|
@@ -496,6 +497,7 @@ import { | |||||||||||||||||||||||||||
ResolvedModuleWithFailedLookupLocations, | ||||||||||||||||||||||||||||
ResolvedTypeReferenceDirective, | ||||||||||||||||||||||||||||
ResolvedTypeReferenceDirectiveWithFailedLookupLocations, | ||||||||||||||||||||||||||||
resolvePath, | ||||||||||||||||||||||||||||
returnFalse, | ||||||||||||||||||||||||||||
ReturnStatement, | ||||||||||||||||||||||||||||
returnUndefined, | ||||||||||||||||||||||||||||
|
@@ -6493,6 +6495,21 @@ export function getPossibleOriginalInputExtensionForExtension(path: string): Ext | |||||||||||||||||||||||||||
[Extension.Tsx, Extension.Ts, Extension.Jsx, Extension.Js]; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
/** @internal */ | ||||||||||||||||||||||||||||
export function getPossibleOriginalInputPathWithoutChangingExt( | ||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is kinda a reverse of TypeScript/src/compiler/emitter.ts Lines 542 to 554 in 3fca8c8
|
||||||||||||||||||||||||||||
filePath: string, | ||||||||||||||||||||||||||||
ignoreCase: boolean, | ||||||||||||||||||||||||||||
outputDir: string | undefined, | ||||||||||||||||||||||||||||
getCommonSourceDirectory: () => string, | ||||||||||||||||||||||||||||
): string { | ||||||||||||||||||||||||||||
return outputDir ? | ||||||||||||||||||||||||||||
resolvePath( | ||||||||||||||||||||||||||||
getCommonSourceDirectory(), | ||||||||||||||||||||||||||||
getRelativePathFromDirectory(outputDir, filePath, ignoreCase), | ||||||||||||||||||||||||||||
) : | ||||||||||||||||||||||||||||
filePath; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
/** | ||||||||||||||||||||||||||||
* Returns 'undefined' if and only if 'options.paths' is undefined. | ||||||||||||||||||||||||||||
* | ||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1148,7 +1148,7 @@ export class FileSystem { | |||||||||||
for (const key of Object.keys(files)) { | ||||||||||||
const value = normalizeFileSetEntry(files[key]); | ||||||||||||
const path = dirname ? vpath.resolve(dirname, key) : key; | ||||||||||||
vpath.validate(path, vpath.ValidationFlags.Absolute); | ||||||||||||
vpath.validate(path, vpath.ValidationFlags.Absolute | vpath.ValidationFlags.AllowWildcard); | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have no idea if this is completely correct. I added it to make pathCompletionsPackageJsonImportsSrcNoDistWildcard6 pass as it's using I have added that test based on the existing pathCompletionsPackageJsonExportsWildcard6. The difference is that the test I have added is a The existing one validates here: TypeScript/src/harness/vfsUtil.ts Lines 1104 to 1108 in b8e4ed8
And the On the other hand, the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rbuckton can you advise? |
||||||||||||
|
||||||||||||
// eslint-disable-next-line no-restricted-syntax | ||||||||||||
if (value === null || value === undefined || value instanceof Rmdir || value instanceof Unlink) { | ||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.