Remove $wgCodeMirrorEnableBracketMatching feature flag

Bug: T307188
Change-Id: Ibb21dea29c87d8fac898506c19f329273348c190
This commit is contained in:
Adam Wight 2022-06-10 16:29:08 +02:00 committed by WMDE-Fisch
parent 8eb2f13889
commit 9f34c4d220
8 changed files with 8 additions and 65 deletions

View file

@ -15,11 +15,6 @@
"MediaWiki": ">= 1.38.0"
},
"config": {
"CodeMirrorEnableBracketMatching": {
"value": false,
"description": "Temporary feature flag for the matchbrackets addon.",
"public": true
},
"CodeMirrorColorblindColors": {
"value": false,
"description": "Temporary feature flag for colorblind-friendly colors.",

View file

@ -5,7 +5,6 @@ namespace MediaWiki\Extension\CodeMirror;
use Config;
use MediaWiki\MediaWikiServices;
use OutputPage;
use RequestContext;
use Skin;
use User;
@ -65,11 +64,6 @@ class Hooks {
/** @var Config $config */
$config = MediaWikiServices::getInstance()->getMainConfig();
$vars['wgCodeMirrorEnableBracketMatching'] = $config->get( 'CodeMirrorEnableBracketMatching' )
// Allows tests to override the configuration.
|| RequestContext::getMain()->getRequest()
->getCookie( '-codemirror-bracket-matching-test', 'mw' );
$vars['wgCodeMirrorColorblindColors'] = $config->get( 'CodeMirrorColorblindColors' );
$vars['wgCodeMirrorLineNumberingNamespaces'] = $config->get( 'CodeMirrorLineNumberingNamespaces' );

View file

@ -201,12 +201,10 @@
viewportMargin: Infinity
};
if ( mw.config.get( 'wgCodeMirrorEnableBracketMatching' ) ) {
cmOptions.matchBrackets = {
highlightNonMatching: false,
maxHighlightLineLength: 10000
};
}
cmOptions.matchBrackets = {
highlightNonMatching: false,
maxHighlightLineLength: 10000
};
codeMirror = CodeMirror.fromTextArea( $textbox1[ 0 ], cmOptions );
$codeMirror = $( codeMirror.getWrapperElement() );

View file

@ -95,12 +95,10 @@ ve.ui.CodeMirrorAction.prototype.toggle = function ( enable ) {
}
};
if ( mw.config.get( 'wgCodeMirrorEnableBracketMatching' ) ) {
cmOptions.matchBrackets = {
highlightNonMatching: false,
maxHighlightLineLength: 10000
};
}
cmOptions.matchBrackets = {
highlightNonMatching: false,
maxHighlightLineLength: 10000
};
if ( ve.ui.CodeMirrorAction.static.isLineNumbering() ) {
$.extend( cmOptions, {

View file

@ -1,14 +0,0 @@
'use strict';
// Temporary, can be removed along with the feature flag.
class HighlightingFeatureFlag {
enable() {
browser.setCookies( {
name: 'mw-codemirror-bracket-matching-test',
value: '1'
} );
}
}
module.exports = new HighlightingFeatureFlag();

View file

@ -1,24 +0,0 @@
'use strict';
const assert = require( 'assert' ),
EditPage = require( '../pageobjects/edit.page' ),
FixtureContent = require( '../fixturecontent' ),
LoginPage = require( 'wdio-mediawiki/LoginPage' ),
UserPreferences = require( '../userpreferences' );
describe( 'CodeMirror bracket match default', function () {
before( function () {
LoginPage.loginAdmin();
UserPreferences.enableWikitext2010EditorWithCodeMirror();
this.title = FixtureContent.createFixturePage();
} );
it( 'disables highlighting', function () {
EditPage.openForEditing( this.title );
EditPage.wikiEditorToolbar.waitForDisplayed();
EditPage.clickText();
EditPage.cursorToPosition( 0 );
assert.strictEqual( EditPage.getHighlightedMatchingBrackets(), '' );
} );
} );

View file

@ -2,7 +2,6 @@
const assert = require( 'assert' ),
EditPage = require( '../pageobjects/edit.page' ),
FeatureFlag = require( '../highlightingfeatureflag' ),
FixtureContent = require( '../fixturecontent' ),
LoginPage = require( 'wdio-mediawiki/LoginPage' ),
UserPreferences = require( '../userpreferences' );
@ -12,7 +11,6 @@ describe( 'CodeMirror bracket match highlighting for the wikitext 2010 editor',
LoginPage.loginAdmin();
this.title = FixtureContent.createFixturePage();
UserPreferences.enableWikitext2010EditorWithCodeMirror();
FeatureFlag.enable();
} );
beforeEach( function () {

View file

@ -2,7 +2,6 @@
const assert = require( 'assert' ),
EditPage = require( '../pageobjects/edit.page' ),
FeatureFlag = require( '../highlightingfeatureflag' ),
FixtureContent = require( '../fixturecontent' ),
LoginPage = require( 'wdio-mediawiki/LoginPage' ),
UserPreferences = require( '../userpreferences' );
@ -12,7 +11,6 @@ describe( 'CodeMirror bracket match highlighting for the wikitext 2017 editor',
LoginPage.loginAdmin();
this.title = FixtureContent.createFixturePage();
UserPreferences.enableWikitext2017EditorWithCodeMirror();
FeatureFlag.enable();
} );
beforeEach( function () {