;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305\306\307\310\301\311\312&\210\313\314\315\316\317DD\320\310\305\321\322&\210\313\323\315\316\324DD\325\310\305\321\326&\210\313\327\315\316\330DD\331\310\305\321\332&\210\313\333\315\316\334DD\335\310\305\321\332&\210\313\336\315\316\337DD\340\310\305\321\332&\210\313\341\315\316\342DD\343\310\305\321\344&\210\313\345\315\316\346DD\347\310\305\321\344&\210\350\351\352\"\207" [require lsp-mode gnutls f custom-declare-group lsp-csharp nil "LSP support for C#, using the Omnisharp Language Server.\nVersion 1.34.3 minimum is required." :group :link (url-link "https://github.com/OmniSharp/omnisharp-roslyn") custom-declare-variable lsp-csharp-server-install-dir funcall function #[0 "\301\302\"\207" [lsp-server-install-dir f-join "omnisharp-roslyn/"] 3] "Installation directory for OmniSharp Roslyn server." :type directory lsp-csharp-server-path #[0 "\300\207" [nil] 1] "The path to the OmniSharp Roslyn language-server binary.\nSet this if you have the binary installed or have it built yourself." (string :tag "Single string value or nil") lsp-csharp-test-run-buffer-name #[0 "\300\207" [#1="*lsp-csharp test run*"] 1 #1#] "The name of buffer used for outputing lsp-csharp test run results." string lsp-csharp-solution-file #[0 "\300\207" [nil] 1] "Solution to load when starting the server.\nUsually this is to be set in your .dir-locals.el on the project root directory." lsp-csharp-omnisharp-roslyn-download-url #[0 "\303\304\267\202!\305\306 \"\203\307\310\n\"\203\311\202>\312\202>\313\202>\314=\203=\305\315 \"\316=\2049\305\317 \"\316=\203=\320\202>\321P\207" [system-type system-configuration emacs-version "https://github.com/omnisharp/omnisharp-roslyn/releases/latest/download/" #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (windows-nt 7 darwin 29)) string-match "^x86_64-.*" version<= "26.4" "omnisharp-win-x64.zip" "omnisharp-win-x86.zip" "omnisharp-osx.zip" gnu/linux "^x86_64" 0 "^i[3-6]86" "omnisharp-linux-x64.zip" "omnisharp-mono.zip"] 4] "Automatic download url for omnisharp-roslyn." lsp-csharp-omnisharp-roslyn-store-path #[0 "\301\302\303#\207" [lsp-csharp-server-install-dir f-join "latest" "omnisharp-roslyn.zip"] 4] "The path where omnisharp-roslyn .zip archive will be stored." file lsp-csharp-omnisharp-roslyn-server-dir #[0 "\301\302\303#\207" [lsp-csharp-server-install-dir f-join "latest" "omnisharp-roslyn"] 4] "The path where omnisharp-roslyn .zip archive will be extracted." lsp-dependency omnisharp-roslyn (:download :url lsp-csharp-omnisharp-roslyn-download-url :store-path lsp-csharp-omnisharp-roslyn-store-path)] 8) #@165 Download zip package for omnisharp-roslyn and install it. Will invoke CALLBACK on success, ERROR-CALLBACK on error. (fn CLIENT CALLBACK ERROR-CALLBACK UPDATE\=\?) (defalias 'lsp-csharp--download-server #[1028 "\300\301\302\303\"#\207" [lsp-package-ensure omnisharp-roslyn make-closure #[0 "\304 \n\"\210 \305=\204B\306\n\307\"\310!\204<\211\311\312\313\"\314\315\"\216r\211q\210\316c\210\317c\210\320c\210)r\211q\210\321\322\211\322\323%\210*\266\324\325\"\266\300 \207" [V0 lsp-csharp-omnisharp-roslyn-store-path lsp-csharp-omnisharp-roslyn-server-dir system-type lsp-unzip windows-nt f-join "run" f-exists-p generate-new-buffer " *temp file*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] "#!/bin/bash\n" "BASEDIR=$(dirname \"$0\")\n" "exec mono $BASEDIR/OmniSharp.exe $@\n" write-region nil 0 set-file-modes 493] 9]] 9 (#$ . 2769)]) #@42 Resolve path to use to start the server. (defalias 'lsp-csharp--language-server-path #[0 "\203\207 \303!\205\304\n\305=\203\306\202\307\"\207" [lsp-csharp-server-path lsp-csharp-omnisharp-roslyn-server-dir system-type f-exists\? f-join windows-nt "OmniSharp.exe" "run"] 5 (#$ . 3659)]) #@57 Resolves path and arguments to use to start the server. (defalias 'lsp-csharp--language-server-command #[0 "\301\302 \303D\205\304\305!D\"\207" [lsp-csharp-solution-file append lsp-csharp--language-server-path "-lsp" "-s" expand-file-name] 5 (#$ . 3963)]) #@66 Open corresponding project file (.csproj) for the current file. (defalias 'lsp-csharp-open-project-file #[0 "\300\301\302 \"\303\304\"\305\306\"\305\307\"\310!\207" [lsp-make-omnisharp-project-information-request :file-name buffer-file-name lsp-request "o#/project" gethash "MsBuildProject" "Path" find-file] 6 (#$ . 4229) nil]) #@129 Retrieve code structure by calling into the /v2/codestructure endpoint. Returns :elements from omnisharp:CodeStructureResponse. (defalias 'lsp-csharp--get-buffer-code-elements #[0 "\300\301\302\303\304 \"\"\305\306\"\207" [lsp-request "o#/v2/codestructure" lsp-make-omnisharp-code-structure-request :file-name buffer-file-name gethash "Elements"] 5 (#$ . 4570)]) #@92 Invoke FN for every omnisharp:CodeElement found recursively in ELEMENTS. (fn FN ELEMENTS) (defalias 'lsp-csharp--inspect-code-elements-recursively #[514 "\300\301\302\"\"\207" [seq-each make-closure #[257 "\300!\210\211\301\302\"\303\300\"\207" [V0 gethash "Children" lsp-csharp--inspect-code-elements-recursively] 6 "\n\n(fn EL)"]] 6 (#$ . 4940)]) #@97 Flatten the omnisharp:CodeElement tree in ELEMENTS matching PREDICATE. (fn PREDICATE ELEMENTS) (defalias 'lsp-csharp--collect-code-elements-recursively #[514 "\300C\301\302\303#\"\210\211\242\207" [nil lsp-csharp--inspect-code-elements-recursively make-closure #[257 "\300!\205\f\301\301\242B\240\207" [V0 V1] 4 "\n\n(fn EL)"]] 8 (#$ . 5301)]) #@83 Determine if L (line) and C (column) are within RANGE. (fn INPUT0 INPUT1 INPUT2) (defalias 'lsp-csharp--l-c-within-range #[771 "\300\301\"\300\302\"\300\303\"\300\304\"\300\303\"\300\304\"U\2035Y\2035V\206NX\206NV\203CW\206NU\205NX\207" [gethash "Start" "End" "Line" "Column"] 13 (#$ . 5658)]) #@100 Return omnisharp:CodeElement stack at L (line) and C (column) in ELEMENTS tree. (fn L C ELEMENTS) (defalias 'lsp-csharp--code-element-stack-on-l-c #[771 "\300\301\302#\"\211\205\211\303\304\"\305#B\262\262\207" [seq-find make-closure #[257 "\302\303\"\211\205\302\304\"\211\205\305\300\301#\262\207" [V0 V1 gethash "Ranges" "full" lsp-csharp--l-c-within-range] 7 "\n\n(fn EL)"] gethash "Children" lsp-csharp--code-element-stack-on-l-c] 11 (#$ . 5998)]) #@56 Return omnisharp:CodeElement stack at point as a list. (defalias 'lsp-csharp--code-element-stack-at-point #[0 "\300\301 \302\"\300\301 \303\"\304\305 #\207" [plist-get lsp--cur-position :line :character lsp-csharp--code-element-stack-on-l-c lsp-csharp--get-buffer-code-elements] 6 (#$ . 6480)]) #@79 Return test method name and test framework for a given ELEMENT. (fn ELEMENT) (defalias 'lsp-csharp--code-element-test-method-p #[257 "\211\205%\300\301\"\211\205#\300\302\"\211\205!\300\303\"\211\205D\262\262\262\207" [gethash "Properties" "testMethodName" "testFramework"] 6 (#$ . 6783)]) #@143 Create new or reuse an existing test result output buffer. PRESENT-BUFFER will make the buffer be presented to the user. (fn PRESENT-BUFFER) (defalias 'lsp-csharp--reset-test-buffer #[257 "r\302!q\210\303 \210\304 \210\305\306 \210*\211\205\307!\207" [lsp-csharp-test-run-buffer-name inhibit-read-only get-buffer-create compilation-mode read-only-mode t erase-buffer display-buffer] 3 (#$ . 7094)]) #@120 Run test(s) identified by TEST-METHOD-NAMES using TEST-METHOD-FRAMEWORK. (fn TEST-METHOD-FRAMEWORK TEST-METHOD-NAMES) (defalias 'lsp-csharp--start-tests #[514 "\203)\211\203)\300\301\302 \303\304\305!&\306\307!\210\310\311\"\210\310\312\"\210\313\314\315#\207\316\317!\207" [lsp-make-omnisharp-run-tests-in-class-request :file-name buffer-file-name :test-frameworkname :method-names vconcat lsp-csharp--reset-test-buffer t lsp-session-set-metadata "last-test-method-framework" "last-test-method-names" lsp-request-async "o#/v2/runtestsinclass" #[257 "\300\301!\207" [message "lsp-csharp: Test run has started"] 3 "\n\n(fn INPUT0)"] message "lsp-csharp: No test methods to run"] 10 (#$ . 7506)]) #@61 Emit a MESSAGE to lsp-csharp test run buffer. (fn MESSAGE) (defalias 'lsp-csharp--test-message #[257 "\302!\211\205\303\211\205r\211q\210\212db\210\304\261*)\207" [lsp-csharp-test-run-buffer-name inhibit-read-only get-buffer t "\n"] 5 (#$ . 8218)]) #@43 Start test run at current point (if any). (defalias 'lsp-csharp-run-test-at-point #[0 "\300 \301!@\302!\211@A@\303C\"\207" [lsp-csharp--code-element-stack-at-point last lsp-csharp--code-element-test-method-p lsp-csharp--start-tests] 8 (#$ . 8482) nil]) #@45 Run all test methods in the current buffer. (defalias 'lsp-csharp-run-all-tests-in-buffer #[0 "\300 \301\302\"\302@!A@\303\304\"\305\"\207" [lsp-csharp--get-buffer-code-elements lsp-csharp--collect-code-elements-recursively lsp-csharp--code-element-test-method-p mapcar #[257 "\300!@\207" [lsp-csharp--code-element-test-method-p] 3 "\n\n(fn METHOD)"] lsp-csharp--start-tests] 7 (#$ . 8746) nil]) #@38 Run selected test in current buffer. (defalias 'lsp-csharp-run-test-in-buffer #[0 "\300 \211\205\n\301\302\"\211\205\302@!A@\211\205\303\304\"\211\205%\305\306\307#\211\205.\310C\"\207" [lsp-csharp--get-buffer-code-elements lsp-csharp--collect-code-elements-recursively lsp-csharp--code-element-test-method-p mapcar #[257 "\300!@\207" [lsp-csharp--code-element-test-method-p] 3 "\n\n(fn METHOD)"] lsp--completing-read "Select test:" identity lsp-csharp--start-tests] 8 (#$ . 9154) nil]) #@41 Re-run test(s) that were run last time. (defalias 'lsp-csharp-run-last-tests #[0 "\300\301!\211\205\n\300\302!\211\203\303\"\207\304\305!\207" [lsp-session-get-metadata "last-test-method-framework" "last-test-method-names" lsp-csharp--start-tests message "lsp-csharp: No test method(s) found to be ran previously on this workspace"] 5 (#$ . 9661) nil]) #@105 Handle the 'o#/error' (interop) notification by displaying a message with lsp-warn. (fn INPUT0 INPUT1) (defalias 'lsp-csharp--handle-os-error #[514 "\300\301\302\"\301\303\"\304\305#\207" [nil gethash "FileName" "Text" lsp-warn "%s: %s"] 9 (#$ . 10026)]) #@107 Handle the 'o#/testmessage and display test message on lsp-csharp test output buffer. (fn INPUT0 INPUT1) (defalias 'lsp-csharp--handle-os-testmessage #[514 "\300\301\302\"\303!\207" [nil gethash "Message" lsp-csharp--test-message] 6 (#$ . 10293)]) #@152 Handle the 'o#/testcompleted' message from the server. Will display the results of the test on the lsp-csharp test output buffer. (fn INPUT0 INPUT1) (defalias 'lsp-csharp--handle-os-testcompleted #[514 "\301\302\303\"\302\304\"\302\305\"\302\306\"\302\307\"\302\310\"\311\230\312\313\314\315\226\316\2031\317\2022\320# #!\210\211?\205g\312!\210\203I\312!\210\321!\204X\312\322!\210\323\324\"\210\321!?\205g\312\325!\210\323\326\"\262)\207" [standard-output nil gethash "MethodName" "Outcome" "ErrorMessage" "ErrorStackTrace" "StandardOutput" "StandardError" "passed" lsp-csharp--test-message format "[%s] %s " propertize font-lock-face success error seq-empty-p "STANDARD OUTPUT:" seq-do #[257 "\300!\207" [lsp-csharp--test-message] 3 "\n\n(fn STDOUT-LINE)"] "STANDARD ERROR:" #[257 "\300!\207" [lsp-csharp--test-message] 3 "\n\n(fn STDERR-LINE)"]] 16 (#$ . 10551)]) #@139 Read first argument from ACTION as Location and display xrefs for that location using the `textDocument/references' request. (fn INPUT0) (defalias 'lsp-csharp--action-client-find-references #[257 "\301\302\"\303!\211\203X\301\304\"\211\203T\301\305\"\211\203P\301\306\"\211\203L\307\310\311D\"\312\313DD\"\211\203H\314\315\"\211\203D\316\317!\320\321#\207\322\323!\207\322\323!\207\322\323!\207\322\323!\207\322\323!\207\322\323!\207" [json-false gethash "arguments" lsp-seq-first "uri" "range" "start" append lsp--text-document-position-params :uri :context :includeDeclaration lsp-request "textDocument/references" lsp-show-xrefs lsp--locations-to-xref-items nil t message "No references found"] 12 (#$ . 11459)]) (byte-code "\300\301\302\303\304\305\"\306\307\310\311\312\313\314\315\"\316\317\320#\210\211\262\321\313\314\315\"\316\322\323#\210\316\324\323#\210\316\325\323#\210\316\326\323#\210\316\327\323#\210\316\330\323#\210\316\331\323#\210\316\332\333#\210\316\334\335#\210\316\336\337#\210\316\340\323#\210\316\341\323#\210\211\262\342\343&\f!\207" [lsp-register-client make-lsp-client :new-connection lsp-stdio-connection lsp-csharp--language-server-command #[0 "\300 \211\205 \301!\207" [lsp-csharp--language-server-path f-exists\?] 3] :major-modes (csharp-mode csharp-tree-sitter-mode) :server-id csharp :action-handlers make-hash-table :test equal puthash "omnisharp/client/findReferences" lsp-csharp--action-client-find-references :notification-handlers "o#/projectadded" ignore "o#/projectchanged" "o#/projectremoved" "o#/packagerestorestarted" "o#/msbuildprojectdiagnostics" "o#/packagerestorefinished" "o#/unresolveddependencies" "o#/error" lsp-csharp--handle-os-error "o#/testmessage" lsp-csharp--handle-os-testmessage "o#/testcompleted" lsp-csharp--handle-os-testcompleted "o#/projectconfiguration" "o#/projectdiagnosticstatus" :download-server-fn lsp-csharp--download-server] 16) (defconst lsp-csharp-plist-value-when-compiled nil) (provide 'lsp-csharp)