Skip to content

fix: filtering promise properties in object literal completion #59316

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

Merged

Conversation

syi0808
Copy link
Contributor

@syi0808 syi0808 commented Jul 17, 2024

screenshot

스크린샷 2024-07-17 오후 4 08 23

In the actual development environment, it was possible to reproduce what was solved.
But I can't find a case to write a test. Can someone give me an idea?

Fixes #59298

@syi0808 syi0808 closed this Jul 17, 2024
@syi0808 syi0808 reopened this Jul 17, 2024
@Andarist
Copy link
Contributor

Tests for completions can be written like this:
https://github.com/microsoft/TypeScript/blob/f37482cd16118409284e015409deaf14b416b4a0/tests/cases/fourslash/completionsPropertiesPriorities.ts

@syi0808 syi0808 marked this pull request as draft July 17, 2024 15:11
@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jul 17, 2024
@syi0808 syi0808 force-pushed the fix/not-return-promise-types-in-union branch from 99ef608 to 63999d3 Compare July 20, 2024 17:23
@syi0808 syi0808 marked this pull request as ready for review July 20, 2024 17:23
@syi0808 syi0808 force-pushed the fix/not-return-promise-types-in-union branch 2 times, most recently from 089a830 to 3e8aafd Compare July 20, 2024 17:39
@syi0808 syi0808 changed the title fix: filtering promise types in normal function return type fix: filtering promise properties in object literal completion Jul 21, 2024
@syi0808 syi0808 force-pushed the fix/not-return-promise-types-in-union branch from 3e8aafd to be95930 Compare July 21, 2024 16:04
@typescript-bot
Copy link
Collaborator

Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page.

Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up.

@syi0808 syi0808 force-pushed the fix/not-return-promise-types-in-union branch from be95930 to 994cc76 Compare July 21, 2024 16:24
@syi0808 syi0808 requested a review from Andarist July 26, 2024 13:09
@syi0808 syi0808 requested a review from jakebailey August 3, 2024 15:38
@typescript-bot typescript-bot added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Aug 3, 2024
@jakebailey
Copy link
Member

This looks good to me, though #59316 was accepted without determining whether or not the items should be prioritized or filtered, and this PR filters them out entirely.

I assume that ordering them is going to be a challenge, so are we okay with not providing promise-like method completions here?

@jakebailey jakebailey requested review from andrewbranch and removed request for Andarist August 6, 2024 23:03
@andrewbranch
Copy link
Member

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 8, 2024

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

Command Status Results
pack this ✅ Started ✅ Results

@typescript-bot
Copy link
Collaborator

typescript-bot commented Aug 8, 2024

Hey @andrewbranch, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/163182/artifacts?artifactName=tgz&fileId=FB6676671E04A4C6C1239CBAE0D3D2733BB015E08A215E8561269BB16027CF7302&fileName=/typescript-5.6.0-insiders.20240808.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.6.0-pr-59316-5".;

@jakebailey jakebailey merged commit f3b118e into microsoft:main Aug 9, 2024
32 checks passed
@sandersn sandersn removed this from PR Backlog Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid providing promise methods as completions at return positions in non-async functions
5 participants