Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

AllowUnresolveNames not working for completion getters/setters and property signature and declaration #59554

Open
armanio123 opened this issue Aug 8, 2024 · 0 comments
Labels
Domain: Refactorings e.g. extract to constant or function, rename symbol Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Milestone

Comments

@armanio123
Copy link
Member

armanio123 commented Aug 8, 2024

πŸ”Ž Search Terms

AllowUnresolveNames, "preserve type nodes"

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about AllowUnresolvedNames and preserve types

⏯ Playground Link

https://www.typescriptlang.org/play/?target=99#code/JYOwLgpgTgZghgYwgAgILIN4Chm+TAewIC5lgBbABwKjAAoAiAOgHoATAiAZ3AgA9gXMEwBWXBgEomAMSIBuHHgDmEMMgBGcKHQmkK1Wo1YduvAUNHipsggoC+WRwgA2cLl2QAhMlWcRyEOAe6NgsLMgAKlDASipQyAgEvqrABCCkDPp+AeBkvLCIKKgMyGyClK4AnshgABaCCUkVKWnEWGFoCGAArnDObR2EJMhwIJUKHSpqmtq6I2OY7eF4NbVQBADuyCAQWwCiUOvaDACyqrUEbNsEaln+gZBsTJIT4XbIjh17fJQQXRBsAbhIZ6Kg0ejMdicHiQczCMSSGTyJbIKYaLQ6UEGCHGaFmQTwqxIgiLDorOrrLY7faHGiMM51S7XW7JHKPZ4SV7Id5YOxAA

πŸ’» Code

interface A {
    foo: import("./doesntexist.js").Foo;
    get bar(): import("./doesntexist.js").Foo;
}


class B implements A {
// Trigger completion: "implement interface A" display this completion:
// Actual:
// foo: any;
// get bar(): any {
//     throw new Error("Method not implemented.");
// } 

// Expected:
// foo: import("./doesntexist.js").Foo;
// get bar(): import("./doesntexist.js").Foo {
//     throw new Error("Method not implemented.");
// } 
}

πŸ™ Actual behavior

Triggering completion uses any instead of the unresolved type.

πŸ™‚ Expected behavior

Completion should be the unresolved type instead of any

Additional information about the issue

Found in PR #59440

@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol Experience Enhancement Noncontroversial enhancements labels Aug 8, 2024
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Aug 8, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Domain: Refactorings e.g. extract to constant or function, rename symbol Experience Enhancement Noncontroversial enhancements Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants