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

Forced ordering of responses to prevent them from ending up alphabetical #159

Merged
merged 3 commits into from
May 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/nimlsp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ proc main(ins: Stream | AsyncFile, outs: Stream | AsyncFile) {.multisync.} =
addedSuggestions: HashSet[string]
for suggestion in suggestions:
seenLabels.inc suggestion.collapseByIdentifier
for suggestion in suggestions:
let collapsed = suggestion.collapseByIdentifier
for i in 0..suggestions.high:
let collapsed = suggestions[i].collapseByIdentifier
if not addedSuggestions.contains collapsed:
addedSuggestions.incl collapsed
let
Expand All @@ -311,7 +311,7 @@ proc main(ins: Stream | AsyncFile, outs: Stream | AsyncFile) {.multisync.} =
documentation = some(suggestion.doc),
deprecated = none(bool),
preselect = none(bool),
sortText = none(string),
sortText = some(fmt"{i:04}"),
filterText = none(string),
insertText = none(string),
insertTextFormat = none(int),
Expand Down