跳至主要内容

博文

目前显示的是 九月, 2020的博文

find pylance directory

So your pylance upgrade very often? init snap here to rescue. ( defun find-pylance () ( let* ((vscode-extensions-directory (expand-file-name ".vscode/extensions" (getenv "UserProfile" ))) (pylance-directory (car (seq-filter ( lambda (elt) (string-match-p ".*pylance.*" elt)) (directory-files vscode-extensions-directory))))) (concat (file-name-as-directory vscode-extensions-directory) (file-name-as-directory pylance-directory) "dist/server.bundle.js" ))) (add-to-list 'eglot-server-programs `(python-mode . ( "node" ,(find-pylance) "--stdio" ))) (add-hook 'python-mode-hook 'eglot-ensure)