Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Arrow functions in js/ts not recognized as functions in breadcrumbs #45478

@w-cantin

Description

@w-cantin

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

  • VS Code Version: 1.59.0
  • OS Version: Windows 10

Steps to Reproduce:

  1. Create a javascript file with this content:
    let myArrowFunc = () => {console.log("Arrow func here")}
  2. Wait for the breadcrumbs to load properly and hover over the myArrowFunc. It is showing as an object and not a function.

Arrowfunctions are currently treated as an object (SymbolKind 12) in javascript and typescript instead of a function (SymbolKind 11). I am writing a plugin that requests the symbol provider given by VSCode and navigates the symbols found. It needs to treat functions differently than simple object declarations.

Arrow functions are used a lot in classes for example and the following code would treat the arrow function myArrowFunc differently from the function regularMethod even though they are both methods of the class SomeClass.

class SomeClass {
  myArrowFunc = (val) => {
    console.log("Arrow method");
  }

  regularMethod() {
    console.log("Regular method")
  }
}

Here is what the breadcrumbs show for myArrowFunc and regularMethod. They should both be of the same type.

image

image

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions