rescript-lang / rescript-lang/vim-rescript
Omni completion duplicate prefix
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Vim Script
- Star
- 164
- Fork
- 17
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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?
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu từ hàm hoàn thành omni của plugin, đặc biệt là nhánh findstart=1, và tái hiện vấn đề với một tệp .res rỗng cùng đầu vào Js.Un. So sánh hành vi hoàn thành với cấu hình omni được đề xuất và xác minh rằng việc chọn Undefined giữ lại Js.Undefined thay vì nhân đôi tiền tố; issue cũng xác định binary phân tích là một điểm tích hợp khả dĩ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- vim
- Lĩnh vực
- tooling
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100