;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\305\306\307\"\210\310\311\312\313\314DD\315\316\317\320\321\322\323& \210\310\324\312\313\325DD\326\322\327\316\317&\210\310\330\312\313\331DD\332\322\333\316\317&\210\310\334\312\313\335DD\336\322\337\316\317&\210\310\340\312\313\341DD\342\322\343\316\317&\210\310\344\312\313\345DD\346\322\347\316\317&\210\310\350\312\313\351DD\352\322\353\316\317&\207" [require cc-mode lsp-mode json s defalias lsp-javacomp-enable lsp custom-declare-variable lsp-javacomp-server-install-dir funcall function #[0 "\300\301!\207" [locate-user-emacs-file "javacomp/"] 2] "Install directory for JavaComp server.\nRequires to be ended with a slash." :group lsp-javacomp :risky t :type directory lsp-javacomp-java-executable #[0 "\300\207" [#1="java"] 1 #1#] "Name or path of the java executable binary file." (choice (const nil) string) lsp-javacomp-java-options #[0 "\300\207" [nil] 1] "List of command line options to be pased to java command." (set string) lsp-javacomp-server-log-level #[0 "\300\207" [nil] 1] "Server log level.\nThis option sets the value of the logLevel initialization option.\nPossible values are \"severe\", \"warning\", \"info\", \"fine\",\n\"finer\", \"finest\". If it's set to nil, the option is not sent\nto the server." (choice (const nil) (const "severe") (const "warning") (const "info") (const "fine") (const "finer") (const "finest")) lsp-javacomp-server-log-path #[0 "\300\207" [nil] 1] "Server log path.\nThis option sets the value of the logPath initialization option." (choice (const nil) string) lsp-javacomp-server-ignore-paths #[0 "\300\207" [nil] 1] "A list of string paths to be ignored by the server.\nThis option sets the value of the ignorePaths initialization option." (repeat string) lsp-javacomp-server-type-index-files #[0 "\300\207" [nil] 1] "A list of string paths of the type index files.\nThis option sets the value of the typeIndexFiles initialization option." (repeat string)] 10) #@56 URL to retrieve the latest release of JavaComp server. (defconst lsp-javacomp-latest-release-url "https://api.github.com/repos/tigersoldier/JavaComp/releases/latest" (#$ . 2078)) #@50 Return the path to the JavaComp server JAR file. (defalias 'lsp-javacomp--server-jar-path #[0 "\301\302\"\207" [lsp-javacomp-server-install-dir expand-file-name "javacomp.jar"] 3 (#$ . 2263)]) #@75 Return a list of the command and arguments to launch the JavaComp server. (defalias 'lsp-javacomp--command #[0 "\302 \303\304 D\"B\207" [lsp-javacomp-java-executable lsp-javacomp-java-options append "-jar" lsp-javacomp--server-jar-path] 5 (#$ . 2463)]) #@95 Retrieves the root directory of the java project root based on some well-known project files. (defalias 'lsp-javacomp--suggest-root #[0 "\301=\205\302\303\304\"\211\205\305!\262\262\207" [major-mode java-mode ("javacomp.json" "pom.xml" "build.gradle" ".project" "WORKSPACE") seq-some #[257 "\301\"\207" [default-directory locate-dominating-file] 4 "\n\n(fn FILE)"] expand-file-name] 4 (#$ . 2723)]) #@89 Get prefix for completion. Return a cons of (start . end) for the bound of the prefix. (defalias 'lsp-javacomp--get-prefix #[0 "\300\301!\211\203\f\211@\206 `\203A\206`W\203)\302f\303\"\203)T\262B\207" [bounds-of-thing-at-point symbol char-equal 64] 6 (#$ . 3139)]) #@32 Return initialization options. (defalias 'lsp-javacomp--get-init-params #[0 "\304\305 \306\n\307 \257\207" [lsp-javacomp-server-log-path lsp-javacomp-server-log-level lsp-javacomp-server-ignore-paths lsp-javacomp-server-type-index-files :logPath :logLevel :ignorePths :typeIndexFiles] 8 (#$ . 3429)]) #@175 Download the JavaComp server JAR file if it does not exist. If PROMPT-EXISTS is non-nil, show a message if the server jar file already exists. (fn &optional PROMPT-EXISTS) (defalias 'lsp-javacomp-install-server #[256 "\300 \301!\203\205\302\303!\207\304 \207" [lsp-javacomp--server-jar-path file-exists-p message "JavaComp server already exists." lsp-javacomp--download-server] 4 (#$ . 3739) '(t)]) #@49 Update JavaComp jar file to the latest version. (defalias 'lsp-javacomp-update-server #[0 "\300 \207" [lsp-javacomp--download-server] 1 (#$ . 4152) nil]) #@36 Download latest JavaComp jar file. (defalias 'lsp-javacomp--download-server #[0 "\301\302!\210\303\304\"\207" [lsp-javacomp-latest-release-url message "Getting the latest JavaComp server..." url-retrieve lsp-javacomp--latest-release-callback] 3 (#$ . 4312)]) #@196 Handle the `url-retrive' callback for JavaComp latest release request. STATS is passed by `url-retrieve'. See https://developer.github.com/v3/repos/releases/#get-the-latest-release (fn STATS) (defalias 'lsp-javacomp--latest-release-callback #[257 "\301\302!\210\303\304\"\211\203\305\306@\"\207\307 \310\311\"\312\313\"\310\314\"\310\315\"\203;\316\317\"\210\320\321!\322\"\210\323\324 \322#\207\305\325!\207" [lsp-javacomp-server-install-dir search-forward "\n\n" plist-get :error error "Failed to get the latest release of JavaComp server: %s" json-read alist-get assets seq-find #[257 "\300\301\302\303\"\"\207" [s-match "^javacomp.*\\.jar$" alist-get name] 6 "\n\n(fn ASSET)"] browser_download_url tag_name message "Found JavaComp %s, downloading..." make-directory expand-file-name t url-copy-file lsp-javacomp--server-jar-path "Fail to get the URL of the JavaComp server"] 11 (#$ . 4579)]) (defalias 'lsp-javacomp-document-content #[0 "\300\301\302\303\304 D\"!\305\306\"\307\310!r\211q\210\311 \210c\210\312 \210)\313\314\"\207" [lsp-send-request lsp-make-request "$JavaComp/documentContent" :uri lsp--buffer-uri gethash "snapshotContent" get-buffer-create "*JavaComp document content*" erase-buffer java-mode display-buffer-use-some-window nil] 6 nil nil]) (byte-code "\300\301\302\303#\210\304\305\306\307\310!\311\312\313\314\315\316\317\320\321\322\323\316&!\210\324\325!\207" [advice-add lsp--suggest-project-root :before-until lsp-javacomp--suggest-root lsp-register-client make-lsp-client :new-connection lsp-stdio-connection lsp-javacomp--command :major-modes (java-mode) :server-id javacomp :multi-root nil :initialization-options lsp-javacomp--get-init-params :ignore-regexps ("^SLF4J: " "^Listening for transport dt_socket at address: ") :library-folders-fn provide lsp-javacomp] 16)