Skip to content

LSP is reinstalled even when UPDATE? is nil #3692

@EmilyGraceSeville7cf

Description

@EmilyGraceSeville7cf

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

When I open any file Emacs shows message for csharp-ls LSP even I told it not to reinstall ((lsp-install-server nil server)) LSP:

image

Steps to reproduce

  1. Open any file with my ~/.emacs config

Expected behavior

No reinstallation occured when UPDATE? is nil.

Which Language Server did you use?

csharp-ls

OS

Linux

Error callstack

No response

Anything else?

~/.emacs:

;;; .emacs --- My custom .emacs config.
;;; Commentary:
;;; Installs different packages for code linting and formatting to enable user feel Emacs like an IDE.
;;; Code:

(require 'package)
(require 'lsp-mode)

(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)

(defvar emacs-themes '(soft-stone-theme) "Themes installed as packages.")
(defvar emacs-linters '(flycheck json-mode yaml-mode markdown-mode) "Code linters installed as packages.")
(defvar emacs-language-servers '(lsp-mode lsp-pyright lsp-java) "Language servers installed as packages.")
(defvar emacs-formatters '(format-all) "Code formatters installed as packages.")
(defvar emacs-other '(company) "Other packages installed as packages.")

(defvar emacs-packages (append emacs-themes emacs-linters emacs-language-servers emacs-formatters emacs-other))
(dolist (package emacs-packages)
  (package-install package))

(setq emacs-language-servers '(bash-ls csharp-ls))
(dolist (server emacs-language-servers)
  (lsp-install-server nil server)) ; Reinstallation occures even when UPDATE? is nil

(defvar bookmark-save-flag 1)
(load-theme 'soft-stone t)
(setq-default tab-width 4)
(setq-default display-line-numbers 'relative)
(add-hook 'prog-mode-hook #'flycheck-mode)
(add-hook 'prog-mode-hook #'company-mode)
(add-hook 'prog-mode-hook #'format-all-mode)
(defvar emacs-hooks '(shell-mode-hook python-mode-hook java-mode-hook csharp-mode-hook c++-mode-hook))
(dolist (hook emacs-hooks)
  (add-hook hook #'lsp))
(defvar format-all-formatters '(("JSON" prettier)
				("YAML" prettier)
				("Shell" shfmt)
				("Python" black)
				("Java" clang-format)
				("C#" clang-format)))

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages
   '(lsp-java csharp-mode company lsp-pyright lsp-mode format-all yaml-mode json-mode markdown-mode flycheck soft-stone-theme)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

(provide '.emacs)
;;; .emacs ends here

lsp-log:

Command "/usr/local/bin/bash-language-server start" is present on the path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions