Merge from master

This commit is contained in:
Raj Musuku
2019-02-21 17:56:04 -08:00
parent 5a146e34fa
commit 666ae11639
11482 changed files with 119352 additions and 255574 deletions

View File

@@ -2,21 +2,20 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { CharCode } from 'vs/base/common/charCode';
import { EditOperation } from 'vs/editor/common/core/editOperation';
import { Position } from 'vs/editor/common/core/position';
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 { ICommentsConfiguration, LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';
import { CharCode } from 'vs/base/common/charCode';
import { ITextModel, IIdentifiedSingleEditOperation } from 'vs/editor/common/model';
import { IIdentifiedSingleEditOperation, ITextModel } from 'vs/editor/common/model';
import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry';
export class BlockCommentCommand implements editorCommon.ICommand {
private _selection: Selection;
private _usedEndToken: string;
private _usedEndToken: string | null;
constructor(selection: Selection) {
this._selection = selection;
@@ -54,7 +53,7 @@ export class BlockCommentCommand implements editorCommon.ICommand {
return true;
}
private _createOperationsForBlockComment(selection: Range, config: ICommentsConfiguration, model: ITextModel, builder: editorCommon.IEditOperationBuilder): void {
private _createOperationsForBlockComment(selection: Range, startToken: string, endToken: string, model: ITextModel, builder: editorCommon.IEditOperationBuilder): void {
const startLineNumber = selection.startLineNumber;
const startColumn = selection.startColumn;
const endLineNumber = selection.endLineNumber;
@@ -63,9 +62,6 @@ export class BlockCommentCommand implements editorCommon.ICommand {
const startLineText = model.getLineContent(startLineNumber);
const endLineText = model.getLineContent(endLineNumber);
let startToken = config.blockCommentStartToken;
let endToken = config.blockCommentEndToken;
let startTokenIndex = startLineText.lastIndexOf(startToken, startColumn - 1 + startToken.length);
let endTokenIndex = endLineText.indexOf(endToken, endColumn - 1 - endToken.length);
@@ -180,9 +176,7 @@ export class BlockCommentCommand implements editorCommon.ICommand {
return;
}
this._createOperationsForBlockComment(
this._selection, config, model, builder
);
this._createOperationsForBlockComment(this._selection, config.blockCommentStartToken, config.blockCommentEndToken, model, builder);
}
public computeCursorState(model: ITextModel, helper: editorCommon.ICursorStateComputerData): Selection {