mirror of
https://github.com/neovim/neovim.git
synced 2024-12-29 14:41:06 -07:00
f6329ea137
LSP server might return an item which would replace a token to another. For example in typescript for a `jest.Mock` object `getProductsMock.` text I get the following response: ``` { commitCharacters = { ".", ",", "(" }, data = { entryNames = { "Symbol" }, file = "/foo/bar/baz.service.spec.ts", line = 268, offset = 17 }, filterText = ".Symbol", kind = 6, label = "Symbol", sortText = "11", textEdit = { newText = "[Symbol]", range = { end = { character = 16, line = 267 }, start = { character = 15, line = 267 } } } }, ``` In `lsp.omnifunc` to get a `prefix` we call the `adjust_start_col` which then returns the `textEdit.range.start.character`. Th `prefix` then be the `.` character. Then when filter the items with `remove_unmatch_completion_items`, every item will be filtered out, since no completion word starts `.`. To fix we return the `end.character`, which in that particular case will be the position after the `.`. |
||
---|---|---|
.. | ||
autoload | ||
colors | ||
compiler | ||
doc | ||
ftplugin | ||
indent | ||
keymap | ||
lua | ||
macros | ||
pack/dist/opt | ||
plugin | ||
queries/c | ||
spell | ||
syntax | ||
tools | ||
tutor | ||
bugreport.vim | ||
CMakeLists.txt | ||
delmenu.vim | ||
filetype.lua | ||
filetype.vim | ||
ftoff.vim | ||
ftplugin.vim | ||
ftplugof.vim | ||
indent.vim | ||
indoff.vim | ||
macmap.vim | ||
makemenu.vim | ||
menu.vim | ||
mswin.vim | ||
nvim.appdata.xml | ||
nvim.desktop | ||
nvim.png | ||
optwin.vim | ||
scripts.vim | ||
synmenu.vim |