-
-
Notifications
You must be signed in to change notification settings - Fork 895
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
lsp-csharp.el: introduce a separate file for C# #1200
Conversation
This adds ability to install the OmniSharp Roslyn server automatically.
Looks good! I will wait for someone to confirm that it works fine on Windows. Other than that, it will be helpful for us if you can extract methods: |
Hey guys. This looks like a great PR! I've tested on Windows, and it's almost where it needs to be, but not quite:
Basically on Windows, there is no As for the actual Windows-bundle downloaded, I have a question: what's the rationale for choosing Are there any functional differences? Shouldn't we prefer x64 if you are on a 64-bit system (or at least a 64-bit Emacs)? If so, that is detectable by some simple code like this: (defun is-64bit-os-p ()
(not (null (string-match "^x86_64-.*" system-configuration)))) It may not be a big deal or very important, but I'd at least like to know that |
OK, I will try extracting download and extract fns from the code, it just would be nice if those could be reused from some generic emacs package instead, couldn't find one a couple years ago when this code was written for omnisharp-emacs. As for x86/x64 selection, the reason was:
The fix was already in for emacs26.4.. I believe. I will add emacs-version check to download x64 version instead on emacs26.4+. |
That sounds perfectly reasonable, and answers my question 100%. As such, I think adding 64-bit support would be nice, but not doing so either wouldn't be considered a deal-breaker on my end. |
@josteink I think I fixed the issue with Windows selection between x86/x64 bundles and starting "OmniSharp.exe" instead of "run". However, I cannot test it myself (yet) -- it would be nice if you could confirm. @yyoncho I have extracted |
@razzmatazz thank you. Yes, we have that(or similar) piece of code on several places, here it is the plan what we are going to try to achieve: #506 (comment) |
@razzmatazz No problem. Will test tomorrow. |
I've tested the latest changes today on my Windows-version of Emacs. And it's definitely progress. What's not 100% right is the logic used to determine what version of Omnisharp-Roslyn to download for Windows. The expression used is fairly involved, so I won't blame anyone for not getting it entirely when not having a system to test on: (if (or (not (null (string-match "^i386-.*" system-configuration)))
(version<= "26.4" emacs-version))
"omnisharp-win-x86.zip"
"omnisharp-win-x64.zip") I did some slight testing and got the following results: emacs-version
;; "27.0.50"
system-configuration
;; "x86_64-w64-mingw32"
(lsp-csharp--server-package-filename)
;; "omnisharp-win-x86.zip" <-- this is obviously wrong. IMO there's too much null-checks and double-negatives in the current code to be able to think straight. So instead of thinking about what we shouldn't have to obtain x64, I decided to think about what we should have for x64 instead. IMO that's much simpler, from what I can tell it works, and it looks like this: (if (and (string-match "^x86_64-.*" system-configuration)
(version<= "26.4" emacs-version))
"omnisharp-win-x64.zip"
"omnisharp-win-x86.zip")
;; "omnisharp-win-x64.zip" So if you jam in that code instead of the existing one, I think this could should be good from a Windows point of view. |
Fix it as suggested by @josteink
LGTM. Thanks for adding this really neat functionality. |
Thank you and congrats for your first |
This adds ability to install the OmniSharp Roslyn server automatically.
The installation procedure works for me on macOS and Linux however I don't have a Windows machine around.
Server retrieval and extraction code was copied from:
and thus has been tested a bit "in the field" already.
@josteink could you take a look at this as well?