Page MenuHomePhabricator

Allow using namespace aliases in link autocompleting
Open, Needs TriagePublicBUG REPORT

Description

When inserting transclusions or links, using namespace aliases (i.e. WP for Wikipedia) causes the autocomplete not to work, with no links appearing. For example, typing "[[Wikipedia:Abou]]" will cause "[[Wikipedia:About]]" to appear, but "[[WP:Abou]]" will not. The issue is the same with transclusions (outside of the Template namespace).

Event Timeline

Hi @Axolitl, and welcome to Phabricator! There are multiple ways to get link autocomplete in DiscussionTools, which use different pieces of software. To find out which one you’re complaining about, can you describe a bit more precisely where you experience the issue?

  • In visual or source mode?
  • Do you click a toolbar button, or just type in the [[ signs?

A screenshot would also be helpful (you can use the upload button on the Phabricator toolbar), although not required.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Aug 2 2026, 5:22 PM

For future reference, please use the feature request form (linked from the top of the task creation page) to create feature requests, and fill in all the sections in the template. Thanks.

For future reference, please use the feature request form (linked from the top of the task creation page) to create feature requests, and fill in all the sections in the template. Thanks.

Okay, my bad. I had thought this was a bug since it seems like it would be normal behavior to have it included.

Tacsipacsi changed the subtype of this task from "Feature Request" to "Bug Report".Aug 2 2026, 7:39 PM

I’d also call this a bug (though a borderline one, which is not far from a feature request), but bugs also have their own form, which is also linked from the top of the task creation page, so using the generic form wasn’t appropriate in that case either.

@Axolitl, could you please answer the questions I asked in T433767#12176530? Thanks in advance!

Hi @Axolitl, and welcome to Phabricator! There are multiple ways to get link autocomplete in DiscussionTools, which use different pieces of software. To find out which one you’re complaining about, can you describe a bit more precisely where you experience the issue?

  • In visual or source mode?
  • Do you click a toolbar button, or just type in the [[ signs?

A screenshot would also be helpful (you can use the upload button on the Phabricator toolbar), although not required.

This issue arose in source when typing [[ and {{ in wikitext. Happened on mobile and desktop.

I’d also call this a bug (though a borderline one, which is not far from a feature request), but bugs also have their own form, which is also linked from the top of the task creation page, so using the generic form wasn’t appropriate in that case either.

Yeah, I realized that after reporting it. I just found the link to this Phabricator project on the MediaWiki extension page, and didn't see the "bug report form" button.

I think the remaining unmerged patch on T432400 will probably do this. It'd make anything that work in the insert-a-link inspector work in the autocomplete, rather than just whatever happens to work via the opensearch API.

I think the remaining unmerged patch on T432400 will probably do this. It'd make anything that work in the insert-a-link inspector work in the autocomplete, rather than just whatever happens to work via the opensearch API.

Would this also allow autocompleting templates after typing subst: and safesubst:?

@Axolitl Sort of! It's currently going to cope okay with the searching part, but it throws away the subst: when you actually choose a result. Not ideal, I'll get a fix for it.

You can try the current version on testwiki: https://test.wikipedia.org/w/index.php?title=Page342&veaction=editsource

Back to the original issue of namespace aliases,

  • Regular links ([[) work, replacing the alias with the canonical namespace. This is a matter of taste, but if the user started typing [[WP:RQ, I think it’s more appropriate to expand it to [[WP:RQ]] than to [[Wikipedia:RQ]]. (This is even more problematic when the namespace is gendered. I can’t test this on testwiki, since the user namespace is not gendered in English, but I guess it would also override Benutzer: to Benutzerin: or vice versa.) Would it be difficult to respect the namespace alias the user started to type?
  • Template links ({{) with namespace prefix don’t work at all, neither canonical nor alias namespaces.

Change #1321195 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/VisualEditor@master] MWTemplateCompletionAction: search past the subst: magic word

https://gerrit.wikimedia.org/r/1321195

Change #1321196 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/VisualEditor@master] MWTemplateCompletionAction: use the namespace from the input

https://gerrit.wikimedia.org/r/1321196

Change #1321197 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/VisualEditor@master] MWTitleCompletionAction: search past a leading colon

https://gerrit.wikimedia.org/r/1321197

Change #1321198 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/VisualEditor@master] MWTitleCompletionAction: keep a namespace prefix as it was typed

https://gerrit.wikimedia.org/r/1321198

Change #1321199 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/VisualEditor@master] MWTemplateCompletionAction: keep a typed Template prefix

https://gerrit.wikimedia.org/r/1321199

Change #1321195 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] MWTemplateCompletionAction: search past the subst: magic word

https://gerrit.wikimedia.org/r/1321195

Change #1321196 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] MWTemplateCompletionAction: use the namespace from the input

https://gerrit.wikimedia.org/r/1321196

Change #1321197 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] MWTitleCompletionAction: search past a leading colon

https://gerrit.wikimedia.org/r/1321197

Change #1321198 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] MWTitleCompletionAction: keep a namespace prefix as it was typed

https://gerrit.wikimedia.org/r/1321198

Change #1321199 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] MWTemplateCompletionAction: keep a typed Template prefix

https://gerrit.wikimedia.org/r/1321199