-
Notifications
You must be signed in to change notification settings - Fork 6
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
Not working Goto Definition hotkey with project with yarn pnp #177
Comments
I made a PR to partially resolve the issue. This means that some additional adjustments needs to be done on nvim side. Though the mutation of zipfile uri could be done on server side before sending to nvim, but I'd like not to implement that since keeping compatible with specific client's non-standard behavior is a bad practice from my view. So the current solution is not ideal and Iet me know what do you think about it. |
@yioneko, please tell me how I can try to run your edits on my computer? The yarn documentation advises using the vim-rzip plugin. Could that be the problem? |
I just published a new verision Regarding |
I can't make go to definition work. I updated vtsls
added autocmd, which is described in your pull request, I still get an error:
Can you help me figure out what I'm doing wrong? |
Can you verify the zip plugin is actually working? If you start editing a .zip archive in nvim, it will list the file contained in the zip. |
Yes, I open zip archives inside the same .yarn/cache and their contents are available in nvim without the new autocmd command and with it, no difference. Only go to definition does not work |
What's your lsp config for it? Maybe you didn't set |
Exactly! I did not set this option. Can you tell me how to set it up? |
It depends on what you use for lsp config, but generally it is as simple as setting require("lspconfig").vtsls.setup({
init_options = {
hostInfo = "neovim",
},
settings = ...
}) If you still cannot figure out how to do that, you can provide your lsp setup for it. |
Yes, the setup is correct. It looks like you are using Telescope, which I tested to have the same problem. I didn't dive deep into it as I tried fzf-lua where the preview works fine, so I think this is the problem on Telescope side. |
Thank you. The inclusion of editor.fzf in LazyExtra solved the problem. Plugin No additional auto-command was needed: vim.api.nvim_create_autocmd("BufReadCmd", {
pattern = "zipfile:/[^/]*",
callback = function(args)
-- the uri is like zipfile:/a/b/c
local uri = args.match --[[@as string]]
-- transform it to be zipfile:///a/b/c
vim.fn["zip#Read"](uri:gsub("^zipfile:", "zipfile://"), 1)
local printInspect = function(value)
print(vim.inspect(value))
end
printInspect(uri)
end,
}) go to definition works even without it on 0.2.5-alpha.0 |
I did some trick to make the |
In what cases is the auto command exactly needed, how can I check that it works? |
Never mind, I created a new test package and checked it again and now everything works as expected without the autocmd. Maybe I did something wrong before. Thanks for your support! |
Here is another problem related to yarn plug and play with the same conditions as here #169
I get an error when calling the go to definition command:
If I add to .yarnrc.yml:
nodeLinker: node-modules
and run yarn install
packages are installed in the node_module - go to definition command works well.
In vscode, in both cases, everything works without errors
My config:
https://github.com/utrumo/myConf/blob/master/nvim/lua/plugins/typescript.lua
https://www.lazyvim.org/extras/editor/telescope
https://www.lazyvim.org/extras/lang/typescript
The text was updated successfully, but these errors were encountered: