Skip to content

Commit 9509148

Browse files
authored
lsp-roslyn: fix arm64 detection and use default window/logMessage handler (#4614)
1 parent 3262813 commit 9509148

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed

clients/lsp-roslyn.el

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Unused on other platforms.")
8181
:package-version '(lsp-mode . "8.0.0")
8282
:group 'lsp-roslyn)
8383

84-
(defcustom lsp-roslyn-package-version "4.12.0-3.24470.11"
84+
(defcustom lsp-roslyn-package-version "4.13.0-2.24564.12"
8585
"Version of the Roslyn package to install.
8686
Gotten from https://dev.azure.com/azure-public/vside/_artifacts/feed/vs-impl/NuGet/Microsoft.CodeAnalysis.LanguageServer.win-x64"
8787
:type 'string
@@ -125,6 +125,7 @@ Gotten from https://dev.azure.com/azure-public/vside/_artifacts/feed/vs-impl/NuG
125125
,lsp-roslyn--stdpipe-path "."
126126
,lsp-roslyn--pipe-name))))
127127
(t (make-network-process
128+
:service "roslyn"
128129
:name process-name
129130
:remote lsp-roslyn--pipe-name
130131
:sentinel sentinel
@@ -203,15 +204,6 @@ creates another process connecting to the named pipe it specifies."
203204
"Convert PATH to a URI, without hexifying."
204205
(url-unhex-string (lsp--path-to-uri-1 path)))
205206

206-
(lsp-defun lsp-roslyn--log-message (_workspace params)
207-
(let ((type (gethash "type" params))
208-
(mes (gethash "message" params)))
209-
(cl-case type
210-
(1 (lsp--error "%s" mes)) ; Error
211-
(2 (lsp--warn "%s" mes)) ; Warning
212-
(3 (lsp--info "%s" mes)) ; Info
213-
(t (lsp--info "%s" mes))))) ; Log
214-
215207
(lsp-defun lsp-roslyn--on-project-initialization-complete (workspace _params)
216208
(lsp--info "%s: Project initialized successfully."
217209
(lsp--workspace-print workspace)))
@@ -268,17 +260,17 @@ Assumes it was installed with the server install function."
268260

269261
(defun lsp-roslyn--get-rid ()
270262
"Retrieves the .NET Runtime Identifier (RID) for the current system."
271-
(let* ((is-x64 (string-match-p (rx (or "x86_64" "aarch64")) system-configuration))
272-
(is-x86 (and (string-match-p "x86" system-configuration) (not is-x64)))
273-
(is-arm (string-match-p (rx (or "arm" "aarch")) system-configuration)))
274-
(if-let ((platform-name (cond
263+
(let* ((is-x64 (string-match-p "x86_64" system-configuration))
264+
(is-arm64 (string-match-p "aarch64" system-configuration))
265+
(is-x86 (and (string-match-p "x86" system-configuration) (not is-x64))))
266+
(if-let* ((platform-name (cond
275267
((eq system-type 'gnu/linux) "linux")
276268
((eq system-type 'darwin) "osx")
277269
((eq system-type 'windows-nt) "win")))
278270
(arch-name (cond
279271
(is-x64 "x64")
280-
(is-x86 "x86")
281-
(is-arm "arm64"))))
272+
(is-arm64 "arm64")
273+
(is-x86 "x86"))))
282274
(format "%s-%s" platform-name arch-name)
283275
(error "Unsupported platform: %s (%s)" system-type system-configuration))))
284276

@@ -345,8 +337,7 @@ FORCED if specified with prefix argument."
345337
:priority 0
346338
:server-id 'csharp-roslyn
347339
:activation-fn (lsp-activate-on "csharp")
348-
:notification-handlers (ht ("window/logMessage" 'lsp-roslyn--log-message)
349-
("workspace/projectInitializationComplete" 'lsp-roslyn--on-project-initialization-complete))
340+
:notification-handlers (ht ("workspace/projectInitializationComplete" 'lsp-roslyn--on-project-initialization-complete))
350341

351342
;; These two functions are the same as lsp-mode's except they do not
352343
;; (un)hexify URIs.

0 commit comments

Comments
 (0)