;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\207" [require lsp-mode dash] 2) #@249 Turn docker URI into host path. Argument PATH-MAPPINGS dotted pair of (host-path . container-path). Argument DOCKER-CONTAINER-NAME name to use when running container. Argument URI the uri to translate. (fn PATH-MAPPINGS DOCKER-CONTAINER-NAME URI) (defalias 'lsp-docker--uri->path #[771 "\300!\301\302\303\"\"\211\2033\211A\262\242\211\203,\211\203$\304#\207\305\306#\207\305\306#\207\305\306#\207" [lsp--uri-to-path-1 -first make-closure #[257 "\211A\301\300\"\207" [V0 s-contains\?] 5 "\n\n(fn INPUT0)"] s-replace format "/docker:%s:%s"] 11 (#$ . 155)]) #@163 Turn host PATH into docker uri. Argument PATH-MAPPINGS dotted pair of (host-path . container-path). Argument PATH the path to translate. (fn PATH-MAPPINGS PATH) (defalias 'lsp-docker--path->uri #[514 "\300\301\302\303\"\"\211\2037\211A\262\242\211\203.\211\203$\304#\202)\305\306\"\262\2022\305\306\"\262\202;\305\306\"\262!\207" [lsp--path-to-uri-1 -first make-closure #[257 "\211\211A\262\242\301\302\300\"\207" [V0 nil s-contains\?] 7 "\n\n(fn INPUT0)"] s-replace user-error "The path %s is not under path mappings"] 10 (#$ . 741)]) #@47 Used to prevent collision of container names. (defvar lsp-docker-container-name-suffix 0 (#$ . 1309)) #@28 The docker command to use. (defvar lsp-docker-command "docker" (#$ . 1417)) #@407 Return the docker command to be executed on host. Argument DOCKER-CONTAINER-NAME name to use for container. Argument PATH-MAPPINGS dotted pair of (host-path . container-path). Argument DOCKER-IMAGE-ID the docker container to run language servers with. Argument SERVER-COMMAND the language server command to run inside the container. (fn DOCKER-CONTAINER-NAME PATH-MAPPINGS DOCKER-IMAGE-ID SERVER-COMMAND) (defalias 'lsp-docker-launch-new-container #[1028 "\301\302\303\304\305\306\307 \"\"&\211\262\305\"\207" [lsp-docker-command split-string format "%s run --name %s --rm -i %s %s %s" s-join " " -map #[257 "\211\211A\262\242\300\301#\207" [format "-v %s:%s"] 8 "\n\n(fn INPUT0)"]] 14 (#$ . 1500)]) #@231 Return command to exec into running container. Argument DOCKER-CONTAINER-NAME name of container to exec into. Argument SERVER-COMMAND the command to execute inside the running container. (fn DOCKER-CONTAINER-NAME SERVER-COMMAND) (defalias 'lsp-docker-exec-in-container #[514 "\300\301\302#!\207" [split-string format "docker exec -i %s %s"] 7 (#$ . 2223)]) #@170 Registers docker clients with lsp (fn &key SERVER-ID DOCKER-SERVER-ID PATH-MAPPINGS DOCKER-IMAGE-ID DOCKER-CONTAINER-NAME PRIORITY SERVER-COMMAND LAUNCH-SERVER-CMD-FN) (defalias 'lsp-docker-register-client #[128 "\302\303\"A@\302\304\"A@\302\305\"A@\302\306\"A@\302\307\"A@\302\310\"A@\302\311\"A@\302\312\"A@\313\314 \"!\211\203\250 \203W\315\316 \247\203R T\211\202S #\202X\211\317 I\266\211\320\321\322\f#I\266\211\323\321\324\f\"I\266\211\325\326\327\330\331\f\f &!\332\330\333\"#I\266\211\334\206\241\334HI\266\335!\207\336\337\n\"\207" [lsp-clients lsp-docker-container-name-suffix plist-member :server-id :docker-server-id :path-mappings :docker-image-id :docker-container-name :priority :server-command :launch-server-cmd-fn copy-lsp--client gethash format "%s-%d" 15 25 -partial lsp-docker--uri->path 24 lsp-docker--path->uri 3 plist-put lsp-stdio-connection make-closure #[0 "\303\206\305\304\300\301\302$\207" [V0 V1 V2 V3 V4 lsp-docker-launch-new-container] 5] :test\? #[128 "\301\302\300\"\207" [V0 -any\? #[257 "\211@\300\301 \"\207" [f-ancestor-of\? buffer-file-name] 5 "\n\n(fn INPUT0)"]] 4 "\n\n(fn &rest _)"] 14 lsp-register-client user-error "No such client %s"] 23 (#$ . 2590)]) #@42 Default list of client packages to load. (defvar lsp-docker-default-client-packages '(lsp-bash lsp-clangd lsp-css lsp-dockerfile lsp-go lsp-html lsp-javascript lsp-pyls) (#$ . 3852)) #@40 Default list of client configurations. (defvar lsp-docker-default-client-configs (byte-code "\300\301\302\303\304\305\257\300\306\302\307\304\310\257\300\311\302\312\304\313\257\300\314\302\315\304\316\257\300\317\302\320\304\321\257\300\322\302\323\304\324\257\300\325\302\326\304\327\257\300\330\302\331\304\332\257\257\207" [:server-id bash-ls :docker-server-id bashls-docker :server-command "bash-language-server start" clangd clangd-docker "ccls" css-ls cssls-docker "css-languageserver --stdio" dockerfile-ls dockerfilels-docker "docker-langserver --stdio" gopls gopls-docker "gopls" html-ls htmls-docker "html-languageserver --stdio" pyls pyls-docker "pyls" ts-ls tsls-docker "typescript-language-server --stdio"] 13) (#$ . 4041)) #@1951 Loads the required client packages and registers the required clients to run with docker. :path-mappings is an alist of local paths and their mountpoints in the docker container. Example: '(("/path/to/projects" . "/projects")) :docker-image-id is the identifier for the docker image to be used for all clients, as a string. :docker-container-name is the name to use for the container when it is started. :priority is the priority with which to register the docker clients with lsp. (See the library ‘lsp-clients’ for details.) :client-packages is a list of libraries to load before registering the clients. :client-configs is a list of configurations for the various clients you wish to use with ‘lsp-docker’. Each element takes the form '(:server-id 'example-ls :docker-server-id 'examplels-docker :docker-image-id "examplenamespace/examplels-docker:x.y" :docker-container-name "examplels-container" :server-command "run_example_ls.sh") where :server-id is the ID of the language server, as defined in the library ‘lsp-clients’. :docker-server-id is any arbitrary unique symbol used internally by ‘lsp’ to distinguish it from non-docker clients for the same server. :docker-image-id is an optional property to override this function's :docker-image-id argument for just this client. If you specify this, you MUST also specify :docker-container-name. :docker-container-name is an optional property to override this function's :docker-container-name argument for just this client. This MUST be specified if :docker-image-id is specified, but is otherwise optional. :server-command is a string specifying the command to run inside the docker container to run the language server. (fn &key PATH-MAPPINGS (DOCKER-IMAGE-ID "emacslsp/lsp-docker-langservers") (DOCKER-CONTAINER-NAME "lsp-container") (PRIORITY 10) (CLIENT-PACKAGES lsp-docker-default-client-packages) (CLIENT-CONFIGS lsp-docker-default-client-configs)) (defalias 'lsp-docker-init-clients #[128 "\302\303\"A@\302\304\"\206\305A@\302\306\"\206\307A@\302\310\"\206\"\311A@\302\312\"\206.\313DA@\302\314\"\206;\313 DA@\315\316\"\210\315\317\320\n%\"\207" [lsp-docker-default-client-packages lsp-docker-default-client-configs plist-member :path-mappings :docker-image-id (nil "emacslsp/lsp-docker-langservers") :docker-container-name (nil "lsp-container") :priority (nil 10) :client-packages nil :client-configs seq-do #[257 "\300\301\302#\207" [require nil t] 5 "\n\n(fn PACKAGE)"] make-closure #[257 "\304\305\"\304\306\"\304\307\"\304\310\"\304\311\"\203\"\204\"\312\313\"\210\314\305\315\301\306 \307\n\2062\302\310\f\203= \202>\303\311\f\316\300\317\320&\207" [V0 V1 V2 V3 plist-get :server-id :docker-server-id :docker-image-id :docker-container-name :server-command user-error "Invalid client definition for server ID %S. You must specify a container name when specifying an image ID." lsp-docker-register-client :priority :path-mappings :launch-server-cmd-fn lsp-docker-launch-new-container] 23 "\n\n(fn INPUT0)"]] 16 (#$ . 4796)]) (provide 'lsp-docker)