Last modified: 2014-08-09 11:35:31 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T59428, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57428 - Use MediaWiki coding style in CodeEditor
Use MediaWiki coding style in CodeEditor
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
CodeEditor (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: upstream
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-22 16:46 UTC by Liangent
Modified: 2014-08-09 11:35 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Liangent 2013-11-22 16:46:04 UTC
That is, to add a lot of spaces.
Comment 1 Andre Klapper 2013-11-23 17:24:22 UTC
Usecase?
Comment 2 Liangent 2013-11-23 17:29:49 UTC
(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.
Comment 3 Derk-Jan Hartman 2014-01-10 11:36:04 UTC
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.
Comment 4 Liangent 2014-01-10 12:12:25 UTC
(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.
Comment 5 Derk-Jan Hartman 2014-01-10 21:01:57 UTC
So what you mean, is that if you write function(test) in the editor, it will correct it to function( test )

Right ?
Comment 6 Liangent 2014-01-10 21:21:25 UTC
(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.
Comment 7 Derk-Jan Hartman 2014-03-25 23:11:52 UTC
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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links