python language server
This commit is contained in:
parent
7846f42a8a
commit
b41cd1d3e2
@ -29,3 +29,9 @@
|
|||||||
(defvar lsp-ui-sideline-enable t "Enable/disable lsp-ui-sideline overlay")
|
(defvar lsp-ui-sideline-enable t "Enable/disable lsp-ui-sideline overlay")
|
||||||
(defvar lsp-ui-sideline-show-symbol nil "When non-nil, sideline includes symbol info (largely redundant for c modes)") ; don't show symbol on the right of info
|
(defvar lsp-ui-sideline-show-symbol nil "When non-nil, sideline includes symbol info (largely redundant for c modes)") ; don't show symbol on the right of info
|
||||||
(defvar lsp-ui-sideline-ignore-duplicate t "Ignore duplicates")
|
(defvar lsp-ui-sideline-ignore-duplicate t "Ignore duplicates")
|
||||||
|
|
||||||
|
(defvar mypyls "/Users/rshen/anaconda2/envs/tensorflow/bin/pyls"
|
||||||
|
"The executable file for python language server")
|
||||||
|
|
||||||
|
(defvar mypyls-project-root (getenv "HOME")
|
||||||
|
"Root directory of python projects")
|
||||||
|
|||||||
@ -0,0 +1,22 @@
|
|||||||
|
;;; lsp-python.el --- Python support for lsp-mode -*- lexical-binding: t -*-
|
||||||
|
|
||||||
|
;; Copyright (C) 2017 Vibhav Pant <vibhavp@gmail.com>
|
||||||
|
|
||||||
|
;; Author: Vibhav Pant <vibhavp@gmail.com>
|
||||||
|
;; Version: 1.0
|
||||||
|
;; Package-Version: 20180404.819
|
||||||
|
;; Package-Requires: ((lsp-mode "3.0"))
|
||||||
|
;; Keywords: python
|
||||||
|
;; URL: https://github.com/emacs-lsp/lsp-python
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
(require 'lsp-mode)
|
||||||
|
(require 'lsp-common)
|
||||||
|
|
||||||
|
(lsp-define-stdio-client lsp-python "python"
|
||||||
|
(lambda ()
|
||||||
|
mypyls-project-root)
|
||||||
|
(list mypyls "-v" ))
|
||||||
|
|
||||||
|
(provide 'lsp-python)
|
||||||
|
;;; lsp-python.el ends here
|
||||||
@ -37,6 +37,7 @@
|
|||||||
lsp-ui
|
lsp-ui
|
||||||
(lsp-imenu :requires imenu :location built-in)
|
(lsp-imenu :requires imenu :location built-in)
|
||||||
(lsp-ui-imenu :requires lsp-imenu :location built-in)
|
(lsp-ui-imenu :requires lsp-imenu :location built-in)
|
||||||
|
(lsp-python :requires lsp-mode :location local)
|
||||||
)
|
)
|
||||||
"The list of Lisp packages required by the mycquery layer.
|
"The list of Lisp packages required by the mycquery layer.
|
||||||
|
|
||||||
@ -138,4 +139,17 @@
|
|||||||
:defer t
|
:defer t
|
||||||
:config (evil-make-overriding-map lsp-ui-imenu-mode-map)))
|
:config (evil-make-overriding-map lsp-ui-imenu-mode-map)))
|
||||||
|
|
||||||
|
(defun mycquery/python-enable ()
|
||||||
|
(lsp-python-enable)
|
||||||
|
)
|
||||||
|
|
||||||
|
(defun mycquery/init-lsp-python ()
|
||||||
|
(use-package lsp-python
|
||||||
|
:defer t
|
||||||
|
:commands lsp-python-enable
|
||||||
|
:init (progn
|
||||||
|
(add-hook 'python-mode-hook #'mycquery/python-enable))))
|
||||||
|
|
||||||
|
(defun mycquery/post-init-lsp-python ()
|
||||||
|
t)
|
||||||
;;; packages.el ends here
|
;;; packages.el ends here
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user