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

fix!: remove hacky pipe start and prefer stdio #120

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

seblj
Copy link
Owner

@seblj seblj commented Dec 15, 2024

@tris203

Just a heads up that I am planning to do something like some time after the PR for stdio support is merged dotnet/roslyn#76437

I will of course wait with this until some time after it is merged, and also wait so you can potentially do some changes so that I am not breaking your plugin.

Do you have any concerns about removing this code once it supports stdio?

I built the PR from source, and just tried it out, and with very minimal testing it seems like it works good👍

Should also hopefully fix #68

@tris203
Copy link

tris203 commented Dec 15, 2024

We might have some spawn timing issues

But hopefully the server should spawn faster without having to generate the pipe separately first

I will do some testing before and we can do synchronized merges

@seblj
Copy link
Owner Author

seblj commented Dec 15, 2024

Sounds great!

@zoriya
Copy link

zoriya commented Dec 16, 2024

Can't we start using lspconfig now that the starting mechanism is standard? This plugin could turn into something akin to https://github.com/Hoffs/omnisharp-extended-lsp.nvim that would support non-standard protocols.

@seblj
Copy link
Owner Author

seblj commented Dec 16, 2024

That is a possibility, but I am a bit unsure if that will be good enough, because finding the root dir and actually attaching to a solution/project is not as easy as lspconfig would like it to be I think.

But maybe that can just be overriden here or something🤔 I didn't think of that yet

@HarleyRossetto
Copy link

@seblj I've tried out my changes in dotnet/roslyn#76437 on this branch, everything appears to work, abit diagnostics are very laggy like #93 (comment) when working both on the entire dotnet/roslyn solution and the LanguageServer project itself.

Do you want to give it a shot yourself too?

@seblj
Copy link
Owner Author

seblj commented Dec 17, 2024

I can try, but do you notice a difference between this PR and connecting with a pipe? That seems weird

@seblj
Copy link
Owner Author

seblj commented Dec 17, 2024

I mean, it is definitely not the fastest especially when working with the entire solution, but I don't notice any difference between this PR and master🤷‍♂️

It also gets significantly faster for me when only attaching to the project. I see I don't really have a good way to only attach to a project now that is a part of a solution, but that is potentially something for another PR. I just modified the code directly to make it attach to the project

@HarleyRossetto
Copy link

Nah mate, I was just incredibly tired when testing I think, was running a debug build of the ls among other silly config mistakes.
Gave it another go just now, and not running into the same problems.

The Language Server project still takes a while to startup, but that is just it the language server itself being generally slow to boot I think.

@seblj
Copy link
Owner Author

seblj commented Dec 18, 2024

Yup that is true

@seblj seblj force-pushed the bye-hack branch 3 times, most recently from e0cc4f5 to e5b7b62 Compare December 24, 2024 00:06
@shaksiper
Copy link

Looks like dotnet/roslyn#76437 is merged and latest artifact already later than that commit. So it should be available now with the latest build, right?

@seblj
Copy link
Owner Author

seblj commented Jan 11, 2025

Yes I have been subscribed to that and noticed that. I will probably coordinate with @tris203 soon to agree on how we should go ahead with this.

I was actually also thinking about parsing the version once and notify the users with some message that they need to install the latest version of roslyn instead of just silently failing. Otherwise I guess I would get issues about it not working

I have actually been daily driving this branch since the PR was created, and if someone else wants to do it, feel free to do so.

I will keep this branch updated with potential changes in the main branch.

Hopefully I will merge this sometime next week

@tris203
Copy link

tris203 commented Jan 11, 2025

I will do some testing with rzls

We may need to wait for the new Roslyn version to make it into Vscode as the nix packaging relys on that

@seblj
Copy link
Owner Author

seblj commented Jan 11, 2025

Yeah that is fine by me👍

@tris203
Copy link

tris203 commented Jan 11, 2025

Im just working on this now from the rzls side.

Where we emit the event for Roslyn initialised. Could we also set a global variable?

@seblj
Copy link
Owner Author

seblj commented Jan 11, 2025

Yes sure! Feel free to either create a PR to that branch or just send a patch here and I will apply when I have time

@tris203
Copy link

tris203 commented Jan 11, 2025

I'm not sure the latest release in the crashdummyy repo has the `--stdio``` flag

I can't seem to get it to work. Will try again after dinner

https://github.com/Crashdummyy/roslynLanguageServer/releases/tag/4.14.0-1.25060.6

EDIT: scrap all of that, its breaking change for rzls, as we override the roslyn config. I've have addressed that in the rzls.nvim PR/my adjustment PR here

@seblj seblj marked this pull request as ready for review January 13, 2025 14:26
@seblj
Copy link
Owner Author

seblj commented Jan 13, 2025

I think I am ready when you are @tris203. I added a very basic check for if the server supports --stdio or not, and print out an error message if it doesn't, telling them to update. It seems to work okay

@tris203
Copy link

tris203 commented Jan 13, 2025

My only hold up is that the changes haven't been tagged for a release into vscode yet

For people on something like Nix (like me) there isn't a build that supports --stdio yet. So those people would have to build from source. For the sake of a few weeks, I think its worth waiting. but up to you

@seblj
Copy link
Owner Author

seblj commented Jan 13, 2025

Yeah no rush for me😄 just let me know when you are ready

@konradmalik
Copy link

konradmalik commented Jan 13, 2025

@tris203 fyi I had something like this for personal use some time ago: https://github.com/konradmalik/nixpkgs-extra/tree/643cce606e49b0759f38ff20ae0dfe95a47ad23a/pkgs/roslyn-ls

This allowed to use upstream roslyn in a very similar way to how it was auto-installed in roslyn.nvim.
I've removed it since but maybe worth restoring/re-using, even if just for tests of --stdio on nix

The link to check versions was: https://dev.azure.com/azure-public/vside/_artifacts/feed/vs-impl

@tris203
Copy link

tris203 commented Jan 13, 2025

@tris203 fyi I had something like this for personal use some time ago: konradmalik/nixpkgs-extra@643cce6/pkgs/roslyn-ls

This allowed to use upstream roslyn in a very similar way to how it was auto-installed in roslyn.nvim. I've removed it since but maybe worth restoring/re-using, even if just for tests of --stdio on nix

The link to check versions was: dev.azure.com/azure-public/vside/_artifacts/feed/vs-impl

yeah i have a flake that builds rzls for razor dev which i could easily add a razor-ls overlay but compiling on my laptop is slow and i am lazy

@konradmalik
Copy link

@tris203 fyi I had something like this for personal use some time ago: konradmalik/nixpkgs-extra@643cce6/pkgs/roslyn-ls
This allowed to use upstream roslyn in a very similar way to how it was auto-installed in roslyn.nvim. I've removed it since but maybe worth restoring/re-using, even if just for tests of --stdio on nix
The link to check versions was: dev.azure.com/azure-public/vside/_artifacts/feed/vs-impl

yeah i have a flake that builds rzls for razor dev which i could easily add a razor-ls overlay but compiling on my laptop is slow and i am lazy

aren't we all 🥲

tris203 and others added 2 commits January 27, 2025 08:24
- Added a check for the `--stdio` argument in `config.lua` to ensure it is
  present in the configuration. If not, it will be added and a warning
  notification will be shown.
- Moved the `RoslynInitialized` autocmd execution in `lsp.lua` to ensure it
  runs before refreshing diagnostics.
- Added global variable for checking if roslyn is initialized
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dotnet process won't be kill after close nvim.
6 participants