rescript-lang / rescript-lang/vim-rescript
Omni completion duplicate prefix
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Vim Script
- Estrellas
- 164
- Forks
- 17
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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?
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza en la función de finalización omni del plugin, especialmente en la ruta findstart=1, y reproduce el problema con un archivo .res vacío y la entrada Js.Un. Compara el comportamiento de finalización con la configuración omni sugerida y verifica que seleccionar Undefined deje Js.Undefined en lugar de duplicar el prefijo; el issue también identifica el binario de análisis como un posible punto de integración.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- vim
- Área
- tooling
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100