autozimu / LanguageClient-neovim

Language Server Protocol (LSP) support for vim and neovim.
MIT License
3.55k stars 273 forks source link

references in Denite only contains filename and line number. #1222

Open d0u9 opened 3 years ago

d0u9 commented 3 years ago

Describe the bug

Running :Denite references in nvim's command line only shows file and line number but no other information about line contents.

For example, running :call LanguageClient#textDocument_references can correctly obtains references as below:

xxx/server/server.go|60 col 18 n| func (s *server) Start() {
xxx/app/app.go|69 col 13 n| app.server.Start()

However, by running :Denite references, only file name are displayed:

xxx/server/server.go:60:18 
xxx/app/app.go:69:13 

Environment

To Reproduce

Steps to reproduce the behavior:

As described in previous section.

Current behavior

Not show line contents.

Expected behavior

Show line contents

Screenshots

No

Additional context

No

d0u9 commented 3 years ago

So, any update?

martskins commented 3 years ago

Sorry for the delayed response. I'm not able to test this right now, but if you are feeling adventurous you could try changing this line: https://github.com/autozimu/LanguageClient-neovim/blob/a42594c9c320b1283e9b9058b85a8097d8325fed/rplugin/python3/denite/source/references.py#L69 to this: text = self.vim.funcs.getbufline(filepath, line)

Let me know if it helped if you do try it and we can arrange a PR for that.

d0u9 commented 3 years ago

Hello martskins, I patched that line and nvim failed to response anything after invoking Denite references. It seems that nvim stacks in busy loop and CPU usage of nvim surges to 100%.