CodeEditor should offer autocompletions like any other IDE or code editor tool.
The Ace editor used by CodeEditor supports live autocompletions behind a config flag.
| SD0001 | |
| Oct 19 2024, 8:12 PM |
| F57733139: Screenshot 2024-11-22 100733.png | |
| Nov 22 2024, 3:11 PM |
| F57729440: firefox_q95nGrlwWv.png | |
| Nov 21 2024, 3:06 PM |
CodeEditor should offer autocompletions like any other IDE or code editor tool.
The Ace editor used by CodeEditor supports live autocompletions behind a config flag.
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| Enable live autocompletion in CodeEditor | mediawiki/extensions/CodeEditor | master | +1 -0 |
Change #1081516 had a related patch set uploaded (by SD0001; author: SD0001):
[mediawiki/extensions/CodeEditor@master] Enable live autocompletion in CodeEditor
It's a universal feature of code editors. I don't think a toggle button is necessary here. Adding user preferences for everything is not sustainable. Besides, there's no easily recognisable icon for autocompletion.
Well, I know how to turn it on yet I haven't because I find it distracting. I just use Ctrl+Space if I want it.
It's a universal feature of code editors.
I can't think of a webpage with a code editor where autocompletion is on by default.
there's no easily recognisable icon for autocompletion
I think the lightbulb is pretty good.
Adding user preferences for everything is not sustainable
Then maybe implement T261118 first?
Change #1081516 merged by jenkins-bot:
[mediawiki/extensions/CodeEditor@master] Enable live autocompletion in CodeEditor
Seems worthy of a User-notice, for future reference :)
It's worth noting that a few of the concerns here such as the inability to toggle autocompletion off, as well as T261118 will be resolved with T373711: Add support for Scribunto, JavaScript, CSS, JSON and Vue to CodeMirror 6. CodeMirror for non-wikitext is likely still months away from going live, but I thought I'd give a heads up anyway.
This is really annoying and I need a way to turn it off. I can't write code while things are popping up all the time, hijacking keys and covering other parts of the code.
What's not a universal feature of code editors is mandatory autocomplete that recommends keywords from other programming languages. When I'm editing a Lua module, the editor should not be suggesting keywords from C and java:
How the heck is an end user supposed to figure that out without coming here and somehow finding this ticket? Why is there a hidden preferences menu hidden behind an unintuitive and undocumented keyboard shortcut instead of something standard like a gear icon? It's not like there's a lack of space on the toolbar for the code editor, which currently only has six buttons.
https://en.wikipedia.org/wiki/User:Nardog/CodeEditorAssist should probably just be added into CodeEditor directly.
I will include it in Tech News as this (unless anyone suggests something better in the next couple of hours):
The CodeEditor, which can be used in JavaScript, CSS, JSON, and Lua pages, now offers live autocompletions. Thanks to SD0001 for this improvement. The feature can be temporarily disabled by clicking Ctrl+, and un-selecting "Live Autocompletion".
Unfortunately, this setting appears to be temporary (it does not persist through a page-reload). [Edit: Ah, but the script bd808 links to, appears to solve that too]
I was pleasantly surprised to see this - it's particularly helpful for the global reminder bot as I can easily check whether I've already added a wiki at https://meta.wikimedia.org/wiki/Global_reminder_bot/global (i.e, to prevent duplicates).
Was this fixed? Because I cannot do it since on macOS Safari since Command + [ , ] opens the Safari settings menu. (See T400569),
Also, if not implemented, consider MediaWIki:Accessibility guide for developers, and W3C ARIA APG § Developing a Keyboard Interface. Is this something to discuss at phab:Accessibility?
@Waddie96 Are you trying to enable or disable autocompletion? This task was closed as resolved because it was turned on by default.
For what it's worth, I've completely stopped working on user scripts, gadgets, CSS, templatestyles, modules - anything that uses this editor - because of this. I used to be by far the most active interface admin on Wikidata too.
Well, to toggle it on/off, didn't see above that it's now on my default. How can that be?
A change in default like that i.m.o. needs community consensus, because why would everyone want something on by default that is in the way, however, the right decisions for editors isn't always what the coder knows through their own experience...
I suggest we put the current state to a discussion on Extension talk:CodeEditor, and invite participation at en:Village Pump, and meta:Tech.