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

Add new Roslyn server support for C# #4279

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

Ruin0x11
Copy link
Contributor

Adapted code from:

Closes #4278.

@jcs090218
Copy link
Member

It seems like there is a byte compile error, see https://github.com/emacs-lsp/lsp-mode/actions/runs/7344249257/job/19995837985?pr=4279#step:12:730. 🤔

@Ruin0x11
Copy link
Contributor Author

Thanks, it should be fixed now. Is it normal for the other tests to fail?

@Ruin0x11
Copy link
Contributor Author

I think the piping script may need improvements also. If too many messages overflow the 512 byte buffer they get interspersed and corrupted. It happens when I try to autocomplete something with a lot of candidates.

@jcs090218
Copy link
Member

Thanks, it should be fixed now. Is it normal for the other tests to fail?

It's normal! Don't have to worry about it!

@imakira
Copy link

imakira commented Jan 24, 2024

This is great, by my limited test, it is much faster than omnisharp.

One problem I encountered is when saving files it will throw this error

Debugger entered--Lisp error: (wrong-type-argument stringp #<hash-table equal 2/2 0x479659b>)
string-trim-right(#<hash-table equal 2/2 0x479659b> nil)
string-trim(#<hash-table equal 2/2 0x479659b>)
(let* ((trimmed-pattern (string-trim glob-pattern)) (top-level-unbraced-patterns (lsp-glob-unbrace-at-top-level trimmed-pattern))) (seq-map #'lsp-glob-convert-to-wrapped-regexp top-level-unbraced-patterns))
lsp-glob-to-regexps(#<hash-table equal 2/2 0x479659b>)
(let ((regexp (lsp-glob-to-regexps glob-pattern))) (lsp-put fs-watcher :_cachedRegexp regexp) regexp)
(or cached-regexp (let ((regexp (lsp-glob-to-regexps glob-pattern))) (lsp-put fs-watcher :_cachedRegexp regexp) regexp))
(let* ((regexes (or cached-regexp (let ((regexp (lsp-glob-to-regexps glob-pattern))) (lsp-put fs-watcher :_cachedRegexp regexp) regexp)))) (-any? #'(lambda (re) (or (string-match re changed-file) (string-match re rel-changed-file))) regexes))
(progn (let* ((regexes (or cached-regexp (let ((regexp ...)) (lsp-put fs-watcher :_cachedRegexp regexp) regexp)))) (-any? #'(lambda (re) (or (string-match re changed-file) (string-match re rel-changed-file))) regexes)))
(if (or (null kind?) (> (logand kind? watch-bit) 0)) (progn (let* ((regexes (or cached-regexp (let (...) (lsp-put fs-watcher :_cachedRegexp regexp) regexp)))) (-any? #'(lambda (re) (or (string-match re changed-file) (string-match re rel-changed-file))) regexes))))
(let* ((fs-watcher input0) (glob-pattern (gethash "globPattern" fs-watcher)) (kind? (gethash "kind" fs-watcher)) (cached-regexp (gethash "_cachedRegexp" fs-watcher))) (if (or (null kind?) (> (logand kind? watch-bit) 0)) (progn (let* ((regexes (or cached-regexp (let ... ... regexp)))) (-any? #'(lambda (re) (or ... ...)) regexes)))))
(closure ((watch-bit . 2) (rel-changed-file . "Program.cs") (changed-file . "/home/void/Projects/Moments-Dev/Moments/Program.cs")) (input0) (let* ((fs-watcher input0) (glob-pattern (gethash "globPattern" fs-watcher)) (kind? (gethash "kind" fs-watcher)) (cached-regexp (gethash "_cachedRegexp" fs-watcher))) (if (or (null kind?) (> (logand kind? watch-bit) 0)) (progn (let* ((regexes ...)) (-any? #'... regexes))))))(#<hash-table equal 1/1 0x4796569>)
#f(compiled-function (elt) #<bytecode -0x9859887b04c71da>)(#<hash-table equal 1/1 0x4796569>)
mapc(#f(compiled-function (elt) #<bytecode -0x9859887b04c71da>) [#<hash-table equal 1/1 0x4796569> #<hash-table equal 1/1 0x2a6a829> #<hash-table equal 1/1 0x2a6a89b> #<hash-table equal 1/1 0x2a6a91b>])
seq-do(#f(compiled-function (elt) #<bytecode -0x9859887b04c71da>) [#<hash-table equal 1/1 0x4796569> #<hash-table equal 1/1 0x2a6a829> #<hash-table equal 1/1 0x2a6a89b> #<hash-table equal 1/1 0x2a6a91b>])
seq-find((closure ((watch-bit . 2) (rel-changed-file . "Program.cs") (changed-file . "/home/void/Projects/Moments-Dev/Moments/Program.cs")) (input0) (let* ((fs-watcher input0) (glob-pattern (gethash "globPattern" fs-watcher)) (kind? (gethash "kind" fs-watcher)) (cached-regexp (gethash "_cachedRegexp" fs-watcher))) (if (or (null kind?) (> (logand kind? watch-bit) 0)) (progn (let* ((regexes ...)) (-any? #'... regexes)))))) [#<hash-table equal 1/1 0x4796569> #<hash-table equal 1/1 0x2a6a829> #<hash-table equal 1/1 0x2a6a89b> #<hash-table equal 1/1 0x2a6a91b>])
(and (equal (progn (or (progn (and (memq (type-of capability) cl-struct-lsp--registered-capability-tags) t)) (signal 'wrong-type-argument (list 'lsp--registered-capability capability))) (aref capability 2)) "workspace/didChangeWatchedFiles") (seq-find #'(lambda (input0) (let* ((fs-watcher input0) (glob-pattern (gethash "globPattern" fs-watcher)) (kind? (gethash "kind" fs-watcher)) (cached-regexp (gethash "cachedRegexp" fs-watcher))) (if (or (null kind?) (> ... 0)) (progn (let* ... ...))))) (lsp:did-change-watched-files-registration-options-watchers (progn (or (progn (and (memq ... cl-struct-lsp--registered-capability-tags) t)) (signal 'wrong-type-argument (list 'lsp--registered-capability capability))) (aref capability 3)))))
(closure ((watch-bit . 2) (rel-changed-file . "Program.cs") (changed-file . "/home/void/Projects/Moments-Dev/Moments/Program.cs")) (capability) (and (equal (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... capability))) (aref capability 2)) "workspace/didChangeWatchedFiles") (seq-find #'(lambda (input0) (let* (... ... ... ...) (if ... ...))) (lsp:did-change-watched-files-registration-options-watchers (progn (or (progn ...) (signal ... ...)) (aref capability 3))))))(#s(lsp--registered-capability :id "4f6876e4-b718-4ad7-99c8-5246fc751149" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x479652d>))
funcall((closure ((watch-bit . 2) (rel-changed-file . "Program.cs") (changed-file . "/home/void/Projects/Moments-Dev/Moments/Program.cs")) (capability) (and (equal (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... capability))) (aref capability 2)) "workspace/didChangeWatchedFiles") (seq-find #'(lambda (input0) (let* (... ... ... ...) (if ... ...))) (lsp:did-change-watched-files-registration-options-watchers (progn (or (progn ...) (signal ... ...)) (aref capability 3)))))) #s(lsp--registered-capability :id "4f6876e4-b718-4ad7-99c8-5246fc751149" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x479652d>))
(setq needle (funcall pred it))
(not (setq needle (funcall pred it)))
(let ((it elt) (it-index i)) (ignore it it-index) (not (setq needle (funcall pred it))))
(progn (setq elt (car-safe list)) (let ((it elt) (it-index i)) (ignore it it-index) (not (setq needle (funcall pred it)))))
(if list (progn (setq elt (car-safe list)) (let ((it elt) (it-index i)) (ignore it it-index) (not (setq needle (funcall pred it))))))
(while (if list (progn (setq elt (car-safe list)) (let ((it elt) (it-index i)) (ignore it it-index) (not (setq needle (funcall pred it)))))) (let ((it elt) (it-index i)) (ignore it it-index)) (progn (setq i (1+ i)) (setq list (cdr list))))
(let ((list list) (i 0) elt) (while (if list (progn (setq elt (car-safe list)) (let ((it elt) (it-index i)) (ignore it it-index) (not (setq needle (funcall pred it)))))) (let ((it elt) (it-index i)) (ignore it it-index)) (progn (setq i (1+ i)) (setq list (cdr list)))))
(let (needle) (let ((list list) (i 0) elt) (while (if list (progn (setq elt (car-safe list)) (let ((it elt) (it-index i)) (ignore it it-index) (not (setq needle ...))))) (let ((it elt) (it-index i)) (ignore it it-index)) (progn (setq i (1+ i)) (setq list (cdr list))))) needle)
(and (let (needle) (let ((list list) (i 0) elt) (while (if list (progn (setq elt (car-safe list)) (let (... ...) (ignore it it-index) (not ...)))) (let ((it elt) (it-index i)) (ignore it it-index)) (progn (setq i (1+ i)) (setq list (cdr list))))) needle) t)
-any?((closure ((watch-bit . 2) (rel-changed-file . "Program.cs") (changed-file . "/home/void/Projects/Moments-Dev/Moments/Program.cs")) (capability) (and (equal (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... capability))) (aref capability 2)) "workspace/didChangeWatchedFiles") (seq-find #'(lambda (input0) (let* (... ... ... ...) (if ... ...))) (lsp:did-change-watched-files-registration-options-watchers (progn (or (progn ...) (signal ... ...)) (aref capability 3)))))) (#s(lsp--registered-capability :id "4f6876e4-b718-4ad7-99c8-5246fc751149" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x479652d>) #s(lsp--registered-capability :id "5beaccfd-25f3-4ef0-a1f4-12f51cfa3f44" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x79155f>) #s(lsp--registered-capability :id "26606318-5e0d-4848-9d99-39ffb5a6700c" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x791455>) #s(lsp--registered-capability :id "cbdfccb1-f0d8-494e-be2d-38221e686b13" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x14e921f>) #s(lsp--registered-capability :id "6186128e-581d-44cb-a92b-9cd7617e345e" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x125afab>) #s(lsp--registered-capability :id "df46cab7-6bf8-4f4e-a577-80b862fbdd87" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0xecff19>) #s(lsp--registered-capability :id "0fb8a143-917b-4cde-84ee-2ddaaab6372e" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x24ee501>) #s(lsp--registered-capability :id "b8608351-fb1a-4a49-982e-7beb2ff50a7b" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x3a855a1>) #s(lsp--registered-capability :id "a7396b83-4fa3-4cb7-9d28-34c11276318e" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x365ba73>) #s(lsp--registered-capability :id "0b5d90cb-6495-43e9-ab6d-2c1477e05366" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x174ec23>) #s(lsp--registered-capability :id "244bba62-23b8-48c8-8664-2d1e05ff24c3" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x3d07b09>) #s(lsp--registered-capability :id "94fcc8d8-6b77-4313-b103-e90fa5234df7" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x125a837>) #s(lsp--registered-capability :id "6d84077e-4391-4f2f-9353-cba39a1a51ca" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x125a729>) #s(lsp--registered-capability :id "d46c0abf-becc-4220-aa6f-04f9a9c9ed72" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x7a000b>) #s(lsp--registered-capability :id "6e9f838a-fc87-48f2-8889-eecb3a914609" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x12f77d1>) #s(lsp--registered-capability :id "540da52a-cb19-44a8-badd-b245718b1e77" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x1f8806b>) #s(lsp--registered-capability :id "9a0f1d70-df9f-4a26-a67d-2208ba417f1e" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x3ccf689>) #s(lsp--registered-capability :id "900f8696-7bef-432e-89b7-9f40153386b6" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x38b3715>) #s(lsp--registered-capability :id "a07b766c-404c-4de3-b931-31a50ae4eac0" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x125d4f7>) #s(lsp--registered-capability :id "8192c590-e989-4ec1-9baa-ebf6258716f8" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x2faa903>) #s(lsp--registered-capability :id "d91d3b25-2814-4d3c-be59-43af2e60ea68" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x12c0537>) #s(lsp--registered-capability :id "016e77be-f437-40f6-852b-4a4d7b216cdb" :method "workspace/didChangeWatchedFiles" :options #<hash-table equal 1/1 0x1bbc8f9>)))
(if (-any? #'(lambda (capability) (and (equal (progn (or ... ...) (aref capability 2)) "workspace/didChangeWatchedFiles") (seq-find #'(lambda ... ...) (lsp:did-change-watched-files-registration-options-watchers (progn ... ...))))) (progn (or (progn (and (memq (type-of workspace) cl-struct-lsp--workspace-tags) t)) (signal 'wrong-type-argument (list 'lsp--workspace workspace))) (aref workspace 3))) (progn (let ((lsp--cur-workspace workspace)) (lsp-notify "workspace/didChangeWatchedFiles" (list (cons 'changes (vector (list ... ...))))))))
(closure ((watch-bit . 2) (event-numeric-kind . 2) (rel-changed-file . "Program.cs") (changed-file . "/home/void/Projects/Moments-Dev/Moments/Program.cs")) (workspace) (if (-any? #'(lambda (capability) (and (equal ... "workspace/didChangeWatchedFiles") (seq-find ... ...))) (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... workspace))) (aref workspace 3))) (progn (let ((lsp--cur-workspace workspace)) (lsp-notify "workspace/didChangeWatchedFiles" (list (cons ... ...)))))))(#s(lsp--workspace :ewoc nil :server-capabilities #<hash-table equal 22/22 0x1ab7cb9> :registered-server-capabilities (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) :root "/home/void/Projects/..." :client #s(lsp--client :language-id nil :add-on? nil :new-connection ... :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 2/65 0x374d96b> :request-handlers #<hash-table equal 0/65 0x374dc41> :response-handlers #<hash-table eql 1/65 0x3750e57> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x3751165> :action-handlers #<hash-table equal 0/65 0x3751393> :major-modes nil :activation-fn ... :priority 0 :server-id csharp-roslyn :multi-root nil :initialization-options nil :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn nil ...) :host-root nil :proc # :cmd-proc # :buffers (#) :semantic-tokens-faces nil :semantic-tokens-modifier-faces nil :extra-client-capabilities nil :status initialized :metadata #<hash-table equal 0/65 0x1aa05c9> :watches #<hash-table equal 0/65 0x1aa2279> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 0/65 0x1aa2299> ...))
mapc((closure ((watch-bit . 2) (event-numeric-kind . 2) (rel-changed-file . "Program.cs") (changed-file . "/home/void/Projects/Moment...")) (workspace) (if (-any? ... ...) (progn ...))) (#s(lsp--workspace :ewoc nil :server-capabilities #<hash-table equal 22/22 0x1ab7cb9> :registered-server-capabilities (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) :root "/home/void/Projects/Moment..." :client #s(lsp--client :language-id nil :add-on? nil :new-connection ... :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 2/65 0x374d96b> :request-handlers #<hash-table equal 0/65 0x374dc41> :response-handlers #<hash-table eql 1/65 0x3750e57> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x3751165> :action-handlers #<hash-table equal 0/65 0x3751393> :major-modes nil :activation-fn ... :priority 0 :server-id csharp-roslyn :multi-root nil :initialization-options nil :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn lsp-roslyn--on-initialized :remote? nil :completion-in-comments? nil :path->uri-fn lsp-roslyn--path-to-uri :uri->path-fn lsp-roslyn--uri-to-path ...) :host-root nil :proc # :cmd-proc # :buffers (#) :semantic-tokens-faces nil :semantic-tokens-modifier-faces nil :extra-client-capabilities nil :status initialized :metadata #<hash-table equal 0/65 0x1aa05c9> :watches #<hash-table equal 0/65 0x1aa2279> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 0/65 0x1aa2299> :work-done-tokens #<hash-table equal 0/65 0x1aa5b91>)))
seq-do((closure ((watch-bit . 2) (event-numeric-kind . 2) (rel-changed-file . "Program.cs") (changed-file . "/home/void/Projects/Moment...")) (workspace) (if (-any? ... ...) (progn ...))) (#s(lsp--workspace :ewoc nil :server-capabilities #<hash-table equal 22/22 0x1ab7cb9> :registered-server-capabilities (... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...) :root "/home/void/Projects/Moment..." :client #s(lsp--client :language-id nil :add-on? nil :new-connection ... :ignore-regexps nil :ignore-messages nil :notification-handlers #<hash-table equal 2/65 0x374d96b> :request-handlers #<hash-table equal 0/65 0x374dc41> :response-handlers #<hash-table eql 1/65 0x3750e57> :prefix-function nil :uri-handlers #<hash-table equal 0/65 0x3751165> :action-handlers #<hash-table equal 0/65 0x3751393> :major-modes nil :activation-fn ... :priority 0 :server-id csharp-roslyn :multi-root nil :initialization-options nil :semantic-tokens-faces-overrides nil :custom-capabilities nil :library-folders-fn nil :before-file-open-fn nil :initialized-fn lsp-roslyn--on-initialized :remote? nil :completion-in-comments? nil :path->uri-fn lsp-roslyn--path-to-uri :uri->path-fn lsp-roslyn--uri-to-path ...) :host-root nil :proc # :cmd-proc # :buffers (#) :semantic-tokens-faces nil :semantic-tokens-modifier-faces nil :extra-client-capabilities nil :status initialized :metadata #<hash-table equal 0/65 0x1aa05c9> :watches #<hash-table equal 0/65 0x1aa2279> :workspace-folders nil :last-id 0 :status-string nil :shutdown-action nil :diagnostics #<hash-table equal 0/65 0x1aa2299> :work-done-tokens #<hash-table equal 0/65 0x1aa5b91>)))
(let* ((changed-file (car (cdr (cdr event)))) (rel-changed-file (f-relative changed-file root-folder)) (event-numeric-kind (alist-get (car (cdr event)) lsp--file-change-type)) (bit-position (1- event-numeric-kind)) (watch-bit (ash 1 bit-position))) (seq-do #'(lambda (workspace) (if (-any? #'(lambda ... ...) (progn (or ... ...) (aref workspace 3))) (progn (let (...) (lsp-notify "workspace/didChangeWatchedFiles" ...))))) (gethash root-folder (progn (or (progn (and (memq ... cl-struct-lsp-session-tags) t)) (signal 'wrong-type-argument (list 'lsp-session session))) (aref session 4)))))
lsp--file-process-event(#s(lsp-session :folders ("/home/void/Projects/Moments-Dev/Moments") :folders-blocklist nil :server-id->folders #<hash-table equal 3/65 0x30c609f> :folder->servers #<hash-table equal 1/65 0x30c60bf> :metadata #<hash-table equal 2/65 0x30c60df>) "/home/void/Projects/Moments-Dev/Moments" ((1 . 0) changed "/home/void/Projects/Moments-Dev/Moments/Program.cs"))
apply(lsp--file-process-event (#s(lsp-session :folders ("/home/void/Projects/Moments-Dev/Moments") :folders-blocklist nil :server-id->folders #<hash-table equal 3/65 0x30c609f> :folder->servers #<hash-table equal 1/65 0x30c60bf> :metadata #<hash-table equal 2/65 0x30c60df>) "/home/void/Projects/Moments-Dev/Moments" ((1 . 0) changed "/home/void/Projects/Moments-Dev/Moments/Program.cs")))
#f(compiled-function (&rest args2) #<bytecode 0x1f5be9a4ce611751>)(((1 . 0) changed "/home/void/Projects/Moments-Dev/Moments/Program.cs"))
funcall(#f(compiled-function (&rest args2) #<bytecode 0x1f5be9a4ce611751>) ((1 . 0) changed "/home/void/Projects/Moments-Dev/Moments/Program.cs"))
(cond ((and (file-directory-p file-name) (equal 'created event-type) (not (lsp--string-match-any ignored-directories file-name))) (lsp-watch-root-folder (file-truename file-name) callback ignored-files ignored-directories watch) (seq-do #'(lambda (f) (if (file-directory-p f) nil (funcall callback (list nil ... f)))) (directory-files-recursively file-name "." t))) ((and (memq event-type '(created deleted changed)) (not (file-directory-p file-name)) (not (lsp--string-match-any ignored-files file-name))) (funcall callback event)) ((and (memq event-type '(renamed)) (not (file-directory-p file-name)) (not (lsp--string-match-any ignored-files file-name))) (funcall callback (list (cl-first event) 'deleted (car (cdr (cdr event))))) (funcall callback (list (cl-first event) 'created (car (cdr (cdr (cdr event))))))))
(let ((file-name (car (cdr (cdr event)))) (event-type (car (cdr event)))) (cond ((and (file-directory-p file-name) (equal 'created event-type) (not (lsp--string-match-any ignored-directories file-name))) (lsp-watch-root-folder (file-truename file-name) callback ignored-files ignored-directories watch) (seq-do #'(lambda (f) (if (file-directory-p f) nil (funcall callback ...))) (directory-files-recursively file-name ".
" t))) ((and (memq event-type '(created deleted changed)) (not (file-directory-p file-name)) (not (lsp--string-match-any ignored-files file-name))) (funcall callback event)) ((and (memq event-type '(renamed)) (not (file-directory-p file-name)) (not (lsp--string-match-any ignored-files file-name))) (funcall callback (list (cl-first event) 'deleted (car (cdr (cdr event))))) (funcall callback (list (cl-first event) 'created (car (cdr (cdr ...))))))))
lsp--folder-watch-callback(((1 . 0) changed "/home/void/Projects/Moments-Dev/Moments/Program.cs") #f(compiled-function (&rest args2) #<bytecode 0x1f5be9a4ce611751>) #s(lsp-watch :descriptors #<hash-table equal 12/65 0x1bbb069> :root-directory "/home/void/Projects/Moments-Dev/Moments") ("[/\\]flycheck
[^/\\\\]+\'" "[/\\]\.#[^/\\\\]+\'" "[/\\][^/\\\\]+\'") ("[/\\]\.git\'" "[/\\]\.github\'" "[/\\]\.gitlab\'" "[/\\]\.circleci\'" "[/\\]\.hg\'" "[/\\]\.bzr\'" "[/\\]_darcs\'" "[/\\]\.svn\'" "[/\\]FOSSIL\'" "[/\\]\.idea\'" "[/\\]\.ensime_cache\'" "[/\\]\.eunit\'" "[/\\]node_modules" "[/\\]\.yarn\'" "[/\\]\.fslckout\'" "[/\\]\.tox\'" "[/\\]\.nox\'" "[/\\]dist\'" "[/\\]dist-newstyle\'" "[/\\]\.stack-work\'" "[/\\]\.bloop\'" "[/\\]\.metals\'" "[/\\]target\'" "[/\\]\.ccls-cache\'" "[/\\]\.vscode\'" "[/\\]\.venv\'" "[/\\]\.mypy_cache\'" "[/\\]\.pytest_cache\'" "[/\\]\.build\'" "[/\\]pycache\'" "[/\\]\.deps\'" "[/\\]build-aux\'" "[/\\]autom4te.cache\'" "[/\\]\.reference\'" "[/\\]bazel-[^/\\\\]+\'" "[/\\]\.meta\'" "[/\\]Library\'" "[/\\]\.lsp\'" "[/\\]\.clj-kondo\'" "[/\\]\.shadow-cljs\'" "[/\\]\.babel_cache\'" "[/\\]\.cpcache\'" "[/\\]\checkouts\'" "[/\\]\.gradle\'" "[/\\]\.m2\'" "[/\\]bin/Debug\'" "[/\\]obj\'" "[/\\]_opam\'" "[/\\]_build\'" "[/\\]\.elixir_ls\'" ...))
(closure ((watch . #s(lsp-watch :descriptors #<hash-table equal 12/65 0x1bbb069> :root-directory "/home/void/Projects/Moments-Dev/Moments")) (ignored-directories "[/\\]\.git\'" "[/\\]\.github\'" "[/\\]\.gitlab\'" "[/\\]\.circleci\'" "[/\\]\.hg\'" "[/\\]\.bzr\'" "[/\\]_darcs\'" "[/\\]\.svn\'" "[/\\]FOSSIL\'" "[/\\]\.idea\'" "[/\\]\.ensime_cache\'" "[/\\]\.eunit\'" "[/\\]node_modules" "[/\\]\.yarn\'" "[/\\]\.fslckout\'" "[/\\]\.tox\'" "[/\\]\.nox\'" "[/\\]dist\'" "[/\\]dist-newstyle\'" "[/\\]\.stack-work\'" "[/\\]\.bloop\'" "[/\\]\.metals\'" "[/\\]target\'" "[/\\]\.ccls-cache\'" "[/\\]\.vscode\'" "[/\\]\.venv\'" "[/\\]\.mypy_cache\'" "[/\\]\.pytest_cache\'" "[/\\]\.build\'" "[/\\]pycache\'" "[/\\]\.deps\'" "[/\\]build-aux\'" "[/\\]autom4te.cache\'" "[/\\]\.reference\'" "[/\\]bazel-[^/\\\\]+\'" "[/\\]\.meta\'" "[/\\]Library\'" "[/\\]\.lsp\'" "[/\\]\.clj-kondo\'" "[/\\]\.shadow-cljs\'" "[/\\]\.babel_cache\'" "[/\\]\.cpcache\'" "[/\\]\checkouts\'" "[/\\]\.gradle\'" "[/\\]\.m2\'" "[/\\]bin/Debug\'" "[/\\]obj\'" "[/\\]_opam\'" "[/\\]build\'" ...) (ignored-files "[/\\]flycheck[^/\\\\]+\'" "[/\\]\.#[^/\\\\]+\'" "[/\\][^/\\\\]+
\'") (callback . #f(compiled-function (&rest args2) #<bytecode 0x1f5be9a4ce611751>))) (event) (lsp--folder-watch-callback event callback watch ignored-files ignored-directories))(((1 . 0) changed "/home/void/Projects/Moments-Dev/Moments/Program.cs"))
file-notify--call-handler(#s(file-notify--watch :directory "/home/void/Projects/Moments-Dev/Moments" :filename nil :callback (closure ((watch . #s(lsp-watch :descriptors #<hash-table equal 12/65 0x1bbb069> :root-directory "/home/void/Projects/Moments-Dev/Moments")) (ignored-directories "[/\\]\.git\'" "[/\\]\.github\'" "[/\\]\.gitlab\'" "[/\\]\.circleci\'" "[/\\]\.hg\'" "[/\\]\.bzr\'" "[/\\]_darcs\'" "[/\\]\.svn\'" "[/\\]FOSSIL\'" "[/\\]\.idea\'" "[/\\]\.ensime_cache\'" "[/\\]\.eunit\'" "[/\\]node_modules" "[/\\]\.yarn\'" "[/\\]\.fslckout\'" "[/\\]\.tox\'" "[/\\]\.nox\'" "[/\\]dist\'" "[/\\]dist-newstyle\'" "[/\\]\.stack-work\'" "[/\\]\.bloop\'" "[/\\]\.metals\'" "[/\\]target\'" "[/\\]\.ccls-cache\'" "[/\\]\.vscode\'" "[/\\]\.venv\'" "[/\\]\.mypy_cache\'" "[/\\]\.pytest_cache\'" "[/\\]\.build\'" "[/\\]pycache\'" "[/\\]\.deps\'" "[/\\]build-aux\'" "[/\\]autom4te.cache\'" "[/\\]\.reference\'" "[/\\]bazel-[^/\\\\]+\'" "[/\\]\.meta\'" "[/\\]Library\'" "[/\\]\.lsp\'" "[/\\]\.clj-kondo\'" "[/\\]\.shadow-cljs\'" "[/\\]\.babel_cache\'" "[/\\]\.cpcache\'" "[/\\]\checkouts\'" "[/\\]\.gradle\'" "[/\\]\.m2\'" "[/\\]bin/Debug\'" "[/\\]obj\'" "[/\\]_opam\'" "[/\\]build\'" ...) (ignored-files "[/\\]flycheck[^/\\\\]+\'" "[/\\]\.#[^/\\\\]+\'" "[/\\][^/\\\\]+~\'") (callback . #f(compiled-function (&rest args2) #<bytecode 0x1f5be9a4ce611751>))) (event) (lsp--folder-watch-callback event callback watch ignored-files ignored-directories))) (1 . 0) changed "/home/void/Projects/Moments-Dev/Moments/Program.cs" nil)
file-notify--handle-event((1 . 0) (changed) "Program.cs" 0)
file-notify--callback-inotify(((1 . 0) (modify) "Program.cs" 0))
file-notify-handle-event((file-notify ((1 . 0) (modify) "Program.cs" 0) file-notify--callback-inotify))
funcall-interactively(file-notify-handle-event (file-notify ((1 . 0) (modify) "Program.cs" 0) file-notify--callback-inotify))
command-execute(file-notify-handle-event nil [(file-notify ((1 . 0) (modify) "Program.cs" 0) file-notify--callback-inotify)] t)

By the way, I can't get the automatic download working, it says 401 Unauthorized, so I manually downloaded it from Download and Release Roslyn.

@imakira
Copy link

imakira commented Jan 24, 2024

It seems in LSP 3.17 it changed that GlobPattern could either be a string or an object with two attributes (baseUri and pattern)

@kirill-gerasimenko-da
Copy link

This is great, by my limited test, it is much faster than omnisharp

Does it support the same capabilities?

@imakira
Copy link

imakira commented Jan 30, 2024

This is great, by my limited test, it is much faster than omnisharp

Does it support the same capabilities?

Sorry I haven't used it much, but it is the one powering vscode-csharp So I assume it could be quite competent.

@Hi-Angel
Copy link
Contributor

CC: @razzmatazz (the C#/F# maintainer here)

@Ruin0x11 Idk what are the lsp-mode rules though, but usually commits that fix previous commits within a single pull-request/merge-request/patchset are frowned upon. If your older commit has a bug, fix it in that commit. In your case though I presume you might want to squash everything.

} catch [System.AggregateException] {
Write-Error $error[0].exception.innerexception
throw $error[0].exception.innerexception
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this file for? 🤔 Can you explain it? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This server only supports connecting via named pipes and has no stdin option. However, Emacs does not natively support connecting via named pipes on Windows, so this script is meant as a shim to convert the named pipe I/O to stdin I/O.

clients/lsp-roslyn.el Outdated Show resolved Hide resolved
@jcs090218
Copy link
Member

Can you resolve conflicts and rebase this? Thanks!

@github-actions github-actions bot added documentation client One or more of lsp-mode language clients labels Apr 16, 2024
@Ruin0x11 Ruin0x11 force-pushed the feature/roslyn-server branch 2 times, most recently from 09f9837 to daf20df Compare April 16, 2024 15:30
@KaranAhlawat
Copy link

Hey all, thanks so much for working on this. Any updates as to what's the status of the PR?

@jcs090218
Copy link
Member

Can you resolve conflicts and rebase this? Thanks!

@KaranAhlawat
Copy link

KaranAhlawat commented Jun 23, 2024

I'm not sure how I would push commits to someone else's fork and branch. If you know how that can be done, I'd be happy to try and resolve the conflicts.

@jcs090218
Copy link
Member

Oops, sorry. I thought you were the author. Feel free to open another same PR with the fixes since we haven't heard back from the author for a while. 🤔

@Hi-Angel
Copy link
Contributor

we haven't heard back from the author for a while. 🤔

This isn't entirely true. You asked the author to rebase 2 months ago which they did. There wasn't anything to do on their side 😊 2 months later you ask them to rebase again, and it happened just 9 hours ago so they may not even seen the comment.

@jcs090218
Copy link
Member

jcs090218 commented Jun 24, 2024

This isn't entirely true. You asked the author to rebase 2 months ago which they did. There wasn't anything to do on their side 😊 2 months later you ask them to rebase again, and it happened just 9 hours ago so they may not even seen the comment.

Oh, you are right. Sorry, I apologize. I thought this was another similar PR: #4441 (both on C#). 😓

@jcs090218
Copy link
Member

LGTM. Thanks!

@jcs090218 jcs090218 merged commit bee65c7 into emacs-lsp:master Jun 24, 2024
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client One or more of lsp-mode language clients documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Roslyn language server (.NET)
6 participants