Skip to content

Local function variables are suggested within its default argumentsΒ #61461

Open
@Andarist

Description

@Andarist

πŸ”Ž 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

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issueHelp WantedYou can do this

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions