|
6 | 6 |
|
7 | 7 |
|
8 | 8 | import { ok } from 'vs/base/common/assert'; |
9 | | -import { readonly, illegalArgument, V8CallSite } from 'vs/base/common/errors'; |
| 9 | +import { readonly, illegalArgument } from 'vs/base/common/errors'; |
10 | 10 | import { IdGenerator } from 'vs/base/common/idGenerator'; |
11 | 11 | import { TPromise } from 'vs/base/common/winjs.base'; |
12 | 12 | import { ExtHostDocumentData } from 'vs/workbench/api/node/extHostDocumentData'; |
13 | 13 | import { Selection, Range, Position, EndOfLine, TextEditorRevealType, TextEditorLineNumbersStyle, SnippetString } from './extHostTypes'; |
14 | 14 | import { ISingleEditOperation } from 'vs/editor/common/editorCommon'; |
15 | 15 | import * as TypeConverters from './extHostTypeConverters'; |
16 | | -import { MainThreadEditorsShape, MainThreadTelemetryShape, IResolvedTextEditorConfiguration, ITextEditorConfigurationUpdate } from './extHost.protocol'; |
| 16 | +import { MainThreadEditorsShape, IResolvedTextEditorConfiguration, ITextEditorConfigurationUpdate } from './extHost.protocol'; |
17 | 17 | import * as vscode from 'vscode'; |
18 | 18 | import { TextEditorCursorStyle } from 'vs/editor/common/config/editorOptions'; |
19 | 19 | import { IRange } from 'vs/editor/common/core/range'; |
20 | | -import { containsCommandLink } from 'vs/base/common/htmlContent'; |
21 | | -import { ExtHostExtensionService } from 'vs/workbench/api/node/extHostExtensionService'; |
22 | 20 |
|
23 | 21 | export class TextEditorDecorationType implements vscode.TextEditorDecorationType { |
24 | 22 |
|
@@ -552,79 +550,6 @@ export class ExtHostTextEditor implements vscode.TextEditor { |
552 | 550 | } |
553 | 551 | } |
554 | 552 |
|
555 | | -export class ExtHostTextEditor2 extends ExtHostTextEditor { |
556 | | - |
557 | | - constructor( |
558 | | - private readonly _extHostExtensions: ExtHostExtensionService, |
559 | | - private readonly _mainThreadTelemetry: MainThreadTelemetryShape, |
560 | | - proxy: MainThreadEditorsShape, |
561 | | - id: string, |
562 | | - document: ExtHostDocumentData, |
563 | | - selections: Selection[], |
564 | | - options: IResolvedTextEditorConfiguration, |
565 | | - viewColumn: vscode.ViewColumn |
566 | | - ) { |
567 | | - super(proxy, id, document, selections, options, viewColumn); |
568 | | - } |
569 | | - |
570 | | - setDecorations(decorationType: vscode.TextEditorDecorationType, rangesOrOptions: Range[] | vscode.DecorationOptions[]): void { |
571 | | - // (1) find out if this decoration is important for us |
572 | | - let usesCommandLink = false; |
573 | | - outer: for (const rangeOrOption of rangesOrOptions) { |
574 | | - if (Range.isRange(rangeOrOption)) { |
575 | | - break; |
576 | | - } |
577 | | - if (typeof rangeOrOption.hoverMessage === 'string' && containsCommandLink(rangeOrOption.hoverMessage)) { |
578 | | - usesCommandLink = true; |
579 | | - break; |
580 | | - } else if (Array.isArray(rangeOrOption.hoverMessage)) { |
581 | | - for (const message of rangeOrOption.hoverMessage) { |
582 | | - if (typeof message === 'string' && containsCommandLink(message)) { |
583 | | - usesCommandLink = true; |
584 | | - break outer; |
585 | | - } |
586 | | - } |
587 | | - } |
588 | | - } |
589 | | - // (2) send event for important decorations |
590 | | - if (usesCommandLink) { |
591 | | - let tag = new Error(); |
592 | | - this._extHostExtensions.getExtensionPathIndex().then(index => { |
593 | | - const oldHandler = (<any>Error).prepareStackTrace; |
594 | | - (<any>Error).prepareStackTrace = (error: Error, stackTrace: V8CallSite[]) => { |
595 | | - for (const call of stackTrace) { |
596 | | - const extension = index.findSubstr(call.getFileName()); |
597 | | - if (extension) { |
598 | | - /* __GDPR__ |
599 | | - "usesCommandLink" : { |
600 | | - "extension" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, |
601 | | - "from": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, |
602 | | - "${include}": [ |
603 | | - "${MainThreadData}" |
604 | | - ] |
605 | | - } |
606 | | - */ |
607 | | - this._mainThreadTelemetry.$publicLog('usesCommandLink', { |
608 | | - extension: extension.id, |
609 | | - from: 'decoration', |
610 | | - }); |
611 | | - return; |
612 | | - } |
613 | | - } |
614 | | - }; |
615 | | - // it all happens here... |
616 | | - // tslint:disable-next-line:no-unused-expression |
617 | | - tag.stack; |
618 | | - (<any>Error).prepareStackTrace = oldHandler; |
619 | | - }); |
620 | | - } |
621 | | - |
622 | | - // (3) do it |
623 | | - super.setDecorations(decorationType, rangesOrOptions); |
624 | | - } |
625 | | -} |
626 | | - |
627 | | - |
628 | 553 | function warnOnError(promise: TPromise<any>): void { |
629 | 554 | promise.then(null, (err) => { |
630 | 555 | console.warn(err); |
|
0 commit comments