Skip to content
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

Local function variables are suggested within its default arguments #61461

Open
Andarist opened this issue Mar 21, 2025 Β· 0 comments
Open

Local function variables are suggested within its default arguments #61461

Andarist opened this issue Mar 21, 2025 Β· 0 comments
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@Andarist
Copy link
Contributor

πŸ”Ž Search Terms

autocomplete lsp suggestion default parameter

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

https://www.typescriptlang.org/play/?#code/GYVwdgxgLglg9mABFApgZygRgBQENEC8iA9AFSnECUiA3gFCKIBuuATogBZwwYoAmDRABsUURAFsQUXACMRgiAgyJWKXHwRCAnoUSY6AXyA

πŸ’» Code

function test1(a = /**/) {
  var hoisted
  let mutable
  const readonly = 1
}

πŸ™ Actual behavior

All 3 are suggested at the marker

πŸ™‚ Expected behavior

None of them should be suggested as they can't be used there

Additional information about the issue

No response

@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this labels Mar 21, 2025
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

2 participants