Page MenuHomePhabricator

Use MediaWiki coding style in CodeEditor
Open, LowPublicFeature

Description

That is, to add a lot of spaces.


Version: unspecified
Severity: enhancement

Details

Reference
bz57428

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:36 AM
bzimport added projects: CodeEditor, Upstream.
bzimport set Reference to bz57428.
bzimport added a subscriber: Unknown Object (MLST).

(In reply to comment #1)

Usecase?

Avoid tweaking spaces manually. I feel it more annoying to have some, but not all, autocompleted (what it is doing now) than to have no autocomplete at all.

Given it already have some, it shouldn't (?) be difficult to add some spaces in code autogeneration patterns.

You mean you want to code editor to enforce our JS coding style in the code that is being authored ?

I'm not sure if that is possible right now. Besides, even jshint is moving style checks out of their code in the longterm, that probably would make it even more difficult.

(In reply to comment #3)

You mean you want to code editor to enforce our JS coding style in the code
that is being authored ?

Not to enforce (eg. automatic reformat on submit) something, but autogenerated code should follow the MediaWiki coding style guide, or don't autogenerate anything at all.

I'm not sure if that is possible right now. Besides, even jshint is moving
style checks out of their code in the longterm, that probably would make it
even more difficult.

So what you mean, is that if you write function(test) in the editor, it will correct it to function( test )

Right ?

(In reply to comment #5)

So what you mean, is that if you write function(test) in the editor, it will
correct it to function( test )

Right ?

Well let me explain my original use case.

The basic framework of JavaScript files is:

( function( $, mw ) {

// something

} )( jQuery, mediaWiki );

With CodeEditor, I type:

"( function( $, mw ) {\n\t// something"

one by one, where \n\t is an Enter keypress then a Tab. What appears is:

( function( $, mw ) {
// something
})

and I have to move the cursor after "}", then add a space, then press Right, then everything left, instead of a simple Down then continuing typing (with space auto-added). This also happens to every anonymous-function-as-argument case.

Ah. I understand. As far as I know, that's not possible at the moment and would require implementation upstream in https://github.com/ajaxorg/ace

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:13 AM
Aklapper removed a subscriber: wikibugs-l-list.