Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add string literal completions forpackage.jsonimports 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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@Andarist
Copy link
Contributor

@AndaristAndarist commentedMar 11, 2024
edited
Loading

closes#52460
closes#57680
closes#57777

Currently, this only has tests based on#55015 but I still have to add more

sapphi-red, tonivj5, theoludwig, vlad-resty, acidoxee, robpalme, sanurb, chiawendt, aaronccasanova, herkulano, and 8 more reacted with thumbs up emojijasonkuhrt and yonycalsin reacted with heart emojisapphi-red, tonivj5, AndreaPontrandolfo, vlad-resty, herkulano, robpalme, xeho91, Meriem-BM, jasonkuhrt, and yonycalsin reacted with rocket emoji
@typescript-bottypescript-bot added the For Backlog BugPRs that fix a backlog bug labelMar 11, 2024
}

/**@internal */
exportfunctiongetPossibleOriginalInputPathWithoutChangingExt(
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

this is kinda a reverse ofgetOutputPathWithoutChangingExt:

functiongetOutputPathWithoutChangingExt(
inputFileName:string,
ignoreCase:boolean,
outputDir:string|undefined,
getCommonSourceDirectory:()=>string,
):string{
returnoutputDir ?
resolvePath(
outputDir,
getRelativePathFromDirectory(getCommonSourceDirectory(),inputFileName,ignoreCase),
) :
inputFileName;
}

@Andarist
Copy link
ContributorAuthor

@andrewbranch I opened this as a draft because there are some minor cleanups to be done here. I'd appreciate an early review here though - in case there is something fundamentally wrong with this.

@DanielRosenwasser
Copy link
Member

@Andarist did you still want to pursue this? We're looking to get this done in the TS 5.7 timeframe.

@Andarist
Copy link
ContributorAuthor

@DanielRosenwasser yes, it would be great if@andrewbranch could give this a quick look to check if im not doing anything overly wrong so I dont spend too much time on cleaning up things that will turn out to be wrong in the end ;p

andrewbranch reacted with thumbs up emojimangs reacted with hooray emoji

Copy link
Member

@andrewbranchandrewbranch left a comment

Choose a reason for hiding this comment

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

Yeah, this looks on the right track to me, thanks!

@Andarist
Copy link
ContributorAuthor

@andrewbranch thanks for the review! I’ll try to clean this up asap

…letions# Conflicts:#src/compiler/utilities.ts#src/services/stringCompletions.ts
@AndaristAndaristforce-pushed thepkg-json-imports-completions branch from06559e9 to22b6148CompareSeptember 28, 2024 21:21
constvalue=normalizeFileSetEntry(files[key]);
constpath=dirname ?vpath.resolve(dirname,key) :key;
vpath.validate(path,vpath.ValidationFlags.Absolute);
vpath.validate(path,vpath.ValidationFlags.Absolute|vpath.ValidationFlags.AllowWildcard);
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The 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 makepathCompletionsPackageJsonImportsSrcNoDistWildcard6 pass as it's using? in the component path component.

I have added that test based on the existingpathCompletionsPackageJsonExportsWildcard6. The difference is that the test I have added is afourslash/server test and it follows a slightly different codepath.

The existing one validates here:

private_resolve(path:string){
returnthis._cwd
?vpath.resolve(this._cwd,vpath.validate(path,vpath.ValidationFlags.RelativeOrAbsolute|vpath.ValidationFlags.AllowWildcard))
:vpath.validate(path,vpath.ValidationFlags.Absolute|vpath.ValidationFlags.AllowWildcard);
}

And theValidationFlags.AllowWildcard was added therehere

On the other hand, thefourslash/server validates here, where I'm adding this comment. This codepath was added as part of#20763 - which proceeds the PR that introducedValidationFlags.AllowWildcard. So perhaps this was just a harmless omission in that newer PR. I don't know why this is a flag in the first place though so 🤷‍♂️

Copy link
Member

Choose a reason for hiding this comment

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

@rbuckton can you advise?

@Andarist
Copy link
ContributorAuthor

@andrewbranch it's ready for re-review :)

I could also use a build of this to test it more easily in a real project, and not only in the test harness ;p cc@jakebailey

@jakebailey
Copy link
Member

@typescript-bot pack this

typescript-bot reacted with thumbs up emoji

@typescript-bot
Copy link
Collaborator

typescript-bot commentedOct 31, 2024
edited
Loading

Starting jobs; this comment will be updated as builds start and complete.

CommandStatusResults
pack this✅ Started✅ Results

@typescript-bot
Copy link
Collaborator

typescript-bot commentedOct 31, 2024
edited
Loading

Hey@jakebailey, I've packed this intoan installable tgz. You can install it for testing by referencing it in yourpackage.json like so:

{    "devDependencies": {        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/164040/artifacts?artifactName=tgz&fileId=7D1CD9129128DE0FC3646A76F014BB023412AEA343119330949BF42DF191661C02&fileName=/typescript-5.7.0-insiders.20241031.tgz"    }}

and then runningnpm install.


There is also a playgroundfor this build and annpm module you can use via"typescript": "npm:@typescript-deploys/pr-build@5.7.0-pr-57718-9".;

Copy link
Member

@jakebaileyjakebailey left a comment

Choose a reason for hiding this comment

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

I think this is okay; the FS thing I think is also fine? Everything passes...

acidoxee reacted with hooray emoji
@andrewbranchandrewbranch merged commit48f2ada intomicrosoft:mainOct 31, 2024
@microsoftmicrosoft locked asresolvedand limited conversation to collaboratorsOct 16, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@andrewbranchandrewbranchandrewbranch approved these changes

@jakebaileyjakebaileyjakebailey approved these changes

Assignees

@andrewbranchandrewbranch

Labels

For Backlog BugPRs that fix a backlog bug

Projects

None yet

5 participants

@Andarist@DanielRosenwasser@typescript-bot@jakebailey@andrewbranch

[8]ページ先頭

©2009-2025 Movatter.jp