;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302\303\304#\210\300\305\303\304#\210\300\306!\210\300\307!\210\300\310\303\304#\210\300\311\303\304#\210\312\313\303\314\315\307\316\317&\210\320\321\322\323\324DD\325\326\327\315\313&\210\320\330\322\323\331DD\332\326\333\315\313&\210\320\334\322\323\335DD\336\326\337\315\313&\210\320\340\322\323\341DD\342\326\343\315\313&\210\344\340!\210\320\345\322\323\346DD\347\326\350\315\313&\210\320\351\322\323\352DD\353\326\333\315\313&\210\320\354\322\323\355DD\356\326\357\315\313&\210\320\360\322\323\361DD\362\326\333\315\313&\210\320\363\322\323\364DD\365\326\350\315\313&\210\320\366\322\323\367DD\370\326\333\315\313&\210\320\371\322\323\372DD\373\326\374\315\313&\210\320\375\322\323\376DD\377\326\343\315\313&\210\320\201@\322\323\201ADD\201B\326\343\315\313&\210\320\201C\322\323\201DDD\201E\326\343\315\313&\210\320\201F\322\323\201GDD\201H\326\343\315\313&\210\320\201I\322\323\201JDD\201K\326\333\315\313&\210\320\201L\322\323\201MDD\201N\326\350\315\313&\210\320\201O\322\323\201PDD\201Q\326\350\315\313\201R\201S\201T\201U\201V\201W\257& \210\320\201X\322\323\201YDD\201Z\326\201[\315\313&\207" [require cl-lib conda nil noerror find-file-in-project json lsp-mode projectile project custom-declare-group lsp-python-ms "LSP support for python using the Microsoft Python Language Server." :group :link (url-link "https://github.com/Microsoft/python-language-server") custom-declare-variable lsp-python-ms-dir funcall function #[0 "\301\302\"\207" [lsp-server-install-dir f-join "mspyls/"] 3] "The directory of the Microsoft Python Language Server." :type directory lsp-python-ms-guess-env #[0 "\300\207" [t] 1] "Should the language server guess the paths.\n\nIf true, check for pyenv environment/version files, then conda\nenvironment files, then project-local virtual environments, then\nfall back to the python on the head of PATH. Otherwise, just use\nthe python on the head of PATH." boolean lsp-python-ms-python-executable #[0 "\300\207" [nil] 1] "Path to specify the Python executable for the Microsoft Python Language Server." (choice (const :tag "None" nil) file) lsp-python-ms-extra-paths #[0 "\300\207" [#4=[]] 1] "A list of additional paths to search for python packages.\n\nThis should be a list of paths corresponding to additional python\nlibrary directories you want to search for completions. Paths\nshould be as they are (or would appear) in sys.path. Paths will\nbe prepended to the search path, and so will shadow duplicate\nnames in search paths returned by the interpreter." lsp-string-vector make-variable-buffer-local lsp-python-ms-python-executable-cmd #[0 "\300\207" [#1="python"] 1 #1#] "Command to specify the Python command for the Microsoft Python Language Server.\n\nSimilar to the `python-shell-interpreter', but used only with mspyls.\nUseful when there are multiple python versions in system.\ne.g, there are `python2' and `python3', both in system PATH,\nand the default `python' links to python2,\nset as `python3' to let ms-pyls use python 3 environments." string lsp-python-ms-prefer-remote-env #[0 "\300\207" [t] 1] "If Non-nil, will prefer remote python environment.\nOnly available in Emacs 27 and above." lsp-python-ms-executable #[0 "\302 \303=\203\f\304\202 \305Q\207" [lsp-python-ms-dir system-type "Microsoft.Python.LanguageServer" windows-nt ".exe" ""] 4] "Path to the Microsoft Python LanguageServer binary." (file :must-match t) lsp-python-ms-auto-install-server #[0 "\300\207" [t] 1] "Install Microsoft Python Language Server automatically." lsp-python-ms-nupkg-channel #[0 "\300\207" [#2="stable"] 1 #2#] "The channel of nupkg for the Microsoft Python Language Server:\nstable, beta or daily." lsp-python-ms-completion-add-brackets #[0 "\300\207" [t] 1] "Whether to add brackets after completion of functions." lsp-python-ms-cache #[0 "\300\207" [#3="None"] 1 #3#] "The cache level of analysis for Microsoft Python Language Server." (choice (const "None") (const "System") (const "Library")) lsp-python-ms-errors #[0 "\300\207" [["unknown-parameter-name" "undefined-variable" "parameter-missing" "positional-argument-after-keyword" "too-many-function-arguments"]] 1] "Microsoft Python Language Server Error types." lsp-python-ms-warnings #[0 "\300\207" [["unresolved-import" "parameter-already-specified" "too-many-positional-arguments-before-star"]] 1] "Microsoft Python Language Server Warning types." lsp-python-ms-information #[0 "\300\207" [#4#] 1] "Microsoft Python Language Server Information types." lsp-python-ms-disabled #[0 "\300\207" [#4#] 1] "Microsoft Python Language Server Disabled types." lsp-python-ms-parse-dot-env-enabled #[0 "\300\207" [t] 1] "Automatically parse .env file in the project root if non-nil." lsp-python-ms-base-url #[0 "\300\207" [#5="https://pvsc.blob.core.windows.net"] 1 #5#] "The base url to get nupkg package.\nThe alternative is `https://pvsc.azureedge.net'." lsp-python-ms-log-level #[0 "\300\207" [#6="Error"] 1 #6#] "Log Level definition." :options "Trace" "Info" "Information" "Error" "Warning" lsp-python-ms-extra-major-modes #[0 "\300\207" [nil] 1] "A list of additional major modes in which to activate.\n\nIn addition to the `python-mode', you may wish the Microsoft Python\nLanguage Server to activate in other major modes. If so, list them\nhere." list] 14) #@98 Get the nupkg url through CHANNEL from Microsoft Python Language Server. (fn &optional CHANNEL) (defalias 'lsp-python-ms-latest-nupkg-url #[256 "\211\206\302\211\303\235\204\304\305\"\210r\306\307\310 \311\267\202(\312\202,\313\202,\314\202,\304\315 \"$!q\210eb\210\316\317!\210\320`d\"\211:\205I\211\242\211:\205G\211\242\211\321=\205E\243\211:\205C\211\242\211:\205A\211\242\211:\205?\211\242\211\322=\205=\243\211?\205;\243\211:\2059\211\242\211:\2057\211\242\211\323=\2055\243\211:\2053\211\242\211?\2051\243\211:\205/\211\243\211?\205-\243\211:\205+\211\242\211:\205)\211\242\211\324=\205'\243\211:\205%\211\242\211?\205#\243\243\211:\205!\211\242\211:\205\211\242\211\325=\205\243\211:\205\211\242\211?\205\243\211?\205\243\211?\205\243\211?\205\326\327\330\"\331\"@A\262\262\262\262\262\262\262\262\266\202\262\262\262\262\262\262\262\262\262\262\262\262\262\262\262\262\262\262\262\262)\207" [lsp-python-ms-base-url system-type "stable" ("stable" "beta" "daily") user-error "Unknown channel: %s" url-retrieve-synchronously format "%s/python-language-server-%s?restype=container&comp=list&prefix=Python-Language-Server-%s-x64" #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (darwin 28 gnu/linux 32 windows-nt 36)) "osx" "linux" "win" "Unsupported system: %s" re-search-forward "\n\n" xml-parse-region EnumerationResults ContainerName Prefix Blobs NextMarker sort mapcar #[257 "\211:\205,\211\242\211\300=\205*\243\211:\205(\211\242\211?\205&\243\211:\205$\211\242\211:\205\"\211\242\211\301=\205 \243\211:\205\211\242\211?\205\243\211:\205\211\243\211?\205\243\211:\205\211\242\211:\205\211\242\211\302=\205\243\211:\205\211\242\211?\205\243\211:\205\f\211\242\243\211?\205\n\243\211:\205\211\242\211:\205\211\242\211\303=\205\243\211:\205\211\242\211?\205\243\211:\205\376\211\242\211:\205\374\211\242\211\304=\205\372\243\211:\205\370\211\242\211?\205\366\243\211:\205\364\211\242\243\211?\205\362\f\243\211?\205\360\305\306\307!\"B\266\202\262\266\202\262\262\262\262\262\262\262\262\262\262\262\266\202\262\262\262\262\262\262\262\262\262\262\262\262\262\262\262\262\207" [Blob Name Url Properties Last-Modified apply encode-time parse-time-string] 39 "\n\n(fn BLOB)"] #[514 "\300@@\"\207" [time-less-p] 5 "\n\n(fn T1 T2)"]] 36 (#$ . 5443)]) #@117 Downloading Microsoft Python Language Server to the specified path. (fn CLIENT CALLBACK ERROR-CALLBACK UPDATE\=\?) (defalias 'lsp-python-ms--install-server #[1028 "\211?\205\303!?\205O\304\305\306\307#\310 !\311\312!\203#\313\314$\2026\311\315!\2031\313\316#\2026\317\320#\321\322!\210\323\324\n!\325\326  &\"\266\203\207" [lsp-python-ms-executable lsp-python-ms-dir lsp-python-ms-nupkg-channel f-exists\? make-temp-file "mspyls" nil ".zip" expand-file-name executable-find "unzip" format "mkdir -p %s && unzip -qq %s -d %s" "powershell" "powershell -noprofile -noninteractive -nologo -ex bypass Expand-Archive -path '%s' -dest '%s'" user-error "Unable to extract '%s' to '%s'! Please check unzip, powershell or extract manually." lsp--info "Downloading Microsoft Python Language Server..." url-retrieve lsp-python-ms-latest-nupkg-url make-closure #[257 "\306\307!\210\310\311`d\302#\210)\312\313!\210\312\314!\210\315\303\316\"\210\317\320\321\300\"\301\322\323!\203*\324\202+\325\322\323!\2035\326\2026\327\304%\207" [V0 V1 V2 V3 V4 coding-system-for-write re-search-forward " ?\n ?\n" binary write-region lsp--info "Downloading Microsoft Python Language Server...done" "Extracting Microsoft Python Language Server..." f-delete t lsp-async-start-process make-closure #[0 "\303 !\203\304\305!\210\306 \307\"\210\n\203\310 \210\300 \207" [V0 lsp-python-ms-executable lsp-mode f-exists\? lsp--info "Extracting Microsoft Python Language Server...done" chmod 493 lsp] 3] executable-find "unzip" "sh" "cmd" "-c" "/c"] 7 "\n\n(fn DATA)"]] 16 (#$ . 7931)]) #@161 Update Microsoft Python Language Server. On Windows, if the server is running, the updating will fail. After stopping or killing the process, retry to update. (defalias 'lsp-python-ms-update-server #[0 "\300\301\302\303\304$\207" [lsp-python-ms--install-server nil ignore lsp--error t] 5 (#$ . 9527) nil]) #@57 Check if the directory contains a virtualenv. (fn DIR) (defalias 'lsp-python-ms--venv-dir #[257 "\211\205\300!\301\302\"@\207" [f-directories seq-filter lsp-python-ms--venv-python] 5 (#$ . 9840)]) #@49 Check if a directory is a virtualenv. (fn DIR) (defalias 'lsp-python-ms--venv-python #[257 "\300\301\"\211\205\f\300\302\"\211\205%\303!\203\202%\303!\203$\211\202%\304\211\205:\305!\211\306\307!\230\2067\211\310\230?\262\211\205?\207" [f-expand "bin/python" "bin/python3" f-executable\? nil f-parent expand-file-name "~" "/"] 8 (#$ . 10048)]) #@64 Look for directories that look like venvs. (fn &optional DIR) (defalias 'lsp-python-ms--dominating-venv-python #[256 "\301\206\302\"\206\303\301\206\303\"!\211\205\302!\207" [default-directory locate-dominating-file lsp-python-ms--venv-python lsp-python-ms--venv-dir] 5 (#$ . 10417)]) #@58 Locate dominating conda environment. (fn &optional DIR) (defalias 'lsp-python-ms--dominating-conda-python #[256 "\211\206\211\205\n\304\211\205\305\306\307\"\"\211\205\310\311\"@\211\2055\312\313!\2055\314\301!\2032 \2065\313!\211\205D\315\316\n!\315 \317!\"\"\207" [default-directory conda-env-current-name lsp-python-ms-python-executable-cmd conda-env-executables-dir ("environment.yml" "environment.yaml" "env.yml" "env.yaml" "dev-environment.yml" "dev-environment.yaml") seq-map make-closure #[257 "\301\300\"\205\302\301\300\"\"\207" [V0 locate-dominating-file expand-file-name] 6 "\n\n(fn FILE)"] seq-filter #[257 "\207" [] 2 "\n\n(fn FILE)"] fboundp conda--get-name-from-env-yml boundp expand-file-name file-name-nondirectory conda-env-name-to-dir] 12 (#$ . 10722)]) #@61 Locate dominating pyenv-managed python. (fn &optional DIR) (defalias 'lsp-python-ms--dominating-pyenv-python #[256 "\211\206\301\302\"\205\303\304\305!!\207" [default-directory locate-dominating-file ".python-version" string-trim shell-command-to-string "pyenv which python"] 5 (#$ . 11526)]) #@59 Locate dominating asdf-managed python (fn &optional DIR) (defalias 'lsp-python-ms--dominating-asdf-python #[256 "\211\206\301\302\"\205\303\304\305!!\207" [default-directory locate-dominating-file ".tool-versions" string-trim shell-command-to-string "asdf which python"] 5 (#$ . 11832)]) #@13 (fn PATH) (defalias 'lsp-python-ms--valid-python #[257 "\211\205 \300!\205 \211\207" [f-executable\?] 3 (#$ . 12133)]) #@75 Look for virtual environments local to the workspace. (fn &optional DIR) (defalias 'lsp-python-ms-locate-python #[256 "\305!\306!\307!\310!\311Y\203\312 \n\"\202\312 ! \203F\313\f!\206M\313!\206M\313!\206M\313!\206M\313!\206M\313!\206M\314\207\313!\206M\314\207" [emacs-major-version lsp-python-ms-python-executable-cmd lsp-python-ms-prefer-remote-env lsp-python-ms-guess-env lsp-python-ms-python-executable lsp-python-ms--dominating-pyenv-python lsp-python-ms--dominating-asdf-python lsp-python-ms--dominating-venv-python lsp-python-ms--dominating-conda-python 27 executable-find lsp-python-ms--valid-python nil] 8 (#$ . 12263)]) #@215 Return list with pyver-string and list of python search paths. The WORKSPACE-ROOT will be prepended to the list of python search paths and then the entire list will be json-encoded. (fn &optional WORKSPACE-ROOT) (defalias 'lsp-python-ms--get-python-ver-and-syspath #[256 "\304 \211\205 \206 \305\211\205\211\211\205\306\211\205\307\211\205#\310\311Q\211\205(\312\211\205-\313\211\205r\314\315\316\"r\211q\210\317\320\"\216\321\322\316\322\323     \260&\210\324\325\326\327 \330!\331\332\"\331\333\"\331\334\"E+\266\202*\262)\207" [default-directory json-array-type json-key-type json-object-type lsp-python-ms-locate-python "." "from __future__ import print_function; import sys; sys.path = list(filter(lambda p: p != '', sys.path)); import json;" "v=(\"%s.%s\" % (sys.version_info[0], sys.version_info[1]));" "sys.path.insert(0, '" "'); p=sys.path;" "e=sys.executable;" "print(json.dumps({\"version\":v,\"paths\":p,\"executable\":e}))" generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] call-process nil "-c" vector string hash-table buffer-string json-read-from-string gethash "version" "paths" "executable"] 21 (#$ . 12925)]) #@227 Get the path of the root of the current workspace. Use `lsp-workspace-root', which is pressent in the "new" lsp-mode and works when there's an active session. Next try ffip or projectile, or just return `default-directory'. (defalias 'lsp-python-ms--workspace-root #[0 "\301\302!\203 \302 \207\301\303!\203\303 \207\301\304!\203\304 \207\301\305!\2038\305 \211\2057\301\306!\2033\306!\2066\307!@\207\207" [default-directory fboundp lsp-workspace-root ffip-get-project-root-directory projectile-project-root project-current project-root project-roots] 3 (#$ . 14157)]) #@273 Return form describing parameters for language server. Old lsp will pass in a WORKSPACE, new lsp has a global lsp-workspace-root function that finds the current buffer's workspace root. If nothing works, default to the current file's directory (fn &optional WORKSPACE) (defalias 'lsp-python-ms--extra-init-params #[256 "\211\203\n\211\305H\202\f\306 \206 \203\307!\210\310!\211A\262\242\211A\262\242\242\311\312\313\314\315\316 \257D\317\320\321\322\n\"\323\315\324\315\325 \326\327\330\331\f\332\"!!\257\207" [default-directory lsp-python-ms-parse-dot-env-enabled lsp-python-ms-extra-paths lsp-python-ms-log-level lsp-python-ms-dir 4 lsp-python-ms--workspace-root lsp-python-ms--parse-dot-env lsp-python-ms--get-python-ver-and-syspath :interpreter :properties :InterpreterPath :UseDefaultDatabase t :Version :displayOptions (:preferredFormat "markdown" :trimDocumentationLines :json-false :maxDocumentationLineLength 0 :trimDocumentationText :json-false :maxDocumentationTextLength 0) :searchPaths vconcat :analysisUpdates :asyncStartup :logLevel :typeStubSearchPaths vector expand-file-name f-join "Typeshed"] 24 (#$ . 14746)]) #@42 Filter nbsp entities from STR. (fn STR) (defalias 'lsp-python-ms--filter-nbsp #[257 "\301\302=\203\n\303\262\205\304\305#\207" [system-type " " windows-nt " \\| " replace-regexp-in-string " "] 6 (#$ . 15905)]) #@131 Set environment variable (default PYTHONPATH) from .env file if this file exists in the project root. (fn ROOT &optional ENVVAR) (defalias 'lsp-python-ms--parse-dot-env #[513 "\211\206\300\301\302!\303\"\304\305Q\306\307!\205[\310!\205[\311!\205[\312\313\314\"r\211q\210\315\316\"\216\317!\210\320ed#\210\321\322P\323 \"\205X\324\325\323 \"\262\211\326\230\262?\205X\327\"*\262\207" ["PYTHONPATH" f-join file-name-as-directory ".env" "^[:blank:]*" "[:blank:]*=[:blank:]*" nil f-exists\? f-file\? f-readable\? generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents keep-lines string-match "\\(.*\\)" buffer-string match-string 1 "" setenv] 11 (#$ . 16141)]) #@132 Handle the python/languageServerStarted message. WORKSPACE is just used for logging and _PARAMS is unused. (fn WORKSPACE PARAMS) (defalias 'lsp-python-ms--language-server-started-callback #[514 "\300\301!\207" [lsp--info "Microsoft Python language server started"] 4 (#$ . 16906)]) (byte-code "\301\302\303\304\301#\210\302\305\304\301#\207" [lsp-render-markdown-markup-content lsp-python-ms--filter-nbsp advice-add lsp-ui-doc--extract :filter-return lsp-ui-sideline--format-info] 4) #@50 Log progress information. (fn WORKSPACE PARAMS) (defalias 'lsp-python-ms--report-progress-callback #[514 "\300!\205\211G\301V\205\302\301H!\207" [arrayp 0 lsp-log] 5 (#$ . 17399)]) #@26 (fn WORKSPACE &rest _) (defalias 'lsp-python-ms--begin-progress-callback #[385 "\301H\302\303\211\203,\211A\262\242\262\262T\262\304!\203rq\210\305 \210)\202\266)\306\307!\207" [lsp--cur-workspace 9 0 nil buffer-live-p lsp--spinner-start lsp--info "Microsoft Python language server is analyzing..."] 8 (#$ . 17593)]) #@26 (fn WORKSPACE &rest _) (defalias 'lsp-python-ms--end-progress-callback #[385 "\301H\302\303\211\203,\211A\262\242\262\262T\262\304!\203rq\210\305 \210)\202\266\306\307!)\207" [lsp--cur-workspace 9 0 nil buffer-live-p lsp--spinner-stop lsp--info "Microsoft Python language server is analyzing...done"] 8 (#$ . 17937)]) (byte-code "\301\302!\210\211\203\211@\303\304\305B\"\210A\266\202\202\210\306\307\310\311\312\313\"\314\315\316\"\317\320\321\322\323\324\325\326\327\330\"\331\332\333#\210\331\334\335#\210\331\336\337#\210\331\340\341#\210\331\342\343#\210\211\262\344\345\346\347&!\210\350\351!\207" [lsp-python-ms-extra-major-modes lsp-register-custom-settings (("python.autoComplete.addBrackets" lsp-python-ms-completion-add-brackets t) ("python.analysis.cachingLevel" lsp-python-ms-cache) ("python.analysis.errors" lsp-python-ms-errors) ("python.analysis.warnings" lsp-python-ms-warnings) ("python.analysis.information" lsp-python-ms-information) ("python.analysis.disabled" lsp-python-ms-disabled) ("python.analysis.autoSearchPaths" (lambda nil (<= (length lsp-python-ms-extra-paths) 0)) t) ("python.autoComplete.extraPaths" lsp-python-ms-extra-paths)) add-to-list lsp-language-id-configuration "python" lsp-register-client make-lsp-client :new-connection lsp-stdio-connection #[0 "\207" [lsp-python-ms-executable] 1] #[0 "\301!\207" [lsp-python-ms-executable f-exists\?] 2] :major-modes append (python-mode) :server-id mspyls :priority 1 :initialization-options lsp-python-ms--extra-init-params :notification-handlers make-hash-table :test equal puthash "python/languageServerStarted" lsp-python-ms--language-server-started-callback "telemetry/event" ignore "python/reportProgress" lsp-python-ms--report-progress-callback "python/beginProgress" lsp-python-ms--begin-progress-callback "python/endProgress" lsp-python-ms--end-progress-callback :initialized-fn #[257 "\211\301\302\303!!)\207" [lsp--cur-workspace lsp--set-configuration lsp-configuration-section "python"] 4 "\n\n(fn WORKSPACE)"] :download-server-fn #[1028 "\205\n\301$\207" [lsp-python-ms-auto-install-server lsp-python-ms--install-server] 9 "\n\n(fn CLIENT CALLBACK ERROR-CALLBACK UPDATE\\=\\?)"] provide lsp-python-ms] 18)