about summary refs log tree commit diff
path: root/configs/shared/emacs/.emacs.d/elpa/lsp-python-20180816.1314/lsp-python.el
blob: fef5437ee156e2e1ea5079f5e273d9725cc6b746 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
;;; 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: 20180816.1314
;; Package-Requires: ((lsp-mode "3.0"))
;; Keywords: python
;; URL: https://github.com/emacs-lsp/lsp-python

;;; Code:
(require 'lsp-mode)
(require 'lsp-common)

(defcustom lsp-python-server-args
  '()
  "Extra arguments for the python-stdio language server"
  :group 'lsp-python
  :risky t
  :type '(repeat string))

(defun lsp-python--ls-command ()
  "Generate the language server startup command."
  `("pyls" ,@lsp-python-server-args))

(lsp-define-stdio-client lsp-python "python"
			 (lsp-make-traverser #'(lambda (dir)
						 (directory-files
						  dir
						  nil
              "setup.py\\|Pipfile\\|setup.cfg\\|tox.ini")))
                         nil
                         :command-fn 'lsp-python--ls-command)

(provide 'lsp-python)
;;; lsp-python.el ends here