From 61ed84be654a783f504e7083919ebdb76f035270 Mon Sep 17 00:00:00 2001 From: Benjamin Hipple Date: Mon, 2 Sep 2019 20:01:50 -0400 Subject: [PATCH] [python] Declare lsp layer dependency when python-backend is 'lsp Previously, if a user set `python-backend` to `'lsp`, it would not do anything unless the user also manually added the `lsp` layer to the spacemacs `init.el` file. This commit updates the `python` layer to correctly add the dependency when needed, like the `c-c++` layer does. --- CHANGELOG.develop | 4 ++-- layers/+lang/python/layers.el | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 layers/+lang/python/layers.el diff --git a/CHANGELOG.develop b/CHANGELOG.develop index 54fcce524..0cce0fc25 100644 --- a/CHANGELOG.develop +++ b/CHANGELOG.develop @@ -2257,8 +2257,8 @@ Other: - Added key binding ~SPC m r f~ to fix missing import statements (thanks to Volodymyr Vitvitskyi) - Use =python-mode= for SCons script files (thanks to shanemikel) -- Added LSP support, which can be used by enabling the =lsp= layer and setting - the =python= layer's =python-backend= variable to =lsp= +- Added LSP support, which can be enabled by setting the =python= layer's + =python-backend= variable to =lsp= (thanks to Yuan Fu and Sylvain Benner). - The LSP backend can use either the =pyls= (default) server or the =mspyls= (Microsoft) implementation, which may be selected by setting the diff --git a/layers/+lang/python/layers.el b/layers/+lang/python/layers.el new file mode 100644 index 000000000..0277c028b --- /dev/null +++ b/layers/+lang/python/layers.el @@ -0,0 +1,14 @@ +;;; layers.el --- Python Layer declarations File for Spacemacs +;; +;; Copyright (c) 2012-2019 Sylvain Benner & Contributors +;; +;; Author: Sylvain Benner +;; URL: https://github.com/syl20bnr/spacemacs +;; +;; This file is not part of GNU Emacs. +;; +;;; License: GPLv3 + +(when (and (boundp 'python-backend) + (eq python-backend 'lsp)) + (configuration-layer/declare-layer 'lsp))