Skip to content

Commit 5fd2d2c

Browse files
authored
Revert "lsp-csharp: add a test to check if dotnet tool csharp-ls is actually installed" (#4368)
* treewide: replace `looking-at` with `looking-at-p` if match data unused `looking-at-p` does not change match data and so should be a bit faster. * Revert "lsp-csharp: add a test to check if dotnet tool csharp-ls is actually installed" This reverts commit 9b3a921. This commit broke detection of `csharp-ls`. I am not sure what was the purpose of the change. The function it adds says it checks whether `csharp-ls` is present in the system, however the function `lsp-csharp--cls-make-launch-cmd` always did the same and better. So why have this additional check is not at all clear. The function was assuming that a `dotnet tool list -g` should return if `csharp-ls` is installed, however for me its output is just empty: λ dotnet tool list -g Package Id Version Commands ------------------------------------- Let's revert this commit. Fixes: #4365
1 parent 1149f7d commit 5fd2d2c

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

clients/lsp-csharp.el

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -442,11 +442,6 @@ filename is returned so lsp-mode can display this file."
442442
(list csharp-ls-exec)
443443
solution-file-params)))
444444

445-
(defun lsp-csharp--cls-test-csharp-ls-present ()
446-
"Return non-nil if dotnet tool csharp-ls is installed globally."
447-
(string-match-p "csharp-ls"
448-
(shell-command-to-string "dotnet tool list -g")))
449-
450445
(defun lsp-csharp--cls-download-server (_client callback error-callback update?)
451446
"Install/update csharp-ls language server using `dotnet tool'.
452447
@@ -458,8 +453,7 @@ Will update if UPDATE? is t"
458453
"dotnet" "tool" (if update? "update" "install") "-g" "csharp-ls"))
459454

460455
(lsp-register-client
461-
(make-lsp-client :new-connection (lsp-stdio-connection #'lsp-csharp--cls-make-launch-cmd
462-
#'lsp-csharp--cls-test-csharp-ls-present)
456+
(make-lsp-client :new-connection (lsp-stdio-connection #'lsp-csharp--cls-make-launch-cmd)
463457
:priority -2
464458
:server-id 'csharp-ls
465459
:activation-fn (lsp-activate-on "csharp")

clients/lsp-javascript.el

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -888,13 +888,13 @@ with the file contents."
888888
(unless (re-search-forward "[^\n[:space:]]" nil t)
889889
(setq stop t))
890890
(if (= (point) (point-min)) (setq stop t) (backward-char))
891-
(cond ((or (looking-at "//+[ ]*@flow")
892-
(looking-at "/\\**[ ]*@flow")
893-
(looking-at "[ ]*\\*[ ]*@flow"))
891+
(cond ((or (looking-at-p "//+[ ]*@flow")
892+
(looking-at-p "/\\**[ ]*@flow")
893+
(looking-at-p "[ ]*\\*[ ]*@flow"))
894894
(setq found t) (setq stop t))
895-
((or (looking-at "//") (looking-at "*"))
895+
((or (looking-at-p "//") (looking-at-p "*"))
896896
(forward-line))
897-
((looking-at "/\\*")
897+
((looking-at-p "/\\*")
898898
(save-excursion
899899
(unless (re-search-forward "*/" nil t) (setq stop t)))
900900
(forward-line))

lsp-mode.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5230,7 +5230,7 @@ If EXCLUDE-DECLARATION is non-nil, request the server to include declarations."
52305230
lsp--eldoc-saved-message
52315231
(setq lsp--hover-saved-bounds nil
52325232
lsp--eldoc-saved-message nil)
5233-
(if (looking-at "[[:space:]\n]")
5233+
(if (looking-at-p "[[:space:]\n]")
52345234
(setq lsp--eldoc-saved-message nil) ; And returns nil.
52355235
(when (and lsp-eldoc-enable-hover (lsp--capability :hoverProvider))
52365236
(lsp-request-async
@@ -5268,7 +5268,7 @@ If EXCLUDE-DECLARATION is non-nil, request the server to include declarations."
52685268
(defun lsp--document-highlight ()
52695269
(when (lsp-feature? "textDocument/documentHighlight")
52705270
(let ((curr-sym-bounds (bounds-of-thing-at-point 'symbol)))
5271-
(unless (or (looking-at "[[:space:]\n]")
5271+
(unless (or (looking-at-p "[[:space:]\n]")
52725272
(not lsp-enable-symbol-highlighting)
52735273
(and lsp--have-document-highlights
52745274
curr-sym-bounds

0 commit comments

Comments
 (0)