Page MenuHomePhabricator

Links to line anchors of modules in Scribunto error popup do not jump to line of that Module's source code
Open, Needs TriagePublicBUG REPORT

Description

Scribunto error messages in English Wiktionary have a popup that appears when you click them. The popup contains more information on the error. Sometimes this involves a traceback.

When the traceback mentions a line in a Lua module on the wiki, it links to the module, with a link fragment containing the line number; for instance, currently in this edit, #mw-ce-l174 where 174 is the line of the module mentioned in that line of the traceback. If you click the link in the traceback, which takes you to the module, the fragment has no effect. This seems to happen whether or not CodeEditor is enabled.

Formerly, when you got to the module page, the textbox would be focused and the cursor would be placed at the beginning of the line mentioned in the link fragment. This was very helpful because you would be able to see the line mentioned without having to scroll down in the textbox or use the "jump to line" feature.

I don't recall exactly when this changed, but a year or more ago.

Event Timeline

Erutuon created this task.Sat, Oct 5, 9:04 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSat, Oct 5, 9:04 PM
Erutuon updated the task description. (Show Details)Sat, Oct 5, 9:06 PM
Erutuon updated the task description. (Show Details)Mon, Oct 7, 1:42 AM

@Erutuon: Please provide a link that allows others to reproduce the problem. Thanks.

Erutuon updated the task description. (Show Details)Mon, Oct 7, 8:59 AM

@Erutuon: Please provide a link that allows others to reproduce the problem. Thanks.

Added a link to https://en.wiktionary.org/wiki/Special:Permalink/54825976.

Aklapper renamed this task from Links to lines of modules in Scribunto error popup do not work to Links to line anchors of modules in Scribunto error popup only jump to top of that Module's source code.Mon, Oct 7, 9:55 AM
Anomie added a subscriber: Anomie.

Without CodeEditor, there's probably no good way to make the anchor work. JS to do that seems outside the scope of Scribunto.

With CodeEditor, it looks like there's currently a race where WikiEditor is triggering the "doneInitialSections" event before CodeEditor registers for it, so CodeEditor never manages to register its hashchange listener.

Erutuon renamed this task from Links to line anchors of modules in Scribunto error popup only jump to top of that Module's source code to Links to line anchors of modules in Scribunto error popup do not jump to line of that Module's source code.Mon, Oct 7, 4:39 PM

I renamed the task because for me, and presumably for others, the link doesn't jump to the top of the source code either. Perhaps something in my settings prevents the link from going to the top of the source code.