提交 92b91cf3 编写于 作者: A Alex Dima

Remove usages of richEditSupport and adopt LanguageConfigurationRegistry

上级 3719c2f6
......@@ -25,6 +25,7 @@ import {CancellationToken} from 'vs/base/common/cancellation';
import {toThenable} from 'vs/base/common/async';
import {compile} from 'vs/editor/common/modes/monarch/monarchCompile';
import {createTokenizationSupport} from 'vs/editor/common/modes/monarch/monarchLexer';
import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry';
export function register(language:ILanguageExtensionPoint): void {
ModesRegistry.registerLanguage(language);
......@@ -50,9 +51,7 @@ export function onLanguage(languageId:string, callback:()=>void): IDisposable {
}
export function setLanguageConfiguration(languageId:string, configuration:IRichLanguageConfiguration): IDisposable {
startup.initStaticServicesIfNecessary();
let staticPlatformServices = ensureStaticPlatformServices(null);
return staticPlatformServices.modeService.registerRichEditSupport(languageId, configuration);
return LanguageConfigurationRegistry.register(languageId, configuration);
}
export function setTokensProvider(languageId:string, support:modes.TokensProvider): IDisposable {
......@@ -313,7 +312,7 @@ export function registerMonarchStandaloneLanguage(language:ILanguageExtensionPoi
return createTokenizationSupport(modeService, mode, lexer);
});
modeService.registerRichEditSupport(language.id, value.conf);
LanguageConfigurationRegistry.register(language.id, value.conf);
}, (err) => {
console.error('Cannot find module ' + defModule, err);
});
......
......@@ -16,6 +16,7 @@ import {Range} from 'vs/editor/common/core/range';
import {Selection} from 'vs/editor/common/core/selection';
import * as editorCommon from 'vs/editor/common/editorCommon';
import {IColumnSelectResult} from 'vs/editor/common/controller/cursorMoveHelper';
import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry';
export interface ITypingListener {
(): void;
......@@ -140,8 +141,8 @@ export class Cursor extends EventEmitter {
this.modelUnbinds.push(this.model.onDidChangeMode((e) => {
this._onModelModeChanged();
}));
this.modelUnbinds.push(this.model.onDidChangeModeSupport((e) => {
// TODO@Alex: react only if certain supports changed?
this.modelUnbinds.push(LanguageConfigurationRegistry.onDidChange(() => {
// TODO@Alex: react only if certain supports changed? (and if my model's mode changed)
this._onModelModeChanged();
}));
......
......@@ -953,7 +953,6 @@ export interface IConfigurationChangedEvent {
*/
export interface IModeSupportChangedEvent {
tokenizationSupport:boolean;
richEditSupport: boolean;
}
/**
......
......@@ -180,27 +180,6 @@ export interface ILineContext {
findIndexOfOffset(offset:number): number;
}
/**
* @internal
*/
export enum MutableSupport {
RichEditSupport = 1,
TokenizationSupport = 2
}
/**
* @internal
*/
export function mutableSupportToString(registerableSupport:MutableSupport) {
if (registerableSupport === MutableSupport.RichEditSupport) {
return 'richEditSupport';
}
if (registerableSupport === MutableSupport.TokenizationSupport) {
return 'tokenizationSupport';
}
throw new Error('Illegal argument!');
}
export interface IMode {
......@@ -221,7 +200,7 @@ export interface IMode {
* Register a support by name. Only optional.
* @internal
*/
registerSupport?<T>(support:MutableSupport, callback:(mode:IMode)=>T): IDisposable;
setTokenizationSupport?<T>(callback:(mode:IMode)=>T): IDisposable;
/**
* Optional adapter to support tokenization.
......@@ -246,12 +225,6 @@ export interface IMode {
* @internal
*/
configSupport?:IConfigurationSupport;
/**
* Optional adapter to support rich editing.
* @internal
*/
richEditSupport?: IRichEditSupport;
}
/**
......
......@@ -102,17 +102,16 @@ export abstract class AbstractMode implements modes.IMode {
return this._eventEmitter.addListener2('modeSupportChanged', callback);
}
public registerSupport<T>(supportEnum:modes.MutableSupport, callback:(mode:modes.IMode) => T) : IDisposable {
let supportStr = modes.mutableSupportToString(supportEnum);
public setTokenizationSupport<T>(callback:(mode:modes.IMode) => T) : IDisposable {
var supportImpl = callback(this);
this[supportStr] = supportImpl;
this._eventEmitter.emit('modeSupportChanged', _createModeSupportChangedEvent(supportEnum));
this['tokenizationSupport'] = supportImpl;
this._eventEmitter.emit('modeSupportChanged', _createModeSupportChangedEvent());
return {
dispose: () => {
if (this[supportStr] === supportImpl) {
delete this[supportStr];
this._eventEmitter.emit('modeSupportChanged', _createModeSupportChangedEvent(supportEnum));
if (this['tokenizationSupport'] === supportImpl) {
delete this['tokenizationSupport'];
this._eventEmitter.emit('modeSupportChanged', _createModeSupportChangedEvent());
}
}
};
......@@ -122,7 +121,6 @@ export abstract class AbstractMode implements modes.IMode {
class SimplifiedMode implements modes.IMode {
tokenizationSupport: modes.ITokenizationSupport;
richEditSupport: modes.IRichEditSupport;
private _sourceMode: modes.IMode;
private _eventEmitter: EventEmitter;
......@@ -152,7 +150,6 @@ class SimplifiedMode implements modes.IMode {
private _assignSupports(): void {
this.tokenizationSupport = this._sourceMode.tokenizationSupport;
this.richEditSupport = this._sourceMode.richEditSupport;
}
}
......@@ -235,17 +232,8 @@ export class FrankensteinMode extends AbstractMode {
}
}
function _createModeSupportChangedEvent(supportEnum:modes.MutableSupport): IModeSupportChangedEvent {
let e:IModeSupportChangedEvent = {
richEditSupport: false,
tokenizationSupport: false
function _createModeSupportChangedEvent(): IModeSupportChangedEvent {
return {
tokenizationSupport: true
};
if (supportEnum === modes.MutableSupport.RichEditSupport) {
e.richEditSupport = true;
return e;
} else if (supportEnum === modes.MutableSupport.TokenizationSupport) {
e.tokenizationSupport = true;
return e;
}
throw new Error('Illegal argument!');
}
......@@ -17,6 +17,7 @@ import {ITokenizedModel} from 'vs/editor/common/editorCommon';
import {onUnexpectedError} from 'vs/base/common/errors';
import {Position} from 'vs/editor/common/core/position';
import * as strings from 'vs/base/common/strings';
import {IDisposable} from 'vs/base/common/lifecycle';
export interface CommentRule {
lineComment?: string;
......@@ -140,14 +141,17 @@ export class LanguageConfigurationRegistryImpl {
this._entries = Object.create(null);
}
public register(languageId:string, configuration:IRichLanguageConfiguration): void {
public register(languageId:string, configuration:IRichLanguageConfiguration): IDisposable {
let previous = this._entries[languageId] || null;
this._entries[languageId] = new RichEditSupport(languageId, previous, configuration);
this._onDidChange.fire(void 0);
return {
dispose: () => {}
};
}
private _getRichEditSupport(mode:IMode): IRichEditSupport {
return /*this._entries[mode.getId()] || */mode.richEditSupport;
return this._entries[mode.getId()];
}
public getElectricCharacterSupport(mode:IMode): IRichEditElectricCharacter {
......
......@@ -85,7 +85,7 @@ export class TokenizationSupport implements modes.ITokenizationSupport, IDisposa
this.supportsNestedModes = supportsNestedModes;
this._embeddedModesListeners = {};
if (this.supportsNestedModes) {
if (!this._mode.registerSupport) {
if (!this._mode.setTokenizationSupport) {
throw new Error('Cannot be a mode with nested modes unless I can emit a tokenizationSupport changed event!');
}
}
......@@ -239,7 +239,7 @@ export class TokenizationSupport implements modes.ITokenizationSupport, IDisposa
}
if (e.tokenizationSupport) {
emitting = true;
this._mode.registerSupport(modes.MutableSupport.TokenizationSupport, (mode) => {
this._mode.setTokenizationSupport((mode) => {
return mode.tokenizationSupport;
});
emitting = false;
......
......@@ -9,7 +9,6 @@ import {IDisposable} from 'vs/base/common/lifecycle';
import {TPromise} from 'vs/base/common/winjs.base';
import {ServiceIdentifier, createDecorator} from 'vs/platform/instantiation/common/instantiation';
import * as modes from 'vs/editor/common/modes';
import {IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
export var IModeService = createDecorator<IModeService>('modeService');
......@@ -70,7 +69,6 @@ export interface IModeService {
getOrCreateModeByLanguageName(languageName: string): TPromise<modes.IMode>;
getOrCreateModeByFilenameOrFirstLine(filename: string, firstLine?:string): TPromise<modes.IMode>;
registerRichEditSupport(modeId: string, support: IRichLanguageConfiguration): IDisposable;
registerTokenizationSupport(modeId: string, callback: (mode: modes.IMode) => modes.ITokenizationSupport): IDisposable;
registerTokenizationSupport2(modeId: string, support: modes.TokensProvider): IDisposable;
}
......@@ -20,7 +20,6 @@ import {IThreadService, Remotable, ThreadAffinity} from 'vs/platform/thread/comm
import * as modes from 'vs/editor/common/modes';
import {FrankensteinMode} from 'vs/editor/common/modes/abstractMode';
import {ILegacyLanguageDefinition, ModesRegistry} from 'vs/editor/common/modes/modesRegistry';
import {IRichLanguageConfiguration, RichEditSupport} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {LanguagesRegistry} from 'vs/editor/common/services/languagesRegistry';
import {ILanguageExtensionPoint, IValidLanguageExtensionPoint, IModeLookupResult, IModeService} from 'vs/editor/common/services/modeService';
import {IConfigurationService} from 'vs/platform/configuration/common/configuration';
......@@ -388,18 +387,18 @@ export class ModeServiceImpl implements IModeService {
};
}
private _registerModeSupport<T>(mode:modes.IMode, support: modes.MutableSupport, callback: (mode: modes.IMode) => T): IDisposable {
if (mode.registerSupport) {
return mode.registerSupport(support, callback);
private _registerTokenizationSupport<T>(mode:modes.IMode, callback: (mode: modes.IMode) => T): IDisposable {
if (mode.setTokenizationSupport) {
return mode.setTokenizationSupport(callback);
} else {
console.warn('Cannot register support ' + modes.mutableSupportToString(support) + ' on mode ' + mode.getId() + ' because it does not support it.');
console.warn('Cannot register tokenizationSupport on mode ' + mode.getId() + ' because it does not support it.');
return EmptyDisposable;
}
}
protected registerModeSupport<T>(modeId: string, support: modes.MutableSupport, callback: (mode: modes.IMode) => T): IDisposable {
private registerModeSupport<T>(modeId: string, callback: (mode: modes.IMode) => T): IDisposable {
if (this._instantiatedModes.hasOwnProperty(modeId)) {
return this._registerModeSupport(this._instantiatedModes[modeId], support, callback);
return this._registerTokenizationSupport(this._instantiatedModes[modeId], callback);
}
let cc: (disposable:IDisposable)=>void;
......@@ -410,7 +409,7 @@ export class ModeServiceImpl implements IModeService {
return;
}
cc(this._registerModeSupport(mode, support, callback));
cc(this._registerTokenizationSupport(mode, callback));
disposable.dispose();
});
......@@ -421,16 +420,12 @@ export class ModeServiceImpl implements IModeService {
};
}
public registerRichEditSupport(modeId: string, support: IRichLanguageConfiguration): IDisposable {
return this.registerModeSupport(modeId, modes.MutableSupport.RichEditSupport, (mode) => new RichEditSupport(modeId, mode.richEditSupport, support));
}
public registerTokenizationSupport(modeId: string, callback: (mode: modes.IMode) => modes.ITokenizationSupport): IDisposable {
return this.registerModeSupport(modeId, modes.MutableSupport.TokenizationSupport, callback);
return this.registerModeSupport(modeId, callback);
}
public registerTokenizationSupport2(modeId: string, support: modes.TokensProvider): IDisposable {
return this.registerModeSupport(modeId, modes.MutableSupport.TokenizationSupport, (mode) => {
return this.registerModeSupport(modeId, (mode) => {
return new TokenizationSupport2Adapter(mode, support);
});
}
......
......@@ -10,7 +10,7 @@ import {testCommand} from 'vs/editor/test/common/commands/commandTestUtils';
import {CommentMode} from 'vs/editor/test/common/testModes';
function testBlockCommentCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void {
var mode = new CommentMode({ lineCommentToken: '!@#', blockCommentStartToken: '<0', blockCommentEndToken: '0>' });
var mode = new CommentMode({ lineComment: '!@#', blockComment: ['<0', '0>'] });
testCommand(lines, mode, selection, (sel) => new BlockCommentCommand(sel), expectedLines, expectedSelection);
}
......
......@@ -13,12 +13,12 @@ import {CommentMode} from 'vs/editor/test/common/testModes';
suite('Editor Contrib - Line Comment Command', () => {
function testLineCommentCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void {
var mode = new CommentMode({ lineCommentToken: '!@#', blockCommentStartToken: '<!@#', blockCommentEndToken: '#@!>' });
var mode = new CommentMode({ lineComment: '!@#', blockComment: ['<!@#', '#@!>'] });
testCommand(lines, mode, selection, (sel) => new LineCommentCommand(sel, 4, Type.Toggle), expectedLines, expectedSelection);
}
function testAddLineCommentCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void {
var mode = new CommentMode({ lineCommentToken: '!@#', blockCommentStartToken: '<!@#', blockCommentEndToken: '#@!>' });
var mode = new CommentMode({ lineComment: '!@#', blockComment: ['<!@#', '#@!>'] });
testCommand(lines, mode, selection, (sel) => new LineCommentCommand(sel, 4, Type.ForceAdd), expectedLines, expectedSelection);
}
......@@ -520,7 +520,7 @@ suite('Editor Contrib - Line Comment Command', () => {
suite('Editor Contrib - Line Comment As Block Comment', () => {
function testLineCommentCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void {
var mode = new CommentMode({ lineCommentToken: '', blockCommentStartToken: '(', blockCommentEndToken: ')' });
var mode = new CommentMode({ lineComment: '', blockComment: ['(', ')'] });
testCommand(lines, mode, selection, (sel) => new LineCommentCommand(sel, 4, Type.Toggle), expectedLines, expectedSelection);
}
......@@ -630,7 +630,7 @@ suite('Editor Contrib - Line Comment As Block Comment', () => {
suite('Editor Contrib - Line Comment As Block Comment 2', () => {
function testLineCommentCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void {
var mode = new CommentMode({ lineCommentToken: null, blockCommentStartToken: '<!@#', blockCommentEndToken: '#@!>' });
var mode = new CommentMode({ lineComment: null, blockComment: ['<!@#', '#@!>'] });
testCommand(lines, mode, selection, (sel) => new LineCommentCommand(sel, 4, Type.Toggle), expectedLines, expectedSelection);
}
......
......@@ -7,20 +7,18 @@
import * as assert from 'assert';
import URI from 'vs/base/common/uri';
import {Range} from 'vs/editor/common/core/range';
import {IMode, IRichEditSupport, IndentAction} from 'vs/editor/common/modes';
import {IMode, IndentAction} from 'vs/editor/common/modes';
import {TokenSelectionSupport} from 'vs/editor/contrib/smartSelect/common/tokenSelectionSupport';
import {createMockModelService} from 'vs/editor/test/common/servicesTestUtils';
import {MockTokenizingMode} from 'vs/editor/test/common/mocks/mockMode';
import {RichEditSupport} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry';
class MockJSMode extends MockTokenizingMode {
public richEditSupport: IRichEditSupport;
constructor() {
super('js', 'mock-js');
super('js-tokenSelectionSupport', 'mock-js');
this.richEditSupport = new RichEditSupport(this.getId(), null, {
LanguageConfigurationRegistry.register(this.getId(), {
brackets: [
['(', ')'],
['{', '}'],
......
......@@ -10,6 +10,7 @@ import {readFile} from 'vs/base/node/pfs';
import {IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {IModeService} from 'vs/editor/common/services/modeService';
import {IAutoClosingPair} from 'vs/editor/common/modes';
import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry';
type CharacterPair = [string, string];
......@@ -88,7 +89,7 @@ export class LanguageConfigurationFileHandler {
richEditConfig.surroundingPairs = this._mapCharacterPairs(configuration.surroundingPairs);
}
this._modeService.registerRichEditSupport(modeId, richEditConfig);
LanguageConfigurationRegistry.register(modeId, richEditConfig);
}
private _mapCharacterPairs(pairs:CharacterPair[]): IAutoClosingPair[] {
......
......@@ -8,8 +8,8 @@ import * as assert from 'assert';
import {ShiftCommand} from 'vs/editor/common/commands/shiftCommand';
import {Selection} from 'vs/editor/common/core/selection';
import {IIdentifiedSingleEditOperation} from 'vs/editor/common/editorCommon';
import {IRichEditSupport, IndentAction} from 'vs/editor/common/modes';
import {RichEditSupport} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {IndentAction} from 'vs/editor/common/modes';
import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {createSingleEditOp, getEditOperation, testCommand} from 'vs/editor/test/common/commands/commandTestUtils';
import {withEditorModel} from 'vs/editor/test/common/editorTestUtils';
import {MockMode} from 'vs/editor/test/common/mocks/mockMode';
......@@ -32,11 +32,9 @@ function testUnshiftCommand(lines: string[], selection: Selection, expectedLines
class DocBlockCommentMode extends MockMode {
public richEditSupport: IRichEditSupport;
constructor() {
super();
this.richEditSupport = new RichEditSupport(this.getId(), null, {
LanguageConfigurationRegistry.register(this.getId(), {
brackets: [
['(', ')'],
['{', '}'],
......
......@@ -16,10 +16,11 @@ import {
ITokenizedModel, IEditOperationBuilder, ICursorStateComputerData
} from 'vs/editor/common/editorCommon';
import {Model} from 'vs/editor/common/model/model';
import {IMode, IRichEditSupport, IndentAction} from 'vs/editor/common/modes';
import {RichEditSupport} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {IMode, IndentAction} from 'vs/editor/common/modes';
import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {MockConfiguration} from 'vs/editor/test/common/mocks/mockConfiguration';
import {BracketMode} from 'vs/editor/test/common/testModes';
import {MockMode} from 'vs/editor/test/common/mocks/mockMode';
let H = Handler;
......@@ -1062,41 +1063,26 @@ suite('Editor Controller - Cursor', () => {
});
});
class TestMode {
public getId():string {
return 'testing';
}
public toSimplifiedMode(): IMode {
return this;
}
}
class SurroundingMode extends TestMode {
public richEditSupport: IRichEditSupport;
class SurroundingMode extends MockMode {
constructor() {
super();
this.richEditSupport = new RichEditSupport(this.getId(), null, {
LanguageConfigurationRegistry.register(this.getId(), {
autoClosingPairs: [{ open: '(', close: ')' }]
});
}
}
class OnEnterMode extends TestMode {
public richEditSupport: IRichEditSupport;
class OnEnterMode extends MockMode {
constructor(indentAction: IndentAction) {
super();
this.richEditSupport = {
onEnter: {
onEnter: (model, position) => {
return {
indentAction: indentAction
};
LanguageConfigurationRegistry.register(this.getId(), {
onEnterRules: [{
beforeText: /.*/,
action: {
indentAction: indentAction
}
}
};
}]
});
}
}
......
......@@ -12,7 +12,7 @@ export class MockMode implements IMode {
private static instanceCount = 0;
private _id:string;
constructor(id:string = 'mockMode') {
constructor(id?:string) {
if (typeof id === 'undefined') {
id = 'mockMode' + (++MockMode.instanceCount);
}
......
......@@ -9,7 +9,6 @@ import {IDisposable} from 'vs/base/common/lifecycle';
import {TPromise} from 'vs/base/common/winjs.base';
import {ServiceIdentifier} from 'vs/platform/instantiation/common/instantiation';
import * as modes from 'vs/editor/common/modes';
import {IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {IModeService, IModeLookupResult} from 'vs/editor/common/services/modeService';
export class MockModeService implements IModeService {
......@@ -80,9 +79,6 @@ export class MockModeService implements IModeService {
throw new Error('Not implemented');
}
registerRichEditSupport(modeId: string, support: IRichLanguageConfiguration): IDisposable {
throw new Error('Not implemented');
}
registerTokenizationSupport(modeId: string, callback: (mode: modes.IMode) => modes.ITokenizationSupport): IDisposable {
throw new Error('Not implemented');
}
......
......@@ -104,7 +104,7 @@ export class SwitchingMode extends MockMode {
this.tokenizationSupport = new TokenizationSupport(this, this, true, false);
}
registerSupport<T>(support:modes.MutableSupport, callback:(mode:modes.IMode)=>T): IDisposable {
setTokenizationSupport<T>(callback:(mode:modes.IMode)=>T): IDisposable {
return EmptyDisposable;
}
......
......@@ -6,26 +6,8 @@
import {Arrays} from 'vs/editor/common/core/arrays';
import * as modes from 'vs/editor/common/modes';
import {RichEditSupport} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {MockMode} from 'vs/editor/test/common/mocks/mockMode';
import {ModeTransition} from 'vs/editor/common/core/modeTransition';
class ModeWithRichEditSupport extends MockMode {
public richEditSupport: modes.IRichEditSupport;
constructor(id:string, wordRegExp:RegExp) {
super(id);
this.richEditSupport = new RichEditSupport(id, null, {
wordPattern: wordRegExp
});
}
}
export function createMockMode(id:string, wordRegExp:RegExp = null):modes.IMode {
return new ModeWithRichEditSupport(id, wordRegExp);
}
export interface TokenText {
text: string;
type: string;
......
......@@ -6,7 +6,7 @@
import * as modes from 'vs/editor/common/modes';
import {AbstractState} from 'vs/editor/common/modes/abstractState';
import {RichEditSupport} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {LanguageConfigurationRegistry, CommentRule} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {TokenizationSupport} from 'vs/editor/common/modes/supports/tokenizationSupport';
import {MockMode} from 'vs/editor/test/common/mocks/mockMode';
......@@ -33,17 +33,16 @@ export class CommentState extends AbstractState {
export class CommentMode extends MockMode {
public tokenizationSupport: modes.ITokenizationSupport;
public richEditSupport: modes.IRichEditSupport;
constructor(commentsConfig:modes.ICommentsConfiguration) {
constructor(commentsConfig:CommentRule) {
super();
this.tokenizationSupport = new TokenizationSupport(this, {
getInitialState: () => new CommentState(this, 0)
}, false, false);
this.richEditSupport = {
comments:commentsConfig
};
LanguageConfigurationRegistry.register(this.getId(), {
comments: commentsConfig
});
}
}
......@@ -141,11 +140,9 @@ export class ModelMode2 extends MockMode {
export class BracketMode extends MockMode {
public richEditSupport: modes.IRichEditSupport;
constructor() {
super();
this.richEditSupport = new RichEditSupport(this.getId(), null, {
LanguageConfigurationRegistry.register(this.getId(), {
brackets: [
['{', '}'],
['[', ']'],
......
......@@ -17,7 +17,7 @@ import {AbstractState} from 'vs/editor/common/modes/abstractState';
import {IMarker} from 'vs/platform/markers/common/markers';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import {IThreadService, ThreadAffinity} from 'vs/platform/thread/common/thread';
import {RichEditSupport, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {LanguageConfigurationRegistry, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {TokenizationSupport} from 'vs/editor/common/modes/supports/tokenizationSupport';
import {wireCancellationToken} from 'vs/base/common/async';
......@@ -302,7 +302,6 @@ export class CSSMode extends AbstractMode {
};
public tokenizationSupport: modes.ITokenizationSupport;
public richEditSupport: modes.IRichEditSupport;
public inplaceReplaceSupport:modes.IInplaceReplaceSupport;
public configSupport:modes.IConfigurationSupport;
......@@ -322,7 +321,7 @@ export class CSSMode extends AbstractMode {
getInitialState: () => new State(this, States.Selector, false, null, false, 0)
}, false, false);
this.richEditSupport = new RichEditSupport(this.getId(), null, CSSMode.LANG_CONFIG);
LanguageConfigurationRegistry.register(this.getId(), CSSMode.LANG_CONFIG);
this.inplaceReplaceSupport = this;
this.configSupport = this;
......
......@@ -14,12 +14,24 @@ import Modes = require('vs/editor/common/modes');
import WinJS = require('vs/base/common/winjs.base');
import cssErrors = require('vs/languages/css/common/parser/cssErrors');
import servicesUtil2 = require('vs/editor/test/common/servicesTestUtils');
import modesUtil = require('vs/editor/test/common/modesTestUtils');
import {NULL_THREAD_SERVICE} from 'vs/platform/test/common/nullThreadService';
import {IMarker} from 'vs/platform/markers/common/markers';
import {MockMode} from 'vs/editor/test/common/mocks/mockMode';
import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry';
export class CSSMockMode extends MockMode {
constructor() {
super('css-mock-mode-id');
LanguageConfigurationRegistry.register(this.getId(), {
wordPattern: /(#?-?\d*\.\d\w*%?)|([@#.:!]?[\w-?]+%?)|[@#.!]/g
});
}
}
var cssMockMode = new CSSMockMode();
export function mockMirrorModel(content:string, url:URI = null) : mm.MirrorModel {
return mm.createTestMirrorModelFromString(content, modesUtil.createMockMode('mock.mode.id', /(#?-?\d*\.\d\w*%?)|([@#.:!]?[\w-?]+%?)|[@#.!]/g), url);
return mm.createTestMirrorModelFromString(content, cssMockMode, url);
}
suite('Validation - CSS', () => {
......@@ -39,7 +51,7 @@ suite('Validation - CSS', () => {
resourceService: resourceService,
markerService: markerService
});
var worker = new cssWorker.CSSWorker('mock.mode.id', services.resourceService, services.markerService);
var worker = new cssWorker.CSSWorker('css-mock-mode-id', services.resourceService, services.markerService);
worker.doValidate([url]);
var markers = markerService.read({ resource: url });
......@@ -61,7 +73,7 @@ suite('Validation - CSS', () => {
markerService: markerService
});
var worker = new cssWorker.CSSWorker('mock.mode.id', services.resourceService, services.markerService);
var worker = new cssWorker.CSSWorker('css-mock-mode-id', services.resourceService, services.markerService);
worker.doValidate([url]);
var markers = markerService.read({ resource: url });
......
......@@ -10,7 +10,7 @@ import handlebarsTokenTypes = require('vs/languages/handlebars/common/handlebars
import htmlWorker = require('vs/languages/html/common/htmlWorker');
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import {IModeService} from 'vs/editor/common/services/modeService';
import {RichEditSupport, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {LanguageConfigurationRegistry, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {createWordRegExp} from 'vs/editor/common/modes/abstractMode';
import {ILeavingNestedModeData} from 'vs/editor/common/modes/supports/tokenizationSupport';
import {IThreadService} from 'vs/platform/thread/common/thread';
......@@ -191,10 +191,8 @@ export class HandlebarsMode extends htmlMode.HTMLMode<htmlWorker.HTMLWorker> {
return wireCancellationToken(token, this._provideLinks(model.uri));
}
}, true);
}
protected _createRichEditSupport(): modes.IRichEditSupport {
return new RichEditSupport(this.getId(), null, HandlebarsMode.LANG_CONFIG);
LanguageConfigurationRegistry.register(this.getId(), HandlebarsMode.LANG_CONFIG);
}
public getInitialState() : modes.IState {
......
......@@ -16,7 +16,7 @@ import {IModeService} from 'vs/editor/common/services/modeService';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import * as htmlTokenTypes from 'vs/languages/html/common/htmlTokenTypes';
import {EMPTY_ELEMENTS} from 'vs/languages/html/common/htmlEmptyTagsShared';
import {RichEditSupport, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {LanguageConfigurationRegistry, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {TokenizationSupport, IEnteringNestedModeData, ILeavingNestedModeData, ITokenizationCustomization} from 'vs/editor/common/modes/supports/tokenizationSupport';
import {IThreadService} from 'vs/platform/thread/common/thread';
import {wireCancellationToken} from 'vs/base/common/async';
......@@ -328,7 +328,6 @@ export class HTMLMode<W extends htmlWorker.HTMLWorker> extends AbstractMode impl
};
public tokenizationSupport: modes.ITokenizationSupport;
public richEditSupport: modes.IRichEditSupport;
public configSupport: modes.IConfigurationSupport;
private modeService:IModeService;
......@@ -350,8 +349,6 @@ export class HTMLMode<W extends htmlWorker.HTMLWorker> extends AbstractMode impl
this.tokenizationSupport = new TokenizationSupport(this, this, true, true);
this.configSupport = this;
this.richEditSupport = this._createRichEditSupport();
this._registerSupports();
}
......@@ -404,6 +401,8 @@ export class HTMLMode<W extends htmlWorker.HTMLWorker> extends AbstractMode impl
return wireCancellationToken(token, this._provideLinks(model.uri));
}
}, true);
LanguageConfigurationRegistry.register(this.getId(), HTMLMode.LANG_CONFIG);
}
protected _createModeWorkerManager(descriptor:modes.IModeDescriptor, instantiationService: IInstantiationService): ModeWorkerManager<W> {
......@@ -414,10 +413,6 @@ export class HTMLMode<W extends htmlWorker.HTMLWorker> extends AbstractMode impl
return this._modeWorkerManager.worker(runner);
}
protected _createRichEditSupport(): modes.IRichEditSupport {
return new RichEditSupport(this.getId(), null, HTMLMode.LANG_CONFIG);
}
// TokenizationSupport
public getInitialState():modes.IState {
......
......@@ -21,16 +21,14 @@ import {InstantiationService} from 'vs/platform/instantiation/common/instantiati
import {HTMLMode} from 'vs/languages/html/common/html';
import htmlWorker = require('vs/languages/html/common/htmlWorker');
import {MockTokenizingMode} from 'vs/editor/test/common/mocks/mockMode';
import {RichEditSupport, LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry';
class MockJSMode extends MockTokenizingMode {
public richEditSupport: Modes.IRichEditSupport;
constructor() {
super('js', 'mock-js');
super('html-js-mock', 'mock-js');
this.richEditSupport = new RichEditSupport(this.getId(), null, {
LanguageConfigurationRegistry.register(this.getId(), {
brackets: [
['(', ')'],
['{', '}'],
......
......@@ -16,7 +16,7 @@ import {OneWorkerAttr, AllWorkersAttr} from 'vs/platform/thread/common/threadSer
import {IThreadService, ThreadAffinity} from 'vs/platform/thread/common/thread';
import {IJSONContributionRegistry, Extensions, ISchemaContributions} from 'vs/platform/jsonschemas/common/jsonContributionRegistry';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import {RichEditSupport, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {LanguageConfigurationRegistry, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {wireCancellationToken} from 'vs/base/common/async';
export class JSONMode extends AbstractMode {
......@@ -42,7 +42,6 @@ export class JSONMode extends AbstractMode {
};
public tokenizationSupport: modes.ITokenizationSupport;
public richEditSupport: modes.IRichEditSupport;
public configSupport:modes.IConfigurationSupport;
public inplaceReplaceSupport:modes.IInplaceReplaceSupport;
......@@ -60,7 +59,7 @@ export class JSONMode extends AbstractMode {
this.tokenizationSupport = tokenization.createTokenizationSupport(this, true);
this.richEditSupport = new RichEditSupport(this.getId(), null, JSONMode.LANG_CONFIG);
LanguageConfigurationRegistry.register(this.getId(), JSONMode.LANG_CONFIG);
modes.HoverProviderRegistry.register(this.getId(), {
provideHover: (model, position, token): Thenable<modes.Hover> => {
......
......@@ -21,7 +21,7 @@ import {IModelService} from 'vs/editor/common/services/modelService';
import {IEditorWorkerService} from 'vs/editor/common/services/editorWorkerService';
import {wireCancellationToken} from 'vs/base/common/async';
import {createTokenizationSupport} from 'vs/editor/common/modes/monarch/monarchLexer';
import {RichEditSupport, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {LanguageConfigurationRegistry, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
export var language: Types.ILanguage = <Types.ILanguage> {
defaultToken: '',
......@@ -189,7 +189,6 @@ export class LESSMode extends AbstractMode {
public inplaceReplaceSupport:modes.IInplaceReplaceSupport;
public configSupport:modes.IConfigurationSupport;
public tokenizationSupport: modes.ITokenizationSupport;
public richEditSupport: modes.IRichEditSupport;
private modeService: IModeService;
private _modeWorkerManager: ModeWorkerManager<lessWorker.LessWorker>;
......@@ -249,7 +248,7 @@ export class LESSMode extends AbstractMode {
this.tokenizationSupport = createTokenizationSupport(modeService, this, lexer);
this.richEditSupport = new RichEditSupport(this.getId(), null, LESSMode.LANG_CONFIG);
LanguageConfigurationRegistry.register(this.getId(), LESSMode.LANG_CONFIG);
}
public creationDone(): void {
......
......@@ -13,23 +13,34 @@ import WinJS = require('vs/base/common/winjs.base');
import EditorCommon = require('vs/editor/common/editorCommon');
import Modes = require('vs/editor/common/modes');
import servicesUtil2 = require('vs/editor/test/common/servicesTestUtils');
import modesUtil = require('vs/editor/test/common/modesTestUtils');
import {MockMode} from 'vs/editor/test/common/mocks/mockMode';
import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry';
class LessMockMode extends MockMode {
constructor() {
super('less-mock-mode-id');
LanguageConfigurationRegistry.register(this.getId(), {
wordPattern: /(-?\d*\.\d+)|([\w-]+)/g
});
}
}
suite('LESS - Intellisense', () => {
let mockMode = new LessMockMode();
//------------ TEST suggestions ----------------
var testSuggestionsFor = function(value:string, stringBefore:string):WinJS.TPromise<Modes.ISuggestResult> {
var resourceService = new ResourceService.ResourceService();
var url = URI.parse('test://1');
resourceService.insert(url, mm.createTestMirrorModelFromString(value, modesUtil.createMockMode('mock.mode.id', /(-?\d*\.\d+)|([\w-]+)/g), url));
resourceService.insert(url, mm.createTestMirrorModelFromString(value, mockMode, url));
let services = servicesUtil2.createMockEditorWorkerServices({
resourceService: resourceService,
});
var worker = new lessWorker.LessWorker('mock.mode.id', services.resourceService, services.markerService);
var worker = new lessWorker.LessWorker('less-mock-mode-id', services.resourceService, services.markerService);
var position: EditorCommon.IPosition;
if (stringBefore === null) {
position = { column: 1, lineNumber: 1 };
......
......@@ -20,7 +20,7 @@ import {IConfigurationService} from 'vs/platform/configuration/common/configurat
import {IEditorWorkerService} from 'vs/editor/common/services/editorWorkerService';
import {AbstractMode, ModeWorkerManager} from 'vs/editor/common/modes/abstractMode';
import {createTokenizationSupport} from 'vs/editor/common/modes/monarch/monarchLexer';
import {RichEditSupport, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {LanguageConfigurationRegistry, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {wireCancellationToken} from 'vs/base/common/async';
export const language =
......@@ -210,7 +210,6 @@ export class MarkdownMode extends AbstractMode implements Modes.IEmitOutputSuppo
public emitOutputSupport: Modes.IEmitOutputSupport;
public configSupport:Modes.IConfigurationSupport;
public tokenizationSupport: Modes.ITokenizationSupport;
public richEditSupport: Modes.IRichEditSupport;
private _modeWorkerManager: ModeWorkerManager<MarkdownWorker.MarkdownWorker>;
private _threadService:IThreadService;
......@@ -234,7 +233,7 @@ export class MarkdownMode extends AbstractMode implements Modes.IEmitOutputSuppo
this.tokenizationSupport = createTokenizationSupport(modeService, this, lexer);
this.richEditSupport = new RichEditSupport(this.getId(), null, MarkdownMode.LANG_CONFIG);
LanguageConfigurationRegistry.register(this.getId(), MarkdownMode.LANG_CONFIG);
Modes.SuggestRegistry.register(this.getId(), {
triggerCharacters: [],
......
......@@ -10,7 +10,7 @@ import Modes = require('vs/editor/common/modes');
import {AbstractMode, isDigit, createWordRegExp} from 'vs/editor/common/modes/abstractMode';
import {AbstractState} from 'vs/editor/common/modes/abstractState';
import {IModeService} from 'vs/editor/common/services/modeService';
import {RichEditSupport, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {LanguageConfigurationRegistry, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {TokenizationSupport, ILeavingNestedModeData, ITokenizationCustomization} from 'vs/editor/common/modes/supports/tokenizationSupport';
import {TextualSuggestSupport} from 'vs/editor/common/modes/supports/suggestSupport';
import {IEditorWorkerService} from 'vs/editor/common/services/editorWorkerService';
......@@ -476,7 +476,6 @@ export class PHPMode extends AbstractMode implements ITokenizationCustomization
};
public tokenizationSupport: Modes.ITokenizationSupport;
public richEditSupport: Modes.IRichEditSupport;
private modeService:IModeService;
......@@ -491,7 +490,7 @@ export class PHPMode extends AbstractMode implements ITokenizationCustomization
this.tokenizationSupport = new TokenizationSupport(this, this, true, false);
this.richEditSupport = new RichEditSupport(this.getId(), null, PHPMode.LANG_CONFIG);
LanguageConfigurationRegistry.register(this.getId(), PHPMode.LANG_CONFIG);
if (editorWorkerService) {
Modes.SuggestRegistry.register(this.getId(), new TextualSuggestSupport(editorWorkerService, configurationService), true);
......
......@@ -12,7 +12,7 @@ import razorTokenTypes = require('vs/languages/razor/common/razorTokenTypes');
import {RAZORWorker} from 'vs/languages/razor/common/razorWorker';
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import {IModeService} from 'vs/editor/common/services/modeService';
import {RichEditSupport, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {LanguageConfigurationRegistry, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {ILeavingNestedModeData} from 'vs/editor/common/modes/supports/tokenizationSupport';
import {IThreadService} from 'vs/platform/thread/common/thread';
import {wireCancellationToken} from 'vs/base/common/async';
......@@ -139,16 +139,14 @@ export class RAZORMode extends htmlMode.HTMLMode<RAZORWorker> {
return wireCancellationToken(token, this._provideLinks(model.uri));
}
}, true);
LanguageConfigurationRegistry.register(this.getId(), RAZORMode.LANG_CONFIG);
}
protected _createModeWorkerManager(descriptor:modes.IModeDescriptor, instantiationService: IInstantiationService): ModeWorkerManager<RAZORWorker> {
return new ModeWorkerManager<RAZORWorker>(descriptor, 'vs/languages/razor/common/razorWorker', 'RAZORWorker', 'vs/languages/html/common/htmlWorker', instantiationService);
}
protected _createRichEditSupport(): modes.IRichEditSupport {
return new RichEditSupport(this.getId(), null, RAZORMode.LANG_CONFIG);
}
public getInitialState(): modes.IState {
return new RAZORState(this, htmlMode.States.Content, '', '', '', '', '');
}
......
......@@ -21,7 +21,7 @@ import {IModelService} from 'vs/editor/common/services/modelService';
import {IEditorWorkerService} from 'vs/editor/common/services/editorWorkerService';
import {wireCancellationToken} from 'vs/base/common/async';
import {createTokenizationSupport} from 'vs/editor/common/modes/monarch/monarchLexer';
import {RichEditSupport, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {LanguageConfigurationRegistry, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
export var language = <Types.ILanguage>{
defaultToken: '',
......@@ -291,7 +291,6 @@ export class SASSMode extends AbstractMode {
public inplaceReplaceSupport:modes.IInplaceReplaceSupport;
public configSupport:modes.IConfigurationSupport;
public tokenizationSupport: modes.ITokenizationSupport;
public richEditSupport: modes.IRichEditSupport;
private modeService: IModeService;
private _modeWorkerManager: ModeWorkerManager<sassWorker.SassWorker>;
......@@ -350,7 +349,7 @@ export class SASSMode extends AbstractMode {
this.tokenizationSupport = createTokenizationSupport(modeService, this, lexer);
this.richEditSupport = new RichEditSupport(this.getId(), null, SASSMode.LANG_CONFIG);
LanguageConfigurationRegistry.register(this.getId(), SASSMode.LANG_CONFIG);
}
public creationDone(): void {
......
......@@ -9,24 +9,35 @@ import mm = require('vs/editor/common/model/mirrorModel');
import sassWorker = require('vs/languages/sass/common/sassWorker');
import URI from 'vs/base/common/uri';
import ResourceService = require('vs/editor/common/services/resourceServiceImpl');
import EditorCommon = require('vs/editor/common/editorCommon');
import Modes = require('vs/editor/common/modes');
import WinJS = require('vs/base/common/winjs.base');
import servicesUtil2 = require('vs/editor/test/common/servicesTestUtils');
import modesUtil = require('vs/editor/test/common/modesTestUtils');
import {MockMode} from 'vs/editor/test/common/mocks/mockMode';
import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry';
class SassMockMode extends MockMode {
constructor() {
super('sass-mock-mode-id');
LanguageConfigurationRegistry.register(this.getId(), {
wordPattern: /(#?-?\d*\.\d\w*%?)|([$@#!]?[\w-?]+%?)|[$@#!]/g
});
}
}
suite('SASS - Worker', () => {
var mockMode = new SassMockMode();
var mockSASSWorkerEnv = function (url:URI, content: string) : { worker: sassWorker.SassWorker; model: mm.MirrorModel } {
var resourceService = new ResourceService.ResourceService();
var model = mm.createTestMirrorModelFromString(content, modesUtil.createMockMode('mock.mode.id', /(#?-?\d*\.\d\w*%?)|([$@#!]?[\w-?]+%?)|[$@#!]/g), url);
var model = mm.createTestMirrorModelFromString(content, mockMode, url);
resourceService.insert(url, model);
let services = servicesUtil2.createMockEditorWorkerServices({
resourceService: resourceService,
});
var worker = new sassWorker.SassWorker('mock.mode.id', services.resourceService, services.markerService);
var worker = new sassWorker.SassWorker('sass-mock-mode-id', services.resourceService, services.markerService);
return { worker: worker, model: model };
};
......
......@@ -16,6 +16,7 @@ import {LanguageServiceDefaults, typeScriptDefaults, javaScriptDefaults, Languag
import {register} from './languageFeatures';
import {ServicesAccessor} from 'vs/platform/instantiation/common/instantiation';
import * as workerManager from 'vs/languages/typescript/common/workerManager';
import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry';
function setupMode(modelService:IModelService, markerService:IMarkerService, modeService:IModeService, defaults:LanguageServiceDefaults, modeId:string, language:Language): void {
......@@ -33,7 +34,7 @@ function setupMode(modelService:IModelService, markerService:IMarkerService, mod
);
disposables.push(registration);
disposables.push(modeService.registerRichEditSupport(modeId, richEditConfiguration));
disposables.push(LanguageConfigurationRegistry.register(modeId, richEditConfiguration));
disposables.push(modeService.registerTokenizationSupport2(modeId, createTokenizationSupport2(language)));
}
......
......@@ -42,6 +42,7 @@ import vscode = require('vscode');
import {TextEditorRevealType} from 'vs/workbench/api/node/mainThreadEditors';
import * as paths from 'vs/base/common/paths';
import {ITelemetryService, ITelemetryInfo} from 'vs/platform/telemetry/common/telemetry';
import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry';
/**
* This class implements the API described in vscode.d.ts,
......@@ -503,6 +504,6 @@ export class MainProcessVSCodeAPIHelper {
}
public Modes_RichEditSupport_register(disposeToken:string, modeId: string, configuration:vscode.LanguageConfiguration): void {
this._token2Dispose[disposeToken] = this._modeService.registerRichEditSupport(modeId, <any>configuration);
this._token2Dispose[disposeToken] = LanguageConfigurationRegistry.register(modeId, configuration);
}
}
\ No newline at end of file
......@@ -18,7 +18,7 @@ import * as modes from 'vs/editor/common/modes';
import {IEditorWorkerService} from 'vs/editor/common/services/editorWorkerService';
import {AbstractMode, ModeWorkerManager} from 'vs/editor/common/modes/abstractMode';
import {createTokenizationSupport} from 'vs/editor/common/modes/monarch/monarchLexer';
import {RichEditSupport, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {LanguageConfigurationRegistry, IRichLanguageConfiguration} from 'vs/editor/common/modes/languageConfigurationRegistry';
import {wireCancellationToken} from 'vs/base/common/async';
export const language: types.ILanguage = {
......@@ -59,7 +59,6 @@ export class OutputMode extends AbstractMode {
};
public tokenizationSupport: modes.ITokenizationSupport;
public richEditSupport: modes.IRichEditSupport;
private _modeWorkerManager: ModeWorkerManager<OutputWorker>;
......@@ -76,7 +75,7 @@ export class OutputMode extends AbstractMode {
this.tokenizationSupport = createTokenizationSupport(modeService, this, lexer);
this.richEditSupport = new RichEditSupport(this.getId(), null, OutputMode.LANG_CONFIG);
LanguageConfigurationRegistry.register(this.getId(), OutputMode.LANG_CONFIG);
modes.LinkProviderRegistry.register(this.getId(), {
provideLinks: (model, token): Thenable<modes.ILink[]> => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册