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

Navigation inside decompiled files #116

Open
seblyng opened this issue Dec 13, 2024 · 12 comments
Open

Navigation inside decompiled files #116

seblyng opened this issue Dec 13, 2024 · 12 comments
Labels
help wanted Extra attention is needed

Comments

@seblyng
Copy link
Owner

seblyng commented Dec 13, 2024

I see that vscode now has support for navigation inside a decompiled file. This is not the case for this plugin. It only has some very simple hover information on some things.

I want to be able to keep navigating in the decompiled files.

Currently, we are falling back to the currently attached solution, and I think that was the case for vscode previously, but it seems they must have changed something to make it better

@seblyng seblyng added the help wanted Extra attention is needed label Dec 13, 2024
@searleser97
Copy link

I am able to navigate through decompiled files, is this still an issue ? or was it just fixed lately ?

@seblyng
Copy link
Owner Author

seblyng commented Dec 14, 2024

I tested this yesterday when I opened the issue🤔 do you have a screen recording of you doing this? I am able to navigate to a decompiled file, but I can't continue navigating

@nm-marques
Copy link

Can confirm this works fine for me too, same behaviour as vscode, gd works fine inside decompiled files even to other decompiled files. I can record something in a test project when i can.

@drzbida
Copy link

drzbida commented Dec 16, 2024

can confirm it works for me too (and has worked for quite a while for me)

@seblyng
Copy link
Owner Author

seblyng commented Dec 16, 2024

Super weird

@ashishbinu
Copy link

yes, I have the same issue. It can't go to other definition of the decompiled file.

@DerrikCreates
Copy link

I'm pretty new to neovim over all. But I've been able to get it to work sometimes. This commit is my config ive been using where its sometimes working.

Windows 11 23H2
NVIM v0.10.1

The language server files im using came from Microsoft.CodeAnalysis.LanguageServer.4.8.0-3.23451.1.nupkg from the manual setup in the readme.

The key map im using to navigate tot eh definition is this
keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts)

At first today i tried setting lock_target = true and it started working after setting it to true but it might be a red herring. Because when its not working i get this message [telescope.builtin.lsp_*]: no client attached]. It only says this when trying to go to a definition in an already decompiled buffer, it still works in buffers that are not decompiled.

here is a video of when i got it working. Closing and opening neovim caused it to stop working.
https://github.com/user-attachments/assets/19bfa996-49c9-48f4-b6d2-af4e8fac4281

here is what happens when its not working.
https://github.com/user-attachments/assets/079fea42-ca71-4f08-88c7-199469606abd

I'm very new to neovim, I only started using it as a new years resolution as a pivot from IdeaVim. So its very possible I made a mistake when making my config. Im not sure what I did to get it working in the first place and im not really sure what to change to try and force these decompiled temp file buffers to attach to the lsp(if this is even the issue).

I'm going to keep messing around to find a solution, I was screen recording during making this work but its a lot of video to look through. If there is any more information i can give to make solving this easier let me know

@DerrikCreates
Copy link

I figured it out and it might explain why it works for some and not others.

For some reason the initial auto targeting of the solution seems to break going to definitions. Roslyn target ing after the initial load will fix it but only in buffers opened after resetting the target. Setting the target will not fix already open buffers

My guess some people always set the target without relying on the auto targeting.

lock_target does not seem to affect the workaround

Issue:

  1. open file in solution letting the plugin auto target
  2. goto def
  3. goto def inside of the decompiled file
  4. Fails

Workaround:

  1. open file in solution
  2. Roslyn target and select your solution
  3. Close any existing decompiled buffers
  4. goto def
  5. goto def inside of the decompiled file
  6. Works as expected

here is a video of the workaround working
https://github.com/user-attachments/assets/b94f66ce-3642-480f-8137-44328bddec81

@drzbida
Copy link

drzbida commented Jan 2, 2025

that's very weird; i'm not using lock target / CSTarget and yet navigation still works for me in decompiled files

@seblyng
Copy link
Owner Author

seblyng commented Jan 2, 2025

Hmm, I tried to do the same things as you did and I am still not able to navigate in decompiled code like that🤔

@seblyng
Copy link
Owner Author

seblyng commented Jan 2, 2025

Okay I just tried on my windows VM, and there it seems to work. However, it does not work on macOS for me

@Sverre-W
Copy link

Related to navigation in decompiled files, when I try to navigate to defintion of a type that is in a different project it will also navigate to the decompiled version of that type. Is this a limitation of the LSP itself?

Related to this seems that the LSP intellisense uses a the decompiled version to provide intellisense for a type from the referenced project, adding a field for example, I have to recompile the referenced project and restart the language server in order for the diagnostics and autocomplete to pick this up thse changes in the referenced project.

All of the projects are part of a single solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants