MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / showCode

Function showCode

src/shared/vscode/utils.ts:236–245  ·  view source on GitHub ↗
(editor: TextEditor, displayRange: Range, highlightRange: Range, selectionRange?: Range)

Source from the content-addressed store, hash-verified

234// where the line ends.
235
236export function showCode(editor: TextEditor, displayRange: Range, highlightRange: Range, selectionRange?: Range): void {
237 if (selectionRange)
238 editor.selection = new Selection(selectionRange.start, selectionRange.end);
239
240 // Ensure the code is visible on screen.
241 editor.revealRange(displayRange, TextEditorRevealType.InCenterIfOutsideViewport);
242
243 // TODO: Implement highlighting
244 // See https://github.com/Microsoft/vscode/issues/45059
245}
246
247function trimTrailingSlashes(s: string) {
248 return s.replace(/[/\\]+$/, "");

Callers 2

goToLocationMethod · 0.90
jumpToLineColInUriMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected