-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Diagnostic not displaying on Windows #173
Comments
Thank you for the detailed report! One suspicious thing I see is the empty string being used as the path for your project config. I will be able to repro and take a much closer look later (hopefully tonight) :) |
Oh now that you mention you're on Windows, can you check if gcc and/or clang are available on your system's path? asm-lsp doesn't ship a compiler and instead relies on one being installed on the system to provide diagnostics. If you have one you'd like to use, you can provide the path to it as part of the opts.compiler configuration field. |
for some reason when I was setting up the default config, and I put gcc, it said its not in path, which is weird because I use gcc from terminal most of the times and I've added to it to path myself on the updated replies I might be missing clang here, let me try to installing it and see if it helps, otherwise gcc seems to be in path, but I'll double check anyways |
Oh interesting. It looks like this issue is Windows-specific then. The config builder's compiler validation logic should pick up gcc since it's on your path, but I guess we have a logic bug somewhere in there. I imagine a similar issue is causing the diagnostics command to misbehave. I still have a Windows install on my laptop, so I'll be able to investigate this more closely tomorrow night. Thanks so much for the fast and detailed responses! :)
No need to install clang, as long as you have 1 of the 2 that should be fine. |
Out of curiosity/ as a temporary workaround, could you try providing the absolute path to gcc as you config's |
Ah, this is super weird. I tried invoking gcc on your example file manually and I think I found the problem. When using the .asm extension, gcc does not know how to treat your assembly code: The server can't get anything useful out of those message, so that's why there aren't any diagnostics showing up. This behavior is also seen on Linux: I wasn't able to reproduce locally in my arch install because clang (for whatever reason, I don't know) does not care about the file extension and will emit actual errors: Changing the file extension to .s fixes the issue for gcc as well (on Windows and Linux): It looks like gcc and/or clang haven't been added to your path properly, otherwise I believe changing the file extension (along with specifying the full path to the compiler iin your config) should clear up any issues your having. I'm not sure what steps to take to debug the issue of gcc/clang not being fully detected on your path besides manually checking the environment variable. It's bizarre that you can invoke them but Try those fixes out and let me know if they work/ if you figure anything else out. Thanks so much for your patience! :) |
I removed the default config and overwrote it via On top of this, as shown in the #115, I've also tried to add [
{
"directory": "C:/Users/elli0t43/Desktop/asm",
"command": "C:/Program Files/NASM/nasm.exe -f elf64 -o C:/Users/elli0t43/Desktop/asm/hello_world.o C:/Users/elli0t43/Desktop/asm/hello_world.asm",
"file": "C:/Users/elli0t43/Desktop/asm/hello_world.asm"
}
] also thought it could the single backward slashes, I've tried with double, because many lsp's require double |
I'm not super sure what format is expected for Regarding the parsing error, I'm very confused. I'm going to have to call it a night soon, but I will continue looking into this tomorrow night. |
I have an idea of what I need to fix for the windows compiler validation. Regarding the parsing issues you're seeing, I believe it's a version mismatch. At the start of the logs, we see |
I think I know why, so I've installed the lsp with And then mason installed it, I thought it would be similar to terraform-ls where you would need the binary first, and I've ran the cargo manual installation again, But yeah Let me remove everything and only let it install from mason |
The compiler validation issues should be fixed by #176. |
Yes, crates.io only has the 0.9.0 release. The configuration overhaul happened after that release, so in order to use it you need to install off of the latest commit. Something like |
Okay so I investigated why its not working, so here's logs with debug on on WSL it works fine btw (without any config, and on crates version of the asm-lsp) WSL logs
Windows
What I foundI believe this is the reason why its not working on windows
|
At first glance it looks like there's a leading slash that's causing issues in the windows case when canonicalization fails. I'll have to spend some time digging in to see which part is causing this. Really appreciate you taking the time to investigate! |
Ok this was actually pretty tricky, but it looks like things are finally working! I'll duplicate this explanation in the PR, but I think it makes sense to leave here for future use as well. Ok so for some reason, when a path is canonicalized in Windows, it gets prefixed with "\?". That is, I may be completely missing something here, but I don't really understand why this convention is established if it isn't going to be followed consistently. The |
What I'm trying to do
So I've installed SASM to learn assembly, and I definitely wanted neovim support in it, so I simply opened the project in neovim. so that can I write code in neovim(Neovide) and build in SASM, mainly via NASM.
What problem I'm facing
I've installed
asm-lsp
using Mason with lsp-zero config on Windows. However when I opened the.asm
file in neovim, I'm not getting any diagnostic, I've checked the logs and even made sure that the LSP itself is connected and everything seems to be fine (as shown below)What I've checked/tried
so I checked few closed issues, mainly
#115
#127
#138 (didn't understand much in this one)
Took few snippets and tried to copy paste to see if it works or not
Neovim Version
hello_world.asm
just the default code that shows up when you open SASM
.asm-lsp.toml
lsp-zero.lua config
:LspInfo
lsplog
I believe I included everything, also if there's any blunder on my end I apologize.
The text was updated successfully, but these errors were encountered: