nvim-lspconfig icon indicating copy to clipboard operation
nvim-lspconfig copied to clipboard

denols: current status (meta issue)

Open sigmaSd opened this issue 2 years ago • 2 comments

This issue is meant to keep track of the current status of denols, this should help us to focus on whats missing to bring denols on par with vscode-deno.

bugs:

  • [x] jumping to definition then returning breaks lsp https://github.com/neovim/nvim-lspconfig/issues/1998
  • [ ] relative dependencies inside virtual text document is not resolved correctly https://github.com/neovim/neovim/pull/19773 relative
  • [x] codelens fails to call denolscache https://github.com/neovim/nvim-lspconfig/pull/2016 codelens
  • [x] DenolsCache works but it throws an error method not found https://github.com/neovim/nvim-lspconfig/pull/2009 cache
  • [ ] the lsp log always shows this line
[ERROR][2022-07-15 07:12:55] .../vim/lsp/rpc.lua:420	"rpc"	"deno"	"stderr"	"Error converting specifier settings (file:///home/mrcool/dev/deno/lab/deno:/https/deno.land/x/simple_shell/mod.ts): Error converting specifier settings: invalid type: null, expected struct SpecifierSettings\n"

missing features:

commands: https://deno.land/manual/language_server/overview#commands

  • [ ] deno.test

requests: https://deno.land/manual/language_server/overview#requests

  • [ ] deno/performance
  • [ ] deno/reloadImportRegistries
  • [ ] deno/task https://deno.land/manual/tools/task_runner https://github.com/neovim/nvim-lspconfig/pull/2014

notification:: https://deno.land/manual/language_server/overview#notifications

  • [ ] deno/registryState https://github.com/neovim/nvim-lspconfig/pull/2027

sigmaSd avatar Jul 15 '22 06:07 sigmaSd

Regarding

relative dependencies inside virtual text document is not resolved correctly

The problem is in virtual text nvim automatically adds the current file-path to deno schema so deno:/https/deno.land/x/simple_shell%400.13.0/mod.ts becomes /home/user/dev/deno:/https/deno.land/x/simple_shell%400.13.0/mod.ts

sigmaSd avatar Aug 14 '22 13:08 sigmaSd

Currently there is only one bug remaining https://github.com/neovim/neovim/pull/19967 with that fixed the experience is equivalent to vscode-deno

The missing features can be implemented in a separate plugins once this bug is fixed.

sigmaSd avatar Sep 02 '22 04:09 sigmaSd

I wrote a plugin for this https://github.com/sigmaSd/deno-nvim

sigmaSd avatar Sep 18 '22 13:09 sigmaSd

@sigmaSd nice! Feel free to reference that from the docs here.

justinmk avatar Sep 19 '22 18:09 justinmk

done thanks!

I think I can close this issue now, the remaining bug have issues upstream already.

sigmaSd avatar Sep 19 '22 18:09 sigmaSd

FWIW, https://github.com/neovim/nvim-lspconfig/issues/1937 is still open because I think it makes sense to have very thin (1-2 lines per command) or auto-generated commands if there's a way for the client to "discover" LSP server capabilities and generate commands for (custom) server actions. But for non-trivial commands and features, separate plugins are appropriate.

justinmk avatar Sep 19 '22 18:09 justinmk

I see thanks for the heads up.

sigmaSd avatar Sep 19 '22 18:09 sigmaSd

if there's a way for the client to "discover" LSP server capabilities and generate commands for (custom) server actions.

Short answer: it's not possible Long answer: although it's possible to discover what kind of commands the server supports (They're listed as part of the server_capabilities), the arguments the commands require are not described. That makes sensible auto generation of client commands pretty much impossible

mfussenegger avatar Sep 19 '22 18:09 mfussenegger

Thanks @mfussenegger . That leaves the "very thin" option. But that's probably not possible to do in a generic way.

justinmk avatar Sep 19 '22 18:09 justinmk

Hello, I have a problem when importing dependencies from esm.sh, Deno Intelissense in NeoVim do not work for esm.sh imported packages. It works for deno.land & npm: packages, but not for esm.sh. I still can run my program with Deno, but the types are not loaded by denols, even so there are present in the cache folder.

carere avatar Oct 13 '23 04:10 carere

Can you provide typescript example that reproduce the issue

sigmaSd avatar Oct 13 '23 04:10 sigmaSd

Ok, the problem was coming from the fact that I did not run the deno cache before running my program. Actually, the deno cache command downloaded all the types from esm.sh 😄

carere avatar Oct 15 '23 23:10 carere