Skip to content

TSServer Should Mark Const Arrow Function with 'Function' Kind #14830

@mjbvz

Description

@mjbvz

From microsoft/vscode#19401

TypeScript Version: 2.2.1
Code

export var abc = () => x;

abc|

Run completions at the |

Expected behavior:
In completions, abc is marked as a function

Actual behavior:
abc has a const kind:

[Trace - 4:11:51 PM] Sending request: completions (46). Response expected: yes. Current queue length: 0
Arguments: {
    "file": "/Users/matb/projects/sand/c.js",
    "line": 3,
    "offset": 4
}
[Trace - 4:11:51 PM] Response received: completions (46). Request took 2 ms. Success: true 
Result: [
    {
        "name": "abc",
        "kind": "const",
        "kindModifiers": "export",
        "sortText": "0"
    }

This differs from navtree which marks abc as a function:

Trace - 4:12:25 PM] Sending request: navtree (57). Response expected: yes. Current queue length: 0
Arguments: {
    "file": "/Users/matb/projects/sand/c.js"
}
[Trace - 4:12:25 PM] Response received: navtree (57). Request took 1 ms. Success: true 
Result: {
    "text": "\"c\"",
    "kind": "module",
    "kindModifiers": "",
    "spans": [
        {
            "start": {
                "line": 1,
                "offset": 1
            },
            "end": {
                "line": 3,
                "offset": 4
            }
        }
    ],
    "childItems": [
        {
            "text": "abc",
            "kind": "function",
            "kindModifiers": "export",
            "spans": [
                {
                    "start": {
                        "line": 1,
                        "offset": 18
                    },
                    "end": {
                        "line": 1,
                        "offset": 25
                    }
                }
            ]
        }
    ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions