Omni completion duplicate prefix
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- vim
- Domain
- tooling
Research direction
Start at the plugin's omni-completion function, especially the findstart=1 path, and reproduce the issue with an empty .res file and the input Js.Un. Compare the completion behavior with the suggested omni configuration and verify that selecting Undefined leaves Js.Undefined rather than duplicating the prefix; the issue also identifies the analysis binary as a possible integration point.
Written by the indexing model from the issue text.
Description
When I select an entry from the omni completion menu, the existing prefix is duplicated. I'm using the latest vim-rescript and the suggested omni completion configuration (without coc-vim).
The problem can be demonstrated (once issue #56 has been fixed) by first creating an empty .res file, compiling the project, opening the file in VIM or Neovim and then typing out the following:
Js.Un
Hit <C-x><C-o> in insert mode with the cursor at the end of the line. The only match (Undefined) will be selected as expected. Afterwards the buffer will look like this:
Js.UnUndefined
The plugin most probably shouldn't end up duplicating the common prefix.
It looks like VS Code does the right thing by default and "will replace the word until the cursor with the given label or insertText" in cases like this:
https://code.visualstudio.com/api/references/vscode-api#CompletionItem
This might be a bit problematic to fix client side, because it looks like the plugin must know the correct location when the completion function is first called (when findstart is set to 1). Could the bulk of the logic be moved there so that the second invocation would just return the already-populated list?
Or could the analysis binary be amended to include insertText?
- Dominant language
- Vim Script
- Stars
- 164
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Contributor guide
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.
More from rescript-lang/vim-rescript
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Add errorformat Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
rescript-lang/vim-rescript#74 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
rescript-lang/vim-rescript#67 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
rescript-lang/vim-rescript#66 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
All issues in rescript-lang/vim-rescript
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
hemilabs/ui-monorepo#2332 ·
-
Help-Wanted Needs-Triage Package-Update
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/winget-pkgs#438662 ·
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
olcf/olcf-test-harness#278 · 1 comment ·