Skip to content

Commit

Permalink
more comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlyu123 committed Sep 26, 2023
1 parent a98d975 commit 86230c7
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Document, TagInformation } from '../documents';
/**
*
* 1. check tab and space counts for lines
* 2. if there're mixing space and tab guess the tabSize
* 2. if there're mixing space and tab guess the tabSize otherwise we only need to compare the numbers of spaces or tabs between lines.
*/
export function indentBasedFoldingRangeForTag(
document: Document,
Expand Down Expand Up @@ -131,6 +131,11 @@ function collectIndents(line: string) {
return { tabCount, spaceCount, empty };
}

/**
*
* The indentation guessing is based on the indentation difference between lines.
* And if the count equals, then the one used more often takes priority.
*/
export function guessTabSize(
nonEmptyLines: Array<{ spaceCount: number; tabCount: number }>
): number {
Expand Down

0 comments on commit 86230c7

Please sign in to comment.