mattn / mattn/vim-lsp-settings
Unneeded uniq()
Nobody has claimed this yet.
- Dominant language
- Vim Script
- Stars
- 1.4k
- Forks
- 245
- Avg merge
- 3m
- Merged PRs (30d)
- 1
Description
This is apparently a minor issue, but I just noticed and decided to report it:
First you create a unique list of commands, then pass it to uniq() which makes no difference. Unless I'm missing something.
On a side note I thought if it could be done in a more compact way, and here's what I ended up with:
let Flatten = {d -> reduce(values(d), {r, i -> extend(r, i)})}
let l:servers = mapnew(l:settings, 'mapnew(v:val, "v:val.command")')
let l:servers = uniq(sort(Flatten(l:servers)))
Not that it's necessarily better.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open autoload/lsp_settings/profile.vim at lines 101-110 and inspect how the command list is made unique before uniq() is called. Confirm whether the earlier operation already guarantees uniqueness, then remove only the redundant step if appropriate and verify that the generated server command list is unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vim
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100