Skip to content

🚀 Feature: Message URLs can't be cmd/ctrl-clicked in VS Code #39

Open
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

VS Code by default turns auto-detectable file path indicators in terminals into cmd/ctrl-clickable links to open the file in the editor. If there's a line:col indicator or similar it'll pick that up too. The detection by default picks up ESLint's default stylish reporter.

Typically, the whole ESLint message turns into a clickable link:

VS Code terminal showing underline around all of an ESLint stylish report: '/Users/josh/repos/mocha/docs/_data/usage.js \n 3:19  error  "strip-ansi" should be replaced with an alternative package. Read more here: https://github.com/es-tooling/module-replacements/blob/main/docs/modules/strip-ansi.md  depend/ban-dependencies'

Unfortunately, that means the GitHub link to the module's .md file isn't itself clickable. You have to manually select it. Irksome!

You can get around this by putting a \n in the report message, like:

VS Code terminal showing underline only under the Markdown URL of a now split-into-lines ESLint stylish report: '/Users/josh/repos/mocha/docs/_data/usage.js \n 3:19  error  "strip-ansi" should be replaced with an alternative package.\nRead more here: https://github.com/es-tooling/module-replacements/blob/main/docs/modules/strip-ansi.md  depend/ban-dependencies'

Personally, I think this is an issue for VS Code that it should respect the URL without \n trickery. But I figured I'd raise here and see what you think 🙂. Someone should probably search for / file an issue on VS Code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions