Skip to content

Code Lens cannot find the reference in Object Shorthand property names #117021

Closed

Description

@nztraveler

Version: 1.53.2 (user setup)
Commit: 622cb03
Date: 2021-02-11T11:48:04.245Z
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.19041

Steps to Reproduce:
There are three simple javascript files, and the code lens of the module a.js can only find 1 reference in c.js.
In the b.js, the a is referenced in the way of Object Shorthand property names, which is not be found in code lens.

a.js

const a = '123';  
export default a;

b.js

import a from './a.js';  
// referenced in the way of Object Shorthand property names, cannot be found by code lens.  
console.log({a});

c.js

import a from './a.js';  
console.log(a);

image

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

Activity

  1. added
    bugIssue identified by VS Code Team member as probable bug
    on Feb 19, 2021
  2. mjbvz commented on Feb 19, 2021

    @mjbvz
    Contributor

    Also happens in a single file:

    export const abc = 123;
    
    console.log({ abc });
  3. mjbvz commented on Sep 29, 2021

    @mjbvz
    Contributor

    Should be fixed by updates TS change

    To verify:

    1. Install typescript@next in a workspace
    2. Switch to the workspace version of TypeScript
    3. Confirm that you now see the correct reference count for the examples above
  4. nztraveler commented on Oct 12, 2021

    @nztraveler
    Author

    Matt Bierner (@mjbvz) Thanks, it works with your suggested verify step. Nice work!

  5. locked and limited conversation to collaborators on Nov 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugtypescriptTypescript support issuesupstream-issue-linkedThis is an upstream issue that has been reported upstreamverifiedVerification succeeded

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions