;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\301\302!\210\301\303!\210\301\304!\210\301\305!\210\301\306!\210\301\307!\210\301\310!\210\311\312\313\314\315DD\316\317\320\321\322\323\324& \210\311\325\313\314\326DD\327\317\320\321\322\323\330& \210\311\331\313\314\332DD\333\317\334\321\322\323\335& \210\336\337\340\341\325\342\343\344\345\346\347#\350BBBBBBB\"\207" [lsp-server-install-dir require lsp-mode cl-lib rx seq dom dash s custom-declare-variable lsp-clangd-version funcall function #[0 "\300\207" [#1="12.0.0"] 1 #1#] "Clangd version to download.\nIt has to be set before `lsp-clangd.el' is loaded and it has to\nbe available here: https://github.com/clangd/clangd/releases/" :type string :group lsp-clangd :package-version (lsp-mode . "7.1") lsp-clangd-download-url #[0 "\302\303\267\202\304\202\305\202\306 \211#\207" [system-type lsp-clangd-version format #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (darwin 7 windows-nt 11)) "https://github.com/clangd/clangd/releases/download/%s/clangd-mac-%s.zip" "https://github.com/clangd/clangd/releases/download/%s/clangd-windows-%s.zip" "https://github.com/clangd/clangd/releases/download/%s/clangd-linux-%s.zip"] 4] "Automatic download url for clangd" (lsp-mode . "7.1") lsp-clangd-binary-path #[0 "\303\304\305 \"\n\306=\203\307\202\310#\207" [lsp-server-install-dir lsp-clangd-version system-type f-join format "clangd/clangd_%s/bin" windows-nt "clangd.exe" "clangd"] 5] "The path to `clangd' binary." file (lsp-mode . "7.1") lsp-dependency clangd :download :url :decompress :zip :store-path f-join "clangd" "clangd.zip" (:binary-path lsp-clangd-binary-path :set-executable\? t)] 12) #@41 Position point just after HTTP headers. (defalias 'lsp-cpp-flycheck-clang-tidy--skip-http-headers #[0 "\300\301!\207" [re-search-forward "^$"] 2 (#$ . 1751)]) #@68 Narrow the current buffer to contain the body of an HTTP response. (defalias 'lsp-cpp-flycheck-clang-tidy--narrow-to-http-body #[0 "\300 \210`d}\207" [lsp-cpp-flycheck-clang-tidy--skip-http-headers] 2 (#$ . 1916)]) #@61 Decode a region from START to END in UTF-8. (fn START END) (defalias 'lsp-cpp-flycheck-clang-tidy--decode-region-as-utf8 #[514 "\3001 \301\302#0\207\210\303\207" [(coding-system-error) decode-coding-region utf-8 nil] 6 (#$ . 2137)]) #@64 Remove carriage return and line feeds from the current buffer. (defalias 'lsp-cpp-flycheck-clang-tidy--remove-crlf #[0 "\212\300\301\302\303#\205\304\305\303\211#\210\202)\207" [re-search-forward " $" nil t replace-match ""] 4 (#$ . 2380)]) #@319 Extract the parts of the LLVM clang-tidy documentation that are relevant. This function assumes that the current buffer contains the result of browsing 'clang.llvm.org', as returned by `url-retrieve'. More concretely, this function returns the main
element with class 'section', and also removes 'headerlinks'. (defalias 'lsp-cpp-flycheck-clang-tidy--extract-relevant-doc-section #[0 "eb\210\300 \210\301ed\"\210\302 \210\303ed\"\304\305\"\304\306\"\211\203,\211@\307\"\210A\266\202\202\210\207" [lsp-cpp-flycheck-clang-tidy--narrow-to-http-body lsp-cpp-flycheck-clang-tidy--decode-region-as-utf8 lsp-cpp-flycheck-clang-tidy--remove-crlf libxml-parse-html-region dom-by-class "section" "headerlink" dom-remove-node] 7 (#$ . 2632)]) #@231 Explain an error in the Flycheck error explanation buffer using EXPLANATION. EXPLANATION is a function with optional ARGS that, when evaluated, inserts the content in the appropriate Flycheck buffer. (fn EXPLANATION &rest ARGS) (defalias 'lsp-cpp-flycheck-clang-tidy--explain-error #[385 "rq\210\303\211\304 \210\305\"\210eb+\207" [flycheck-explain-error-buffer inhibit-modification-hooks inhibit-read-only t erase-buffer apply] 5 (#$ . 3386)]) #@428 Show a loading string while clang-tidy documentation is fetched from llvm.org. Recent versions of `flycheck' call `display-message-or-buffer' to display error explanations. `display-message-or-buffer' displays the documentation string either in the echo area or in a separate window, depending on the string's height. This function forces to always display it in a separate window by appending the required number of newlines. (defalias 'lsp-cpp-flycheck-clang-tidy--show-loading-status #[0 "\302\203\303 !\203\304 _\202 \250\203 \202 \305\202 \305!\306T\307\"\310P\207" [resize-mini-windows max-mini-window-height round floatp frame-height 1 make-string 10 "Loading documentation..."] 4 (#$ . 3845)]) #@114 Show clang-tidy documentation about ERROR-ID. Information comes from the clang.llvm.org website. (fn ERROR-ID) (defalias 'lsp-cpp-flycheck-clang-tidy--show-documentation #[257 "\300\301\302\"\303\"\210\304 \207" [url-retrieve format "https://clang.llvm.org/extra/clang-tidy/checks/%s.html" #[257 "\300\301\"\211\203\302\303\304\305\306!\"\"\207\307 \302\310\"\207" [plist-get :error lsp-cpp-flycheck-clang-tidy--explain-error insert format "Error accessing clang-tidy documentation: %s" error-message-string lsp-cpp-flycheck-clang-tidy--extract-relevant-doc-section shr-insert-document] 8 "\n\n(fn STATUS)"] lsp-cpp-flycheck-clang-tidy--show-loading-status] 5 (#$ . 4568)]) #@81 Explain a clang-tidy ERROR by scraping documentation from llvm.org. (fn ERROR) (defalias 'lsp-cpp-flycheck-clang-tidy-error-explainer #[257 "\300\301!\204\n\302\303!\210\304!\211\203!\3051\306!0\207\307\310\311!\"\207\302\312!\207" [fboundp libxml-parse-html-region error "This function requires Emacs to be compiled with libxml2" flycheck-error-id (error) lsp-cpp-flycheck-clang-tidy--show-documentation format "Error accessing clang-tidy documentation: %s" error-message-string "The clang-tidy error message does not contain an [error-id]"] 7 (#$ . 5256)]) (byte-code "\300\301\302\303\304\305\306\307&\210\310\311\312\313\314DD\315\304\301\316\317\320\321& \207" [custom-declare-group lsp-clangd nil "LSP support for C-family languages (C, C++, Objective-C, Objective-C++), using clangd." :group lsp-mode :link (url-link "https://clang.llvm.org/extra/clangd") custom-declare-variable lsp-clients-clangd-executable funcall function #[0 "\300\207" [nil] 1] "The clangd executable to use.\nWhen `'non-nil' use the name of the clangd executable file\navailable in your path to use. Otherwise the system will try to\nfind a suitable one. Set this variable before loading lsp." :risky t :type (choice (file :tag "Path") (const :tag "Auto" nil))] 10) #@107 Clang default executable full path when found. This must be set only once after loading the clang client. (defvar lsp-clients--clangd-default-executable nil (#$ . 6519)) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313& \207" [custom-declare-variable lsp-clients-clangd-args funcall function #[0 "\300\207" [("--header-insertion-decorators=0")] 1] "Extra arguments for the clangd executable." :group lsp-clangd :risky t :type (repeat string)] 10) #@47 Generate the language server startup command. (defalias 'lsp-clients--clangd-command #[0 "\204\"\303\304!\206!\305\306\307\310\311\"\"\206!\312\313\314\315#\206!\312\316\317\315# \206+\206+\315\nB\207" [lsp-clients--clangd-default-executable lsp-clients-clangd-executable lsp-clients-clangd-args lsp-package-path clangd -first executable-find -map #[257 "\300P\207" ["clangd"] 3 "\n\n(fn VERSION)"] ("" "-12" "-11" "-10" "-9" "-8" "-7" "-6") lsp-clients-executable-find "xcodebuild" "-find-executable" "clangd" "xcrun" "--find"] 5 (#$ . 6986)]) (byte-code "\300\301\302\303\304!\305\306\307\310\311#\312\313\314\315\316\317&\n!\207" [lsp-register-client make-lsp-client :new-connection lsp-stdio-connection lsp-clients--clangd-command :activation-fn lsp-activate-on "c" "cpp" "objective-c" :priority -1 :server-id clangd :download-server-fn #[1028 "\300\301#\207" [lsp-package-ensure clangd] 8 "\n\n(fn CLIENT CALLBACK ERROR-CALLBACK UPDATE\\=\\?)"]] 12) #@144 Apply join-line from BEG to END. This function is useful when an indented function prototype needs to be shown in a single line. (fn BEG END) (defalias 'lsp-clangd-join-region #[514 "\212\300!b\210`W\203\301\302!\210\202\210\303\304 !)\207" [copy-marker join-line 1 s-trim buffer-string] 5 (#$ . 7960)]) (byte-code "\300\301\302\303\302\304%\210\300\305\302\306\302\307%\207" [cl-generic-define-method lsp-clients-extract-signature-on-hover nil (contents (_server-id (eql clangd))) #[514 "\300\301\302\"r\211q\210\303\304\"\216\305!\211c\210eb\210\306\307\310\302\310$\2033\311\224\311\225}\210\312\313\314\315\316\317ed\"$!\2029\320\312!!@\262*\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] lsp:markup-content-value re-search-forward "```cpp\n\\(//.*\n\\)?\\([^`]+\n\\)```" nil 2 lsp--render-element lsp-make-marked-string :language "cpp" :value lsp-clangd-join-region s-lines] 12 "Extract a representative line from clangd's CONTENTS, to show in the echo area.\nThis function tries to extract the type signature from CONTENTS,\nor the first line if it cannot do so. A single line is always\nreturned to avoid that the echo area grows uncomfortably.\n\n(fn CONTENTS SERVER-ID)"] lsp-diagnostics-flycheck-error-explainer (e (_server-id (eql clangd))) #[514 "\300!\301\230\203\f\302!\207\303!\207" [flycheck-error-group "clang-tidy" lsp-cpp-flycheck-clang-tidy-error-explainer flycheck-error-message] 4 "Explain a `flycheck-error' E that was generated by the Clangd language server.\n\n(fn E SERVER-ID)"]] 6) #@200 Switch between the corresponding C/C++ source and header file. If NEW-WINDOW (interactively the prefix argument) is non-nil, open in a new window. Only works with clangd. (fn &optional NEW-WINDOW) (defalias 'lsp-clangd-find-other-file #[256 "\300\301\302\303 \"!\304!\204\305\306!\210\203\307\202\310\311!!\207" [lsp-send-request lsp-make-request "textDocument/switchSourceHeader" lsp--text-document-identifier s-present\? user-error "Could not find other file" find-file-other-window find-file lsp--uri-to-path] 5 (#$ . 9565) "P"]) (defconst lsp-clangd-plist-value-when-compiled nil) (provide 'lsp-clangd)