;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&\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")] 8) #@12 (fn LST) (defalias 'lsp-csharp--version-list-latest #[257 "\300\301\"@\207" [-sort #[514 "\300\301\302O\301\302O\"?\207" [version<= 1 nil] 7 "\n\n(fn A B)"]] 4 (#$ . 946)]) #@73 Returns latest version of the server installed on the machine (if any). (defalias 'lsp-csharp--latest-installed-version #[0 "\301\302!\205\303\304\305\306\307!\"\"!\207" [lsp-csharp-server-install-dir lsp-csharp--version-list-latest f-dir\? seq-filter #[257 "\300\301\"\207" [s-starts-with-p "v"] 4 "\n\n(fn F)"] seq-map f-filename f-entries] 7 (#$ . 1130)]) #@47 Retrieves and parses JSON from URL. (fn URL) (defalias 'lsp-csharp--fetch-json #[257 "\301\302\303\"r\211q\210\304\305\"\216\306!\210\307\310 +\207" [json-false generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] url-insert-file-contents :false json-read] 5 (#$ . 1500)]) #@61 Returns latest version of the server available from github. (defalias 'lsp-csharp--latest-available-version #[0 "\300\301\302\303\304!\"!\207" [lsp-csharp--version-list-latest seq-map #[257 "\300\301\236A!\207" [s-trim name] 4 "\n\n(fn ELT)"] lsp-csharp--fetch-json "https://api.github.com/repos/OmniSharp/omnisharp-roslyn/releases"] 5 (#$ . 1842)]) #@75 The location of the installed OmniSharp server for VERSION. (fn VERSION) (defalias 'lsp-csharp--server-dir #[257 "\211\205\n\301\302!\"\207" [lsp-csharp-server-install-dir f-join expand-file-name] 4 (#$ . 2199)]) #@87 The location of OmniSharp executable/script to use to start the server. (fn VERSION) (defalias 'lsp-csharp--server-bin #[257 "\301!\211\205\302\303=\203\304\202\305\"\207" [system-type lsp-csharp--server-dir f-join windows-nt "OmniSharp.exe" "run"] 6 (#$ . 2422)]) #@331 Returns name of tgz/zip file to be used for downloading the server for auto installation. 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 (defalias 'lsp-csharp--server-package-filename #[0 "\303\267\202\304\305 \"\203\306\307\n\"\203\310\207\311\207\312\207\313=\2034\304\314 \"\315=\2042\304\316 \"\315=\2034\317\207\320\207" [system-type system-configuration emacs-version #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (windows-nt 6 darwin 24)) string-match "^x86_64-.*" version<= "26.4" "omnisharp-win-x64.zip" "omnisharp-win-x86.zip" "omnisharp-osx.tar.gz" gnu/linux "^x86_64" 0 "^i[3-6]86" "omnisharp-linux-x64.tar.gz" "omnisharp-mono.tar.gz"] 3 (#$ . 2704)]) #@107 Returns URL to tgz/zip file to be used for downloading the server VERSION for installation. (fn VERSION) (defalias 'lsp-csharp--server-package-url #[257 "\300\301\302 R\207" ["https://github.com/OmniSharp/omnisharp-roslyn/releases/download/" "/" lsp-csharp--server-package-filename] 5 (#$ . 3618)]) #@88 Downloads and extracts a tgz/zip into the same directory. (fn URL FILENAME REINSTALL) (defalias 'lsp-csharp--extract-server #[771 "\211\203\300!\203\301!\210\302\"\210\303!\304\305\306\307!#!\210\310\"\207" [f-exists-p f-delete lsp-csharp--download f-dirname message format "lsp-csharp: extracting \"%s\" to \"%s\"" f-filename lsp-csharp--extract] 9 (#$ . 3925)]) #@146 Checks if the currently installed version (if any) is lower than then one available on github and if so, downloads and installs a newer version. (defalias 'lsp-csharp-update-server #[0 "\300 \301 \203)\203\"\211\203\302\303\304O\303\304O\"\203\"\305\304\"\210\306\307\301 #\207\306\310!\207" [lsp-csharp--latest-available-version lsp-csharp--latest-installed-version version< 1 nil lsp-csharp--install-server message "lsp-csharp-update-server: latest installed version is %s; latest available is %s" "lsp-csharp-update-server: cannot retrieve latest version info"] 7 (#$ . 4311) nil]) #@125 Installs (or updates to UPDATE-VERSION) server binary unless it is already installed. (fn UPDATE-VERSION ASK-CONFIRMATION) (defalias 'lsp-csharp--install-server #[514 "\300 \206\301 \211\205d\230?\205d\302\303\206\304#\210\2037\305\306\307\2030\306\310\"\2021\311#!\205d\312!\313!\314 \315!\316\317\"\210\320\321\"\322#\210\205X\323!?\205b\324\325#\266\204\207" [lsp-csharp--latest-installed-version lsp-csharp--latest-available-version message "lsp-csharp-update-server: current version is %s; installing %s.." "(none)" yes-or-no-p format "OmniSharp Roslyn Server %s. Do you want to download and install %s now?" "can be updated, currently installed version is %s" "is not installed" lsp-csharp--server-dir lsp-csharp--server-bin lsp-csharp--server-package-filename lsp-csharp--server-package-url mkdir t lsp-csharp--extract-server f-join nil file-exists-p error "Failed to auto-install the server %s; file \"%s\" was not found"] 13 (#$ . 4914)]) #@188 Resolves path to server binary installed, otherwise, if not found will ask the user if we can download and install it. Returns location of script or a binary to use to start the server. (defalias 'lsp-csharp--get-or-install-server #[0 "\300\301 !\211\203\302!\203\207\303\304\305\"\210\300\301 !\211\204 \306\307!\210\207" [lsp-csharp--server-bin lsp-csharp--latest-installed-version file-exists-p lsp-csharp--install-server nil t error "Server binary is required for LSP C# to work."] 4 (#$ . 5905)]) #@109 Downloads file from URL as FILENAME. Will not do anything should the file exist already. (fn URL FILENAME) (defalias 'lsp-csharp--download #[514 "\303!?\2051\304\305\306\"!\210\204)\307\301!\203) \310Y\203)\311\n\312\"\203)\313\202*\314\315#)\207" [gnutls-algorithm-priority libgnutls-version emacs-version f-exists-p message format "lsp-csharp: downloading from \"%s\"..." boundp 30603 version<= "26.2" "NORMAL:-VERS-TLS1.3" url-copy-file nil] 6 (#$ . 6421)]) #@158 Extracts FILENAME which is a downloaded omnisharp-roslyn server tarball or a zip file (based on a current platform) to TARGET-DIR. (fn FILENAME TARGET-DIR) (defalias 'lsp-csharp--extract #[514 "\301=\203*\302\303!\304\305O\306!\307Y\203&\310\311\312\211\211\313\314 \315\n\316\260&\207\317\320!\207\321=\2046\322=\203D\310\323\312\211\324\325\326&\207\327\330#\207" [system-type windows-nt shell-command-to-string "powershell -command \"(Get-Host).Version.Major\"" 0 -1 string-to-number 5 call-process "powershell" nil "-command" "add-type -assembly system.io.compression.filesystem;[io.compression.zipfile]::ExtractToDirectory(\"" "\", \"" "\")" message "lsp-csharp: for automatic server installation procedure to work on Windows you need to have powershell v5+ installed" gnu/linux darwin "tar" t "xf" "-C" error "lsp-csharp cannot extract \"%s\" on platform %s (yet)"] 14 (#$ . 6903)]) #@43 Resolves path to use to start the server. (defalias 'lsp-csharp--language-server-path #[0 "\203\207\301\302 !\207" [lsp-csharp-server-path lsp-csharp--server-bin lsp-csharp--latest-installed-version] 2 (#$ . 7818)]) #@57 Resolves path and arguments to use to start the server. (defalias 'lsp-csharp--language-server-command #[0 "\300 \301D\207" [lsp-csharp--language-server-path "-lsp"] 2 (#$ . 8044)]) (byte-code "\300\301\302\303\304\305\"\306\307\310\311\312\313&!\210\314\315!\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) :server-id csharp :download-server-fn #[1028 "\3001 \301\302\211\"\210 0\207\303!!\207" [(error) lsp-csharp--install-server nil error-message-string] 8 "\n\n(fn CLIENT CALLBACK ERROR-CALLBACK UPDATE\\=\\?)"] provide lsp-csharp] 10)