You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Opening index.ts, typing f between the brackets, then pressing <C-x><C-o> autocompletes to bar - lexicographically first identifier, instead of foo, which would complete the f input.
I've written a Dockerfile that reproduces this issue with minimum configuration:
FROM node:18
WORKDIR /root/app
# install nightly nvimRUN wget https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz
RUN tar -xzvf nvim-linux64.tar.gz
# install lspconfigRUN git clone -b v0.1.8 https://github.com/neovim/nvim-lspconfig ~/.config/nvim/pack/nvim/start/nvim-lspconfig
# install typescript and tsserverRUN npm install -g typescript typescript-language-server
# create tsserver configurationRUN mkdir -p ~/.config/nvim/
RUN echo "luafile $HOME/.config/nvim/lspconfig.lua" >> ~/.config/nvim/init.vim
RUN echo "local lspconfig = require('lspconfig')" >> ~/.config/nvim/lspconfig.lua
RUN echo "lspconfig.tsserver.setup{}" >> ~/.config/nvim/lspconfig.lua
RUN echo "vim.api.nvim_create_autocmd('LspAttach', {" >> ~/.config/nvim/lspconfig.lua
RUN echo " group = vim.api.nvim_create_augroup('UserLspConfig', {})," >> ~/.config/nvim/lspconfig.lua
RUN echo " callback = function(ev)" >> ~/.config/nvim/lspconfig.lua
RUN echo " -- Enable completion triggered by <c-x><c-o>" >> ~/.config/nvim/lspconfig.lua
RUN echo " vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'" >> ~/.config/nvim/lspconfig.lua
RUN echo " end," >> ~/.config/nvim/lspconfig.lua
RUN echo "})" >> ~/.config/nvim/lspconfig.lua
# create example projectRUN npm init --force
RUN tsc --init
RUN echo "export function foo() {}" >> mymodule.ts
RUN echo "export function bar() {}" >> mymodule.ts
RUN echo "import { } from './mymodule';" >> index.ts
ENTRYPOINT"/root/app/nvim-linux64/bin/nvim"
Build the image, run it, and type :e index.ts<Return>wwif<C-x><C-o> - omnifunc will complete bar instead of foo.
By contrast, here is a Dockerfile in which the omnifunc correctly completes foo:
FROM node:18
WORKDIR /root/app
# install release nvimRUN wget https://github.com/neovim/neovim/releases/download/v0.10.0/nvim-linux64.tar.gz
RUN tar -xzvf nvim-linux64.tar.gz
# install lspconfigRUN git clone -b v0.1.8 https://github.com/neovim/nvim-lspconfig ~/.config/nvim/pack/nvim/start/nvim-lspconfig
# install typescript and tsserverRUN npm install -g typescript typescript-language-server
# create tsserver configurationRUN mkdir -p ~/.config/nvim/
RUN echo "luafile $HOME/.config/nvim/lspconfig.lua" >> ~/.config/nvim/init.vim
RUN echo "local lspconfig = require('lspconfig')" >> ~/.config/nvim/lspconfig.lua
RUN echo "lspconfig.tsserver.setup{}" >> ~/.config/nvim/lspconfig.lua
RUN echo "vim.api.nvim_create_autocmd('LspAttach', {" >> ~/.config/nvim/lspconfig.lua
RUN echo " group = vim.api.nvim_create_augroup('UserLspConfig', {})," >> ~/.config/nvim/lspconfig.lua
RUN echo " callback = function(ev)" >> ~/.config/nvim/lspconfig.lua
RUN echo " -- Enable completion triggered by <c-x><c-o>" >> ~/.config/nvim/lspconfig.lua
RUN echo " vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'" >> ~/.config/nvim/lspconfig.lua
RUN echo " end," >> ~/.config/nvim/lspconfig.lua
RUN echo "})" >> ~/.config/nvim/lspconfig.lua
# create example projectRUN npm init --force
RUN tsc --init
RUN echo "export function foo() {}" >> mymodule.ts
RUN echo "export function bar() {}" >> mymodule.ts
RUN echo "import { } from './mymodule';" >> index.ts
ENTRYPOINT"/root/app/nvim-linux64/bin/nvim"
Steps to reproduce using "nvim -u minimal_init.lua"
Problem
Nightly release of Neovim has issues with tsserver omnifunc.
Example files:
Opening
index.ts
, typingf
between the brackets, then pressing<C-x><C-o>
autocompletes tobar
- lexicographically first identifier, instead offoo
, which would complete thef
input.I've written a Dockerfile that reproduces this issue with minimum configuration:
Build the image, run it, and type
:e index.ts<Return>wwif<C-x><C-o>
- omnifunc will completebar
instead offoo
.By contrast, here is a Dockerfile in which the omnifunc correctly completes
foo
:Steps to reproduce using "nvim -u minimal_init.lua"
Expected behavior
Expected behavior:
2024-06-11_14-09-36.mp4
Actual behavior:
2024-06-11_14-12-12.mp4
Neovim version (nvim -v)
NVIM v0.11.0-dev-211+g37bf4c572
Language server name/version
[email protected]
Operating system/version
Ubuntu 22.04
Log file
https://gist.github.com/paskozdilar/a3c8391ff427e432449ef6e8dd70cd52
The text was updated successfully, but these errors were encountered: