Skip to content
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

denols: current status (meta issue) #2005

Closed
3 of 10 tasks
sigmaSd opened this issue Jul 15, 2022 · 12 comments
Closed
3 of 10 tasks

denols: current status (meta issue) #2005

sigmaSd opened this issue Jul 15, 2022 · 12 comments
Labels
enhancement New feature or request

Comments

@sigmaSd
Copy link
Contributor

sigmaSd commented Jul 15, 2022

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:

[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

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

@sigmaSd sigmaSd added the enhancement New feature or request label Jul 15, 2022
@sigmaSd
Copy link
Contributor Author

sigmaSd commented Aug 14, 2022

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 added a commit to sigmaSd/neovim that referenced this issue Aug 14, 2022
deno lsp uses a custom schema `deno:`

`uri_from_bufnr` returns the full path of the buf file but this doesn't work with custom schema

This fixes the last remaining  bug here <neovim/nvim-lspconfig#2005> `relative dependencies inside virtual text document is not resolved correctly`

Notes:
- maybe `if relative_name:match("deno:")` should become `if is_custom_schema(realtive_name)` where is_custom_schema matches `URI_SCHEME_PATTERN` but is not equal to `file:///`
- this changes fixes all my issues with denols (with some minor modifications that I can pr later)

This is more to start a discussion I thought showing code is easier to discuss then raising an issue
@sigmaSd
Copy link
Contributor Author

sigmaSd commented Sep 2, 2022

Currently there is only one bug remaining neovim/neovim#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
Copy link
Contributor Author

sigmaSd commented Sep 18, 2022

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

@justinmk
Copy link
Member

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

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Sep 19, 2022

done thanks!

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

@sigmaSd sigmaSd closed this as completed Sep 19, 2022
@justinmk
Copy link
Member

FWIW, #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.

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Sep 19, 2022

I see thanks for the heads up.

@mfussenegger
Copy link
Member

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

@justinmk
Copy link
Member

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

@carere
Copy link

carere commented Oct 13, 2023

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.

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Oct 13, 2023

Can you provide typescript example that reproduce the issue

@carere
Copy link

carere commented Oct 15, 2023

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 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants