Skip to content

Commit f0fbb87

Browse files
authored
Merge pull request #9 from Huachao/master
Refactor computeIndentLevel method
2 parents 25eb4ce + b168294 commit f0fbb87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/impl/format.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function format(documentText: string, range: Range | undefined, options:
2626
endOffset++;
2727
}
2828
formatText = documentText.substring(formatTextStart, endOffset);
29-
initialIndentLevel = computeIndentLevel(formatText, 0, options);
29+
initialIndentLevel = computeIndentLevel(formatText, options);
3030
} else {
3131
formatText = documentText;
3232
initialIndentLevel = 0;
@@ -164,7 +164,7 @@ function repeat(s: string, count: number): string {
164164
return result;
165165
}
166166

167-
function computeIndentLevel(content: string, offset: number, options: FormattingOptions): number {
167+
function computeIndentLevel(content: string, options: FormattingOptions): number {
168168
let i = 0;
169169
let nChars = 0;
170170
let tabSize = options.tabSize || 4;

0 commit comments

Comments
 (0)