New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create an open buffer when LSP requests a file #2261
Comments
about this from code action ? |
When I trigger that code action for But this function doesn't actually create files and only instructs the editor that LSP has edited that file. |
looks like a code action kind is |
I know. But then why doesn't it show up in |
|
you can use this after you called the code action local buf = vim.fn.bufadd('your new file')
vim.bo[buf].buflisted = true then you will see this file in your |
Ok. So... this needs to run when nvim gets input from LSP server, not when I decide it has to run 🤔 |
you can..need rewrite the default handler of code action. |
Description
When I'm editing a source file and use LSP server's refactoring to add a test then I can't view the file.
I can't see the file in NvimTree and I can't see the file in
:ls
. The buffer isn't loaded and the file isn't saved on disk.Neovim version
NVIM v0.8.0
Build type: Release
LuaJIT 2.1.0-beta3
Nvim-lspconfig version
abe6c99
Operating system and version
Linux 6.0.2-2
Affected language servers
clojure-lsp, maybe others as well
Steps to reproduce
:ls
(maybe that's a clue, probably)Actual behavior
When I choose
10: Create test for 'my-function'
inclojure-lsp
server's refactoring menu then I can't see the file.If the test file that I'm adding doesn't exist then LSP server will send a file creation request to nvim so that it would be created (but not written yet).
So these "created but non-written" files are not displayed in vim.
Do you think it's a good idea to display them? These files also don't show up in the
:ls
menu. So it may be a problem withnvim
itself or a problem with how nvim handles LSP. I don't know much how it's handled so I write here.Expected behavior
Files should at least show up in
:ls
command menu. NvimTree could also show them (persist empty file to disk and load it) but first the:ls
should show that the buffer exists.Minimal config
LSP log
none
The text was updated successfully, but these errors were encountered: