Skip to content

[Take Over mode][Suggestion] Add Setting to Force Suggestions Ordering #1005

@zardoy

Description

@zardoy

Some Background

This is a continuation of #974 (comment) and comment below.

You just said

We need to be consistent with VSCode, because their designed behavior is verified by more users, and changing it in volar might be counterproductive.

However the behavior is already inconsistent, e.g. Volar is already much bettter comparing to what we have with builtin TS extension right now. I also noticed that Volar loads much faster and overall has better performance.

I have a repo, where builtin TS extension gives false errors (suppose just crashes) on pnpm start until I restart the server and this is not a case with your Volar.

So I always recommend to everyone to disable builtin TS extension globally in favor of takeover mode.

Feature Request

By default vscode agressively sorts everything by label, so initial order of suggestions is lost.

I'm just asking you to add a volar.extended.forceSortSuggestions setting. Here https://github.com/johnsoncodehk/volar/blob/master/packages/server/src/features/languageFeatures.ts#L45 add

if (list) list.items.forEach((item, i) => {
    item.sortText = `${item.sortText ?? ''}${i}`
})

Here is a code you can test with:

interface Foo {
	b: string,
}

interface Bar {
	c: boolean,
}

interface Test extends Foo, Bar {
	a: number
}

const d: Test = {
// trigger suggestions here
};

The setting will be disabled by default, so we don't break anything for existing users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions