Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest exit keyword with score penalty #223946

Merged
merged 1 commit into from
Jul 26, 2024
Merged

Suggest exit keyword with score penalty #223946

merged 1 commit into from
Jul 26, 2024

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented Jul 26, 2024

Fixes #223945

@Tyriar Tyriar added this to the August 2024 milestone Jul 26, 2024
@Tyriar Tyriar self-assigned this Jul 26, 2024
@Tyriar Tyriar enabled auto-merge July 26, 2024 17:53
@Tyriar Tyriar merged commit 9d4c0fd into main Jul 26, 2024
7 checks passed
@Tyriar Tyriar deleted the tyriar/223945 branch July 26, 2024 18:34
// Keywords should always appear at the bottom when they are not an exact match
let score = 0;
if (a.completion.isKeyword && a.labelLow !== wordLow || b.completion.isKeyword && b.labelLow !== wordLow) {
score = (a.completion.isKeyword ? 1 : 0) - (b.completion.isKeyword ? 1 : 0);
Copy link
Contributor

@anthonykim1 anthonykim1 Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this score referring to the index of suggestion? For example, would low score represent first/last thing that would show up as a suggestion

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anthonykim1 this is fed into the a sort function such that exit in pwsh has special sorting behavior as keywords are generally unlikely to be used in the repl

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terminal suggest: pwsh keywords are not suggested
3 participants