Visual Studio Code does this (see "File links"): <https://code.visualstudio.com/docs/terminal/basics#_links>
I don't think it works from the CLI: code <file>:5 doesn't do what's expected.
You have to use the `-g` command line option: `code -g <file>:<line>`
Thanks I didn't know this.
huge, tysm
Re:Compiler Errors for Humans (2015)
by oftenwrong on Thursday November 24, 2022 @02:42PM
(#33735413)
vim does:
vim file +5But compiler error messages are file:5 so this isn't good enough.
That's why you have `:make` which uses `errorfmt` to populate your quickfix list, which is covered in the help `:h make`
I'm not sure if you're joking or not but if you're not: I usually don't call the compiler from my vim session..
Right but if you want to edit and fix files that failed compilation, using `:make` and the quickfix list is the vim way of doing it
Re:Compiler Errors for Humans (2015)
by matsemann on Thursday November 24, 2022 @03:53PM
(#33736107)
JetBrains products do this for lots of stuff if you use the built in terminal to launch stuff or their runner.
> The editor should try to find if 'file:5' exist and open it if so, if it doesn't it should try to open 'foo' and then go to line 5.
Opening a file is often done in creation, and `file:5` is a perfectly valid filename, so it's a bit debatable for a default.
OTOH in Emacs you should be able to define a find-file-not-found-functions hook[0] and implement whatever fallback you want. I assume `emacs <file>` calls `find-file` after it's initialised the editor itself.
[0] https://www.gnu.org/software/emacs/manual/html_node/elisp/Vi...
> Opening a file is often done in creation, and `file:5` is a perfectly valid filename, so it's a bit debatable for a default
You're right, but even as an option I think it'd be nice.
> Opening a file is often done in creation, and `file:5` is a perfectly valid filename, so it's a bit debatable for a default.
It gets even more fun on Windows! Giving a filename of `foo:5` can result in a file called `foo` with an alternate datastream called `5`.
It works with kwrite/kate/kdevelop.
The editor should try to find if 'file:5' exist and open it if so, if it doesn't it should try to open 'foo' and then go to line 5.
Sounds sensible no? But I don't know any editor which does this.