mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-05 17:23:51 -05:00
Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)
* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 * fix config changes * fix strictnull checks
This commit is contained in:
@@ -144,11 +144,11 @@ function withFormatting(text: string, edit: Edit, formattingOptions: FormattingO
|
||||
|
||||
// apply the formatting edits and track the begin and end offsets of the changes
|
||||
for (let i = edits.length - 1; i >= 0; i--) {
|
||||
const edit = edits[i];
|
||||
newText = applyEdit(newText, edit);
|
||||
begin = Math.min(begin, edit.offset);
|
||||
end = Math.max(end, edit.offset + edit.length);
|
||||
end += edit.content.length - edit.length;
|
||||
const curr = edits[i];
|
||||
newText = applyEdit(newText, curr);
|
||||
begin = Math.min(begin, curr.offset);
|
||||
end = Math.max(end, curr.offset + curr.length);
|
||||
end += curr.content.length - curr.length;
|
||||
}
|
||||
// create a single edit with all changes
|
||||
const editLength = text.length - (newText.length - end) - begin;
|
||||
@@ -182,4 +182,4 @@ export function applyEdits(text: string, edits: Edit[]): string {
|
||||
|
||||
export function isWS(text: string, offset: number) {
|
||||
return '\r\n \t'.indexOf(text.charAt(offset)) !== -1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user