mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-25 06:10:30 -04:00
Merge from master
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user