Omni completion duplicate prefix

Aberta
#58 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
35/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
vim
Domínio
tooling

Direção de pesquisa

Comece pela função de conclusão omni do plugin, especialmente pelo caminho findstart=1, e reproduza o problema com um arquivo .res vazio e a entrada Js.Un. Compare o comportamento da conclusão com a configuração omni sugerida e verifique se selecionar Undefined deixa Js.Undefined em vez de duplicar o prefixo; a issue também identifica o binário de análise como um possível ponto de integração.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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?

Linguagem predominante
Vim Script
Estrelas
164
Forks
17
Métricas de merge de PRs
Nenhum PR com merge em 30d

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de rescript-lang/vim-rescript

Todas as issues de rescript-lang/vim-rescript

Issues semelhantes

Mais issues de DevTools

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.