Page MenuHomePhabricator

Autocompletion in code editor suggests keywords from wrong language when editing Scribunto module
Closed, InvalidPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Edit a Scribunto module
  • Start typing

What happens?:
Live autocompletion (enabled in T377663) suggests keywords based on all available programming languages, instead of just Scribunto keywords.

What should have happened instead?:
Live autocompletion only suggests local keywords or Scribunto-specific keywords

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
1.44.0-wmf.4 (a8dd895)

Other information (browser name/version, screenshots, etc.):
In this screenshot, typing "if" suggested "difftime" (C), "gcinfo" (java), and "getinfo" (any number of languages, but not Scribunto).

Screenshot 2024-11-22 100733.png (365×156 px, 6 KB)

Event Timeline

TheDJ closed this task as Invalid.EditedJan 7 2025, 1:27 PM
TheDJ subscribed.

No, these are all actual Lua keywords from the Lua stdlib

os.difftime: https://www.lua.org/manual/5.1/manual.html#pdf-os.difftime
gcinfo is from Lua 5.0 (or even earlier?)
and debug.getinfo is https://www.lua.org/manual/5.1/manual.html#pdf-debug.getinfo

These might not be available in the Wikimedia Scribunto environment, but they are part of the standard Lua libraries. Unfortunately the Lua highlighter of Ace doesn't know about classes (it doesn't know that difftime is only available inside of os.), but Lua I very loosely organised, so it is doesn't really pay off to add that level of detail to it either.