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

Incorrect parsing of compilation-mode buffers, rust layer. #15643

Closed
wildwestrom opened this issue Jul 10, 2022 · 2 comments
Closed

Incorrect parsing of compilation-mode buffers, rust layer. #15643

wildwestrom opened this issue Jul 10, 2022 · 2 comments

Comments

@wildwestrom
Copy link
Contributor

wildwestrom commented Jul 10, 2022

Description :octocat:

The wrong parts of a compilation-mode buffer are parsed for certain messages.
This isn't just aesthetics. The part highlighted in red is supposed to be the file name. The part highlighted in blue is supposed to be the location in the file.
When I click on the file name, it thinks the red portion is a file, and therefore can't find it, because the actual file is (dirname/filename\.ext):\d+ not (dirname/filename\.ext:\d+).

Reproduction guide 🪲

  • Start Emacs
  • Open a scratch buffer
  • Paste the following text:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Could not get string from shell command.
             at src/main.rs:81:14

Caused by:
   0: Broken pipe (os error 32)
             at src/main.rs:79:14
      - Failed to write buffer to stdin', src/main.rs:412:28
  • M-x compilation-mode
  • Try opening the first or second highlighted file.

Observed behaviour: 👀 💔

Here's an example of what I see:
Image here:
image
Notice that highlighting starts at black at at then red at src/main.rs:81 then black at : then blue at 14. When I click on the first or second highlighted files, it tries to navigate to filename:linenumber then go to the column-number.
On a minimal configuration of GNU Emacs, I see this:
image
This indicates that something in spacemacs enhances compilation-mode. I have no idea what exactly does it or how to search for it.
A minimal config of spacemacs will yield the same result, until the rust layer is added.
image

Expected behaviour: ❤️ 😄

Same thing as above, except the text should be highlighted as follows.
Start red highlight at src/main.rs then black at : then blue after the first colon and navigate to the correct file and go to the correct line number.

System Info 💻

  • OS: gnu/linux
  • Emacs: 28.1.50
  • Spacemacs: 0.999.0
  • Spacemacs branch: develop (rev. 42b6ff3)
  • Graphic display: t
  • Running in daemon: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(better-defaults colors emoji theming
                 (unicode-fonts :variables unicode-fonts-ligature-modes
                                '(prog-mode))
                 spell-checking multiple-cursors
                 (helm :variables helm-follow-mode-persistent t)
                 (treemacs :variables treemacs-lock-width t treemacs-width 30 treemacs-indentation 1 treemacs-use-all-the-icons-theme t treemacs-space-between-root-nodes nil treemacs-use-scope-type 'Perspectives treemacs-use-filewatch-mode t treemacs-use-follow-mode t)
                 (spacemacs-layouts :variables spacemacs-layouts-restrict-spc-tab t persp-autokill-buffer-on-remove 'kill-weak)
                 command-log ansible
                 (c-c++ :variables c-c++-backend 'lsp-clangd c-c++-enable-clang-support t)
                 cmake meson
                 (clojure :variables clojure-enable-linters 'clj-kondo clojure-enable-clj-refactor t cider-repl-display-help-banner t cider-pprint-fn 'fipp clojure-indent-style 'align-arguments clojure-align-forms-automatically t clojure-toplevel-inside-comment-form t cider-result-overlay-position 'at-point cider-overlays-use-font-lock t cider-repl-buffer-size-limit 100 cider-eldoc-display-for-symbol-at-point nil)
                 emacs-lisp
                 (groovy :variables groovy-backend 'lsp groovy-lsp-jar-path "/usr/share/java/groovy-language-server/groovy-language-server-all.jar")
                 haskell java
                 (lua :variables lua-backend 'lua lua-lsp-server 'lua-language-server lsp-clients-lua-language-server-bin "/usr/lib/lua-language-server/bin/lua-language-server" lsp-clients-lua-language-server-main-location "/usr/lib/lua-language-server/bin/main.lua")
                 (rust :variables cargo-process--command-clippy--additional-args "-- -A clippy::all -W clippy::pedantic -W clippy::nursery -W clippy::cargo")
                 (shell-scripts :variables insert-shebang-track-ignored-filename nil shell-scripts-format-on-save t)
                 (sql :variables sql-backend 'lsp)
                 html
                 (javascript :variables javascript-fmt-tool 'prettier javascript-backend 'lsp)
                 typescript svelte elm purescript prettier asciidoc csv epub json
                 (latex :variables latex-build-command "LaTeX" latex-backend 'lsp latex-refresh-preview t)
                 (markdown :variables markdown-live-preview-engine 'vmd)
                 (org :variables org-clock-sound "~/emacs/spacemacs-config/bell.mp3" org-enable-github-support t org-enable-asciidoc-support t org-enable-bootstrap-support t org-enable-reveal-js-support t org-enable-roam-support t org-enable-roam-protocol t org-roam-directory "~/org/Notes" org-roam-dailies-directory "Journal" org-roam-v2-ack t org-want-todo-bindings t org-latex-classes
                      '("letter" "\\documentclass{letter}"
                        ("\\section{%s}" . "\\section*{%s}")
                        ("\\subsection{%s}" . "\\subsection*{%s}")
                        ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))
                 systemd yaml docker
                 (git :variables git-magit-status-fullscreen t magit-diff-refine-hunk t git-enable-magit-todos-plugin t)
                 (version-control :variables version-control-diff-tool 'diff-hl version-control-global-margin t)
                 (auto-completion :variables auto-completion-idle-delay nil auto-completion-enable-help-tooltip t auto-completion-enable-snippets-in-popup t auto-completion-enable-sort-by-usage t)
                 (syntax-checking :variables syntax-checking-use-original-bitmaps t)
                 (lsp :variables lsp-enable-on-type-formatting t lsp-enable-indentation t lsp-enable-snippet t lsp-enable-symbol-highlighting t lsp-modeline-diagnostics-enable nil lsp-modeline-diagnostics-scope :workspace lsp-modeline-code-actions-enable nil lsp-ui-doc-enable t lsp-ui-doc-show-with-cursor t lsp-ui-doc-show-with-mouse nil lsp-ui-doc-delay 1 lsp-ui-sideline-enable nil lsp-ui-sideline-show-code-actions nil lsp-ui-sideline-show-diagnostics nil lsp-lens-enable t lsp-file-watch-threshold 10000 lsp-idle-delay 5.0 lsp-log-io nil lsp-rust-server 'rust-analyzer cargo-process-reload-on-modify t)
                 graphviz
                 (shell :variables shell-default-shell 'vterm shell-default-term-shell "/bin/fish" shell-default-width 30 shell-default-position 'bottom terminal-here-terminal-command-table
                        (list
                         (cons 'alacritty
                               (list "alacritty"))
                         (cons 'foot
                               (list "foot"))
                         (cons 'footclient
                               (list "footclient")))
                        terminal-here-linux-terminal-command 'foot))
  • System configuration features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XIM XWIDGETS GTK3 ZLIB

Backtrace 🐾

<<BACKTRACE IF RELEVANT>>
@wildwestrom wildwestrom changed the title Incorrect parsing of compilation-mode buffers Incorrect parsing of compilation-mode buffers, rust layer. Jul 10, 2022
@wildwestrom
Copy link
Contributor Author

I have a good reason to believe this bug is upstream, but before closing this issue, I think it's worth waiting for a response from the people working on rust-mode via rust-lang/rust-mode#452.

@lebensterben
Copy link
Collaborator

not a bug. it jumps to the file and column correctly.

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

2 participants