spacemacs icon indicating copy to clipboard operation
spacemacs copied to clipboard

LSP + Rust layer: no syntax check, `rust-analyzer` loaded but inactive

Open stradicat opened this issue 1 year ago • 1 comments

Description :octocat:

LSP + Rust layer: no syntax check, rust-analyzer loaded but inactive. Running lsp-rust-analyzer-run ends up in error:

Timeout while waiting for response. Method: experimental/runnables

When trying to switch the Rust backend with SPC m s s, the following warning shows up right at SPC m s:

which-key: there are no keys to show

Other LSP-enabled layers such as javascript, c-c++ and go are working without problems after this week's updates.

Could this be related ot the helm-descbinds vs which-key problem arised during the past few days?

Reproduction guide :beetle:

  • Start Emacs with the rust and lsp layers enabled
  • Run lsp-install-server, then choose rust-analyzer
  • Once downloaded, open a .rs Rust project file or create some short Rust code, such as
fn main() {
    println!("Hello world!");
}
  • Try to add a new line, like println!("Testing");. Begin typing println!, wait for autocompletion to kick-in.

Observed behaviour: :eyes: :broken_heart:

  • Autocompletion doesn't kick-in, syntax-check not working via LSP.

Expected behaviour: :heart: :smile:

  • Autocompletion suggesting cariables and methods, syntax-check pointing out errors and missing element.

System Info :computer:

  • OS: darwin
  • Emacs: 29.2
  • Spacemacs: 0.999.0
  • Spacemacs branch: develop (rev. 4a227fc94)
  • Graphic display: t
  • Running in daemon: nil
  • Distribution: spacemacs
  • Editing style: hybrid
  • Completion: helm
  • Layers:
((c-c++ :variables c-c++-adopt-subprojects t c-c++-backend 'lsp-clangd c-c++-dap-adapters
        '(dap-lldb dap-gdb-lldb dap-cpptools)
        c-c++-enable-clang-format-on-save t)
 csv
 (dart :variables dart-backend 'lsp lsp-dart-sdk-dir "/Users/dmayr/flutter/bin/cache/dart-sdk" lsp-enable-on-type-formatting t)
 emacs-lisp
 (go :variables go-backend 'lsp go-dap-mode 'dap-go go-format-before-save t go-use-golangci-lint t go-use-test-args "-race -timeout 10s" godoc-at-point-function 'godoc-gogetdoc gofmt-command "gofumpt")
 (html :variables web-fmt-tool 'prettier)
 (java :variables java-backend 'lsp)
 (javascript :variables javascript-backend 'lsp javascript-fmt-on-save t javascript-fmt-tool 'prettier javascript-import-tool 'import-js javascript-lsp-linter nil js2-mode-show-parse-errors nil js2-mode-show-strict-warnings nil js-indent-level 4 js2-basic-offset 4 js2-include-node-externs t)
 (json :variables json-fmt-on-save t json-fmt-tool 'prettier)
 (kotlin :variables kotlin-backend 'lsp)
 major-modes
 (php :variables php-backend 'ac-php-core)
 protobuf
 (python :variables python-backend 'lsp python-lsp-server 'pyright python-test-runner
         '(pytest nose))
 (ruby :variables ruby-enable-enh-ruby-mode t ruby-version-manager 'rbenv)
 (rust :variables rust-backend 'lsp rustic-format-on-save t)
 (sql :variables sql-capitalize-keywords t sql-lsp-sqls-workspace-config-path 'workspace)
 swift
 (typescript :variables typescript-backend 'lsp typescript-fmt-on-save t typescript-fmt-tool 'prettier typescript-lsp-linter nil)
 (zig :variables zls-backend 'lsp)
 react
 (svelte :variables svelte-backend 'lsp)
 (vue :variables vue-backend 'lsp)
 ansible apache graphql markdown nginx
 (shell-scripts :variables shell-scripts-backend 'lsp shell-scripts-format-on-save t)
 (yaml :variables yaml-enable-lsp t)
 (auto-completion :variables auto-completion-enable-help-tooltip t auto-completion-enable-snippets-in-popup t auto-completion-enable-sort-by-usage t)
 better-defaults chrome
 (geolocation :variables geolocation-enable-automatic-theme-changer t geolocation-enable-location-service t)
 (helm :variables spacemacs-helm-rg-max-column-number 1024)
 helpful
 (ibuffer :variables ibuffer-group-buffers-by 'projects)
 imenu-list
 (lsp :variables lsp-lens-enable t lsp-ui-remap-xref-keybindings t lsp-ui-sideline-show-symbol t)
 multiple-cursors nav-flash
 (org :variables org-enable-appear-support t org-enable-asciidoc-support t org-enable-bootstrap-support t org-enable-github-support t org-enable-hugo-support t org-enable-jira-support t org-enable-org-journal-support t org-enable-valign t org-journal-dir "/Users/dmayr/Documents/org-journal" org-todo-dependencies-strategy 'naive-auto)
 (osx :variables osx-command-as 'super osx-control-as 'control osx-function-as 'none osx-option-as 'meta osx-right-command-as 'control osx-right-control-as 'control osx-right-option-as 'none osx-swap-option-and-command nil)
 pdf
 (shell :variables close-window-with-terminal t multi-term-program "/usr/local/bin/zsh" shell-default-height 30 shell-default-position 'bottom shell-default-shell 'vterm shell-default-term-shell "/usr/local/bin/zsh" spacemacs-vterm-history-file-location "~/.zsh_history")
 (spell-checking :variables enable-flyspell-auto-completion t spell-checking-enable-auto-dictionary t spell-checking-enable-by-default nil)
 (treemacs :variables treemacs-use-all-the-icons-theme t treemacs-use-collapse-dirs 3 treemacs-use-git-mode 'deferred treemacs-use-scope-type 'Perspectives)
 (unicode-fonts :variables unicode-fonts-force-multi-color-on-mac t)
 (cmake :variables cmake-backend 'lsp cmake-enable-cmake-ide-support t)
 colors dap debug
 (docker :variables docker-dockerfile-backend 'lsp)
 (git :variables git-enable-magit-delta-plugin t git-enable-magit-gitflow-plugin t git-enable-magit-svn-plugin t git-enable-magit-todos-plugin t)
 gtags import-js openai pandoc prettier quickurl
 (syntax-checking :variables syntax-checking-auto-hide-tooltips 3)
 templates
 (version-control :variables version-control-diff-tool 'diff-hl)
 (xclipboard :variables xclipboard-enable-cliphist t))
  • System configuration features: ACL GIF GLIB GMP GNUTLS IMAGEMAGICK JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS ZLIB

stradicat avatar Feb 18 '24 19:02 stradicat

Enabling lsp-io-mode and reloading the Rust file shows the following warning:

Suspicious state from syntax checker rustic-clippy: Flycheck checker rustic-clippy returned 101, but its output contained no errors: error: could not find 'Cargo.toml' in '/Users/my_user/Documents/project_directory' or any parent directory

This hasn't happened before when opening Rust files in their own directories.

stradicat avatar Feb 18 '24 20:02 stradicat

After the last lsp-mode update, it seems to be working again. Closing.

stradicat avatar Feb 21 '24 16:02 stradicat