-
Notifications
You must be signed in to change notification settings - Fork 420
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
Incomplete/missing system API methods #2432
Comments
We'd need to see the log from the omnisharp server. But at a guess, something is messed up with your configuration. |
Thanks for your reply. Here is the log from the language server:
Of particular note, I guess, are the lines about an unsupported version of MSbuild. I'm using the latest stable version of mono, which I guess ships version 16.10, so that's pretty frustrating. The line regarding reference assemblies not being found is very strange since I'm assuredly running an up-to-date SDK: $ dotnet --list-sdks
6.0.400 [/usr/local/share/dotnet/sdk]
$ dotnet --version
6.0.400
$ msbuild --version
Microsoft (R) Build Engine version 16.10.1 for Mono
Copyright (C) Microsoft Corporation. All rights reserved.
16.10.1.31401 Unfortunately I'm at an impasse here because even the Preview build ships with a (slightly newer) version 16.10: $ msbuild --version
Microsoft (R) Build Engine version 16.10.1 for Mono
Copyright (C) Microsoft Corporation. All rights reserved.
16.10.1.40401 Any ideas on what I can try next? Microsoft ships their own |
Waiiiiit a minute: Quoting from the project README (emphasis mine):
I had taken this for granted, but I see now there was a merged PR that removed Mono, however there remains an implicit runtime dependency on mono in this script. Because omnisharp is not built as a self-contained executable I can't just If anyone has any input I'd welcome it |
From the log, it doesn't look like O# was able to find your dotnet installation, which will be why it can't find the reference assemblies. How did you install dotnet? |
From here: https://dotnet.microsoft.com/en-us/download/dotnet/6.0 When I encountered the issue with things being highlighted as missing that was the first thing I checked, and a reinstall did not rectify the issue. |
I'm not particularly familiar with OSX troubleshooting, maybe @filipw has an idea on how fix it? |
I suspect, since macOS is a Unix, that it would be similar to troubleshooting on Linux. What would you recommend to a Linux user? |
I don't think it's similar at all, as osx applications generally install in a very different way than Linux applications. I wouldn't expect to see this issue on Linux, as dotnet would be in |
Well, dotnet is under I still think it's a mismatch between mono and dotnet. The project builds just fine, despite omnisharp not being able to see the reference assemblies and I can still use In other words, dotnet is working fine on my machine, but omnisharp isn't, maybe because omnisharp requires mono to run and mono's having trouble picking up the PATH or something. |
Omnisharp does not require mono to run. What it should be doing is finding the location of the dotnet msbuild (not the mono msbuild) and using the reference assemblies from that installation. However, from your log it's not seeing it at all. This is the part that I do not know how to troubleshoot on a Mac. |
Perhaps I should open another issue? I'm aware of that commit as I linked to it earlier, but I'm afraid you're mistaken. If I remove mono, sudo rm -rf /Library/Frameworks/Mono.framework
sudo pkgutil --forget com.xamarin.mono-MDK.pkg
sudo rm /etc/paths.d/mono-commands ... then omnisharp will not start, citing the following error:
|
The emacs startup scripts you're using not using the modern version of OmniSharp does not mean that OmniSharp requires mono to run. It just means that the emacs scripts you're using to launch it are old. Indeed, that is literally the |
I don't understand. The script you're referring to is part of omnisharp, not part of my emacs configuration. I can walk you through it in greater detail later today. |
You're using the old mono launch scripts to launch OmniSharp. Those are, of course, going to be using mono. OmniSharp can (and really, should) be launched using the modern .NET 6 version of the application, though I don't believe we've created generalized launch scripts for that like we have with mono. I would highly suggest moving to the .NET 6 version if you can, as I suspect it will fix your issues (as well as generally being much more performant. |
Hmm, well, in emacs with In the Releases directory there are several osx releases. I chose
I seem to be doing something wrong. How would I go about moving to the .NET 6 version? |
Don't invoke |
I want to be clear that that script is something that ships with omnisharp and that it's not something I'm doing intentionally. There must be a bug with the way emacs is installing omnisharp because in the server install directory there is no |
I'm aware of this. The script is old, but if we changed it to do something it would break someone's workflow somewhere.
Assuming you're using |
I use Thanks for your help/patience thus far. |
Yeah, that seems to be it. Here's the function on disk: (defcustom lsp-csharp-omnisharp-roslyn-download-url
(concat "https://github.com/omnisharp/omnisharp-roslyn/releases/latest/download/"
(cond ((eq system-type 'windows-nt)
; On Windows we're trying to avoid a crash starting 64bit .NET PE binaries in
; Emacs by using x86 version of omnisharp-roslyn on older (<= 26.4) versions
; of Emacs. See https://lists.nongnu.org/archive/html/bug-gnu-emacs/2017-06/msg00893.html"
(if (and (string-match "^x86_64-.*" system-configuration)
(version<= "26.4" emacs-version))
"omnisharp-win-x64.zip"
"omnisharp-win-x86.zip"))
((eq system-type 'darwin)
"omnisharp-osx.zip")
((and (eq system-type 'gnu/linux)
(or (eq (string-match "^x86_64" system-configuration) 0)
(eq (string-match "^i[3-6]86" system-configuration) 0)))
"omnisharp-linux-x64.zip")
(t "omnisharp-mono.zip")))
"Automatic download url for omnisharp-roslyn."
:group 'lsp-csharp-omnisharp
:type 'string) So I guess that's pulling the wrong zip, and I guess that's what I get for assuming lsp was up to date. Thanks for bearing with me through this mess. |
I'm trying to manipulate some binary data represented as a hexadecimal string and I noticed that the language server incorrectly reports that some API methods do not exist. As a specific example (I have not had time to exhaustively go through all the API and see which are reported incorrectly) I would like to highlight Convert.ToHexString
To reproduce this problem:
ToHexString
is invalid:And that's all there is to it. I am using emacs with an up-to-date omnisharp (verified by running
M-x lsp-update-server
) on macOS 12.5 (Monterey).The text was updated successfully, but these errors were encountered: