@@ -17,7 +17,6 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
1717import { CommonCodeEditor } from 'vs/editor/common/commonCodeEditor' ;
1818import { CommonEditorConfiguration } from 'vs/editor/common/config/commonEditorConfig' ;
1919import { Range , IRange } from 'vs/editor/common/core/range' ;
20- import { Selection } from 'vs/editor/common/core/selection' ;
2120import * as editorCommon from 'vs/editor/common/editorCommon' ;
2221import { EditorAction } from 'vs/editor/common/editorCommonExtensions' ;
2322import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService' ;
@@ -686,99 +685,3 @@ class CodeEditorWidgetFocusTracker extends Disposable {
686685 return this . _hasFocus ;
687686 }
688687}
689-
690- class OverlayWidget2 implements editorBrowser . IOverlayWidget {
691-
692- private _id : string ;
693- private _position : editorBrowser . IOverlayWidgetPosition ;
694- private _domNode : HTMLElement ;
695-
696- constructor ( id : string , position : editorBrowser . IOverlayWidgetPosition ) {
697- this . _id = id ;
698- this . _position = position ;
699- this . _domNode = document . createElement ( 'div' ) ;
700- this . _domNode . className = this . _id . replace ( / \. / g, '-' ) . replace ( / [ ^ a - z 0 - 9 \- ] / , '' ) ;
701- }
702-
703- public getId ( ) : string {
704- return this . _id ;
705- }
706-
707- public getDomNode ( ) : HTMLElement {
708- return this . _domNode ;
709- }
710-
711- public getPosition ( ) : editorBrowser . IOverlayWidgetPosition {
712- return this . _position ;
713- }
714- }
715-
716- export enum EditCursorState {
717- EndOfLastEditOperation = 0
718- }
719-
720- class SingleEditOperation {
721-
722- range : Range ;
723- text : string ;
724- forceMoveMarkers : boolean ;
725-
726- constructor ( source : editorCommon . ISingleEditOperation ) {
727- this . range = new Range ( source . range . startLineNumber , source . range . startColumn , source . range . endLineNumber , source . range . endColumn ) ;
728- this . text = source . text ;
729- this . forceMoveMarkers = source . forceMoveMarkers || false ;
730- }
731-
732- }
733-
734- export class CommandRunner implements editorCommon . ICommand {
735-
736- private _ops : SingleEditOperation [ ] ;
737- private _editCursorState : EditCursorState ;
738-
739- constructor ( ops : editorCommon . ISingleEditOperation [ ] , editCursorState : EditCursorState ) {
740- this . _ops = ops . map ( op => new SingleEditOperation ( op ) ) ;
741- this . _editCursorState = editCursorState ;
742- }
743-
744- public getEditOperations ( model : editorCommon . ITokenizedModel , builder : editorCommon . IEditOperationBuilder ) : void {
745- if ( this . _ops . length === 0 ) {
746- return ;
747- }
748-
749- // Sort them in ascending order by range starts
750- this . _ops . sort ( ( o1 , o2 ) => {
751- return Range . compareRangesUsingStarts ( o1 . range , o2 . range ) ;
752- } ) ;
753-
754- // Merge operations that touch each other
755- let resultOps : editorCommon . ISingleEditOperation [ ] = [ ] ;
756- let previousOp = this . _ops [ 0 ] ;
757- for ( let i = 1 ; i < this . _ops . length ; i ++ ) {
758- if ( previousOp . range . endLineNumber === this . _ops [ i ] . range . startLineNumber && previousOp . range . endColumn === this . _ops [ i ] . range . startColumn ) {
759- // These operations are one after another and can be merged
760- previousOp . range = Range . plusRange ( previousOp . range , this . _ops [ i ] . range ) ;
761- previousOp . text = previousOp . text + this . _ops [ i ] . text ;
762- } else {
763- resultOps . push ( previousOp ) ;
764- previousOp = this . _ops [ i ] ;
765- }
766- }
767- resultOps . push ( previousOp ) ;
768-
769- for ( let i = 0 ; i < resultOps . length ; i ++ ) {
770- builder . addEditOperation ( Range . lift ( resultOps [ i ] . range ) , resultOps [ i ] . text ) ;
771- }
772- }
773-
774- public computeCursorState ( model : editorCommon . ITokenizedModel , helper : editorCommon . ICursorStateComputerData ) : Selection {
775- let inverseEditOperations = helper . getInverseEditOperations ( ) ;
776- let srcRange = inverseEditOperations [ inverseEditOperations . length - 1 ] . range ;
777- return new Selection (
778- srcRange . endLineNumber ,
779- srcRange . endColumn ,
780- srcRange . endLineNumber ,
781- srcRange . endColumn
782- ) ;
783- }
784- }
0 commit comments