microsoft / microsoft/TypeScript

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

Open
#59,554 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Domain: LS: Refactorings Experience Enhancement Suggestion
Dominant language
Go
Stars
111k
Forks
14.4k
Avg merge
1d 19h
Merged PRs (30d)
117

Description

🔎 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 https://github.com/microsoft/TypeScript/pull/59440

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the completion behavior reproduced in the linked Playground when implementing interface A, focusing on completion getters/setters and property declarations. Compare the actual any output with the expected unresolved import type; done means all shown completions preserve import("./doesntexist.js").Foo instead of using any.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.