Adopts debug.description.

Implemented for:
* Position: (11:12)
* Range: [11:12 -> 13:11)
* Selection: |[11:12 -> 13:11)
* TextDocument: TextDocument(file:///test.txt)
* NotebookDocument: NotebookDocument(file:///test.txt)
* TextEditor: TextEditor(file:///test.txt, [11:12 -> 13:11))
* NotebookEditor: NotebookEditor(file:///test.txt)
* URI: URI(file:///test.txt)

Fixes #191390

Signed-off-by: Henning Dieterichs <hdieterichs@microsoft.com>
This commit is contained in:
Henning Dieterichs
2024-06-18 20:05:48 +02:00
committed by Henning Dieterichs
parent 865269335e
commit a35bb46e9b
6 changed files with 48 additions and 1 deletions

View File

@@ -11,7 +11,7 @@ import { IRange } from 'vs/editor/common/core/range';
import { ISingleEditOperation } from 'vs/editor/common/core/editOperation';
import { IResolvedTextEditorConfiguration, ITextEditorConfigurationUpdate, MainThreadTextEditorsShape } from 'vs/workbench/api/common/extHost.protocol';
import * as TypeConverters from 'vs/workbench/api/common/extHostTypeConverters';
import { EndOfLine, Position, Range, Selection, SnippetString, TextEditorLineNumbersStyle, TextEditorRevealType } from 'vs/workbench/api/common/extHostTypes';
import { EndOfLine, getDebugDescriptionOfSelection, Position, Range, Selection, SnippetString, TextEditorLineNumbersStyle, TextEditorRevealType } from 'vs/workbench/api/common/extHostTypes';
import type * as vscode from 'vscode';
import { ILogService } from 'vs/platform/log/common/log';
import { Lazy } from 'vs/base/common/lazy';
@@ -566,6 +566,9 @@ export class ExtHostTextEditor {
},
hide() {
_proxy.$tryHideEditor(id);
},
[Symbol.for('debug.description')]() {
return `TextEditor(${this.document.uri.toString()}, ${this.selections.map(s => getDebugDescriptionOfSelection(s)).join(', ')})`;
}
});
}