提交 70875e2e 编写于 作者: J Jackson Kearl

Fix language defined config

上级 efbb2fbc
......@@ -119,6 +119,7 @@ export class RichEditSupport {
onEnterRules: (prev ? current.onEnterRules || prev.onEnterRules : current.onEnterRules),
autoClosingPairs: (prev ? current.autoClosingPairs || prev.autoClosingPairs : current.autoClosingPairs),
surroundingPairs: (prev ? current.surroundingPairs || prev.surroundingPairs : current.surroundingPairs),
autoCloseBefore: (prev ? current.autoCloseBefore || prev.autoCloseBefore : current.autoCloseBefore),
folding: (prev ? current.folding || prev.folding : current.folding),
__electricCharacterSupport: (prev ? current.__electricCharacterSupport || prev.__electricCharacterSupport : current.__electricCharacterSupport),
};
......@@ -274,7 +275,7 @@ export class LanguageConfigurationRegistryImpl {
public getAutoCloseBeforeSet(languageId: LanguageId): string {
let characterPairSupport = this._getCharacterPairSupport(languageId);
if (!characterPairSupport) {
return CharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGAGE_DEFINED;
return CharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED;
}
return characterPairSupport.getAutoCloseBeforeSet();
}
......
......@@ -9,7 +9,7 @@ import { CharacterPair, IAutoClosingPair, IAutoClosingPairConditional, StandardA
export class CharacterPairSupport {
static readonly DEFAULT_AUTOCLOSE_BEFORE_LANGAGE_DEFINED = ';:.,=}])> \n\t';
static readonly DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED = ';:.,=}])> \n\t';
static readonly DEFAULT_AUTOCLOSE_BEFORE_WHITESPACE = ' \n\t';
private readonly _autoClosingPairs: StandardAutoClosingPairConditional[];
......@@ -25,7 +25,7 @@ export class CharacterPairSupport {
this._autoClosingPairs = [];
}
this._autoCloseBefore = typeof config.autoCloseBefore === 'string' ? config.autoCloseBefore : CharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGAGE_DEFINED;
this._autoCloseBefore = typeof config.autoCloseBefore === 'string' ? config.autoCloseBefore : CharacterPairSupport.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED;
this._surroundingPairs = config.surroundingPairs || this._autoClosingPairs;
}
......
......@@ -38,6 +38,7 @@ interface ILanguageConfiguration {
wordPattern?: string | IRegExp;
indentationRules?: IIndentationRules;
folding?: FoldingRules;
autoCloseBefore?: string;
}
function isStringArr(something: string[]): boolean {
......@@ -274,6 +275,12 @@ export class LanguageConfigurationFileHandler {
richEditConfig.surroundingPairs = surroundingPairs;
}
const autoCloseBefore = configuration.autoCloseBefore;
if (typeof autoCloseBefore === 'string') {
richEditConfig.autoCloseBefore = autoCloseBefore;
}
if (configuration.wordPattern) {
try {
let wordPattern = this._parseRegex(configuration.wordPattern);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册