microsoft / microsoft/TypeScript

Variable "name" in VSCode editor(intelli-sense) is showing incorrect information

Open
#39,534 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Proposal Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

TS Template added by @mjbvz

TypeScript Version: 4.0.0-dev.20200708

Search Terms

  • javascript
  • lib.dom
  • globals

  • VSCode Version: 1.46.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. Add the following javascript code

var name = "Hi";
console.log(name);
name = "Hello";
console.log(name);

  1. Hover over(Mouseover) the variable "name" (in any of the console log statements given above).......picture attached.

  2. Expected: During mouse/hover over, variable "name" on the console statement should display "name" as a variable.

    Actual: During mouse/hover over, variable "name" on the console statement is showing it as constant. (actually, it's not a constant). Because I'm able to modify the value of the variable "name" from "Hi" to "Hello". This explains "name" is implemented as a variable.

Does this issue occur when all extensions are disabled?: Yes

VSCode bug

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

No source file or test is named in the report. Start by reproducing the hover behavior with the provided JavaScript snippet in VS Code using the listed versions, then trace the TypeScript IntelliSense path responsible for the displayed symbol kind. Done means the hover for the reassigned name is identified as a variable rather than a constant.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.