Skip to content

Give 'this' keyword suggestion the same sortText as class properties if inside a class #30012

Description

@mjbvz

From microsoft/vscode#66868

TypeScript Version: 3.4.0-dev.20190220

Search Terms:

  • suggestions
  • completions
  • sortText

Code
For the javascript:

class Foo {
    constructor() {
        this.prop = 1;
    }

    render() {
        th
    }
}
  • Trigger intellisense after th in render

Expected behavior:
this should be the first suggestion in VS Code

Actual behavior:
render and then prop are the first suggestions

The root cause of this is that the suggestion for this has a sortText of "0" while the one for prop and render have a sortText of "1". This causes VS Code to sort prop and render before this

@amcasey @minestarks I'm not sure if the current sorting issue would also effect VS

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions