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

[low-prio] Warning (lsp-mode): Unknown notification: semgrep/rulesRefreshed #16405

Closed
stradicat opened this issue May 17, 2024 · 3 comments
Closed

Comments

@stradicat
Copy link
Contributor

Description :octocat:

lsp-backed programming files trigger an Warning (lsp-mode): Unknown notification: semgrep/rulesRefreshed message

Reproduction guide 🪲

  • Have any programming language layer activated with lsp as backend
  • Start Emacs
  • Open a file with code backed by lsp

Observed behaviour: 👀 💔
The Emacs window is split in half, in a C-x-2 fashion, with the lower window showing the *Warnings* buffer with the following message:

Warning (lsp-mode): Unknown notification: semgrep/rulesRefreshed

Expected behaviour: ❤️ 😄
No window-splitting, with the message showing up in *Warnings*, or perhaps in the modeline.

System Info 💻

  • OS: darwin
  • Emacs: 29.3
  • Spacemacs: 0.999.0
  • Spacemacs branch: develop (rev. 287acfa)
  • Graphic display: t
  • Running in daemon: nil
  • Distribution: spacemacs
  • Editing style: hybrid
  • Completion: helm
  • Layers:
(asm
 (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++-lsp-enable-semantic-highlight 'rainbow)
 (dart :variables dart-backend 'lsp lsp-dart-sdk-dir "/Users/dmayr/flutter/bin/cache/dart-sdk")
 emacs-lisp
 (go :variables go-backend 'lsp go-dap-mode 'dap-go 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-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-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-backend 'lsp ruby-enable-enh-ruby-mode t ruby-version-manager 'rbenv)
 (rust :variables rust-backend 'lsp)
 (sql :variables sql-capitalize-keywords t sql-lsp-sqls-workspace-config-path 'workspace)
 swift toml
 (typescript :variables typescript-backend 'lsp 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)
 (yaml :variables)
 (auto-completion :variables auto-completion-enable-help-tooltip t auto-completion-enable-snippets-in-popup t auto-completion-enable-sort-by-usage t auto-completion-use-company-posframe t)
 better-defaults chrome dtrt-indent
 (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 llm-client
 (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 28 shell-default-position 'bottom shell-default-shell 'vterm shell-default-term-shell "/usr/local/bin/zsh" spacemacs-vterm-history-file-location "$HOME/.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 NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS ZLIB
@fnussbaum
Copy link
Contributor

Warning (lsp-mode): Unknown notification: semgrep/rulesRefreshed

Expected behaviour: ❤️ 😄 No window-splitting, with the message showing up in *Warnings*, or perhaps in the modeline.

I do not know anything about this warning in particular (and I do not observe it on my system), but the expected behaviour of not popping up the warnings buffer could be achieved for all warnings by setting minimum-warning-level to :error. The option warning-suppress-types might provide more granular control.

@stradicat
Copy link
Contributor Author

minimum-warning-level did the trick.

I had been looking for such an option for a couple of weeks now, can't believe it was this obvious!

Thanks for the heads-up! The annoyance is gone.

@pivaldi
Copy link

pivaldi commented Sep 10, 2024

This code works but skip ALL lsp-mode warning :

(add-to-list 'warning-suppress-log-types '(lsp-mode))
(add-to-list 'warning-suppress-types '(lsp-mode))

So I create an advise to filter the Emacs warning by string regexp

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

3 participants