mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
Consolidate wrapWithAbbreviation and wrapIndividualLinesWithAbbreviation in one command (#116603)
fixes #109191, fixes #116738
This commit is contained in:
@@ -374,6 +374,16 @@ export function getHtmlFlatNode(documentText: string, root: FlatNode | undefined
|
||||
return currentNode;
|
||||
}
|
||||
|
||||
export function isOffsetInsideOpenOrCloseTag(node: FlatNode, offset: number): boolean {
|
||||
const htmlNode = node as HtmlFlatNode;
|
||||
if ((htmlNode.open && offset > htmlNode.open.start && offset < htmlNode.open.end)
|
||||
|| (htmlNode.close && offset > htmlNode.close.start && offset < htmlNode.close.end)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
export function offsetRangeToSelection(document: vscode.TextDocument, start: number, end: number): vscode.Selection {
|
||||
const startPos = document.positionAt(start);
|
||||
const endPos = document.positionAt(end);
|
||||
|
||||
Reference in New Issue
Block a user