Stream: zulip

Topic: Linkifier Rules


view this post on Zulip flip1995 (Apr 06 2021 at 11:22):

It seems, that recently something changed with the linkifier, since clippy#1234 does no longer work. This is probably because this rule:

(?P<repo>[a-zA-Z0-9_-]+)#(?P<id>[0-9]+)

has precedence over the clippy rule. Writing rust-clippy#1234 still works as expected.

Can the Clippy rule (clippy#(?P<id>[0-9]+)) get moved up in precedence over the general repo-rule? If not, that should also be ok and we just have to get used to it.

view this post on Zulip davidtwco (Apr 06 2021 at 11:29):

I don't think there is a way to adjust the precedence of the linkifier rules, they're sorted alphabetically (by pattern) in the org settings and presumably that's the order they're checked.

view this post on Zulip pnkfelix (May 05 2021 at 18:31):

Hmm, I wonder if there’s a way to hack the pattern so that it still matches the same expressions, but comes earlier in the alphabetical ordering...

view this post on Zulip Tavian Barnes (May 10 2021 at 14:15):

I think you could add an optional impossible group like ($0001)? at the start of every pattern

view this post on Zulip Laurențiu (Sep 06 2021 at 15:09):

Can we please have a ra linkifier (same as rust-analyzer, but less annoying to type?

view this post on Zulip flip1995 (Sep 06 2021 at 15:25):

As mentioned above, this may not be possible, since it may conflict with the general rule:

(?P<repo>[a-zA-Z0-9_-]+)#(?P<id>[0-9]+) https://github.com/rust-lang/%(repo)s/issues/%(id)s

We have this problem with Clippy: clippy#7640 doesn't work, since the general rule takes precedence, so you have to write rust-clippy#7640, even though there exists a linkifier rule.

Test: does rust-analyzer#10166 work?

EDIT: It does, and so does clippy#7640. So it appears that this was a bug. Nevermind me then :)


Last updated: Oct 11 2021 at 22:34 UTC