Skip to content

Incorrect parsing of compilation-mode buffers #452

Open
@wildwestrom

Description

@wildwestrom

Related to syl20bnr/spacemacs#15643

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.
I also found information dealing with compilation-mode in rust-compile.el therefore I assume this bug is in this package.
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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions