Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server doesn't work at all in Emacs 28.1 #2

Open
EmilyGraceSeville7cf opened this issue Aug 26, 2022 · 0 comments
Open

Server doesn't work at all in Emacs 28.1 #2

EmilyGraceSeville7cf opened this issue Aug 26, 2022 · 0 comments

Comments

@EmilyGraceSeville7cf
Copy link

EmilyGraceSeville7cf commented Aug 26, 2022

Steps to reproduce

  1. clone server repo
  2. built it and place pasls to ~/bin
  3. create test.pas
  4. open it
  5. obtain no completion for begin keyword and writeln when typing theme

Logs

*lsp-log*:

  1 Command "/usr/local/bin/bash-language-server start" is present on the path.                                                                    
  1 Command "/home/emilyseville7cfg/.emacs.d/.cache/lsp/npm/vscode-langservers-extracted/bin/vscode-json-language-server --stdio" is present on th\
    e path.                                                                                                                                        
  2 Command "/home/emilyseville7cfg/.emacs.d/.cache/lsp/npm/yaml-language-server/bin/yaml-language-server --stdio" is present on the path.         
  3 Command "~/bin/pasls" is present on the path.                                                                                                  
  4 Command "~/bin/pasls" is present on the path.                                                                                                  
  5 Found the following clients for /home/emilyseville7cfg/Documents/Mine/Pascal/test.pas: (server-id pasls, priority 0)                           
  6 The following clients were selected based on priority: (server-id pasls, priority 0)

*Messages*:

 20 ‘spacemacs-theme’ is already installed                                                                                                         
 19 ‘flycheck’ is already installed                                                                                                                
 18 ‘json-mode’ is already installed                                                                                                               
 17 ‘yaml-mode’ is already installed                                                                                                               
 16 ‘markdown-mode’ is already installed                                                                                                           
 15 ‘lsp-mode’ is already installed                                                                                                                
 14 ‘cmake-mode’ is already installed                                                                                                              
 13 ‘lsp-pyright’ is already installed                                                                                                             
 12 ‘lsp-java’ is already installed                                                                                                                
 11 ‘lsp-pascal’ is already installed                                                                                                              
 10 ‘format-all’ is already installed                                                                                                              
  9 ‘company’ is already installed                                                                                                                 
  8 [Treemacs] Warning: coudn’t find default background colour for icons, falling back on #2d2d31.                                                 
  7 Saving file /home/emilyseville7cfg/.emacs...                                                                                                   
  6 Wrote /home/emilyseville7cfg/.emacs                                                                                                            
  5 For information about GNU Emacs and the GNU system, type C-h C-a.                                                                              
  4 LSP :: Yasnippet is not installed, but `lsp-enable-snippet' is set to `t'. You must either install yasnippet, or disable snippet support.      
  3 LSP :: Connected to [pasls:23939/starting].                                                                                                    
  2 LSP :: pasls:23939 initialized successfully in folders: (/home/emilyseville7cfg/Documents/Mine/Pascal)                                         
  1 Auto-saving...done

Config

My ~/.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 '(spacemacs-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 cmake-mode lsp-pyright lsp-java lsp-pascal) "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 json-ls yamlls xmlls))
(dolist (server emacs-language-servers)
  (lsp-ensure-server server))

(defvar bookmark-save-flag 1)
(menu-bar-mode -1)
(load-theme 'spacemacs-light t)
(setq-default tab-width 4)
(setq-default display-line-numbers 'relative)
(setq-default lsp-modeline-code-actions-mode '(name count))
(setq-default lsp-pascal-command "~/bin/pasls")

(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 '(cmake-mode-hook
					 xml-mode-hook
					 json-mode-hook
					 yaml-mode-hook
					 shell-mode-hook
					 python-mode-hook
					 java-mode-hook
					 csharp-mode-hook
					 c++-mode-hook
					 pascal-mode-hook))
(dolist (hook emacs-hooks)
  (add-hook hook #'lsp))

(defvar format-all-formatters '(("XML" tidy)
								("JSON" prettier)
								("YAML" prettier)
								("Shell" shfmt)
								("Python" black)
								("Java" clang-format)
								("C#" clang-format)
								("C++" clang-format)
								("Cmake" cmake-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.
 '(custom-safe-themes
   '("fa2b58bb98b62c3b8cf3b6f02f058ef7827a8e497125de0254f56e373abee088" default))
 '(package-selected-packages
   '(spacemacs-theme lsp-java csharp-mode company lsp-pyright lsp-mode format-all yaml-mode json-mode markdown-mode flycheck)))
(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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant