Skip to content

Commit 3119839

Browse files
committed
addressed CR feedback
1 parent db5b1b3 commit 3119839

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

src/harness/fourslash.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,20 +1481,7 @@ module FourSlash {
14811481
}
14821482

14831483
public copyFormatOptions(): ts.FormatCodeOptions {
1484-
return {
1485-
ConvertTabsToSpaces: this.formatCodeOptions.ConvertTabsToSpaces,
1486-
IndentSize: this.formatCodeOptions.IndentSize,
1487-
InsertSpaceAfterCommaDelimiter: this.formatCodeOptions.InsertSpaceAfterCommaDelimiter,
1488-
InsertSpaceAfterFunctionKeywordForAnonymousFunctions: this.formatCodeOptions.InsertSpaceAfterFunctionKeywordForAnonymousFunctions,
1489-
InsertSpaceAfterKeywordsInControlFlowStatements: this.formatCodeOptions.InsertSpaceAfterKeywordsInControlFlowStatements,
1490-
InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: this.formatCodeOptions.InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis,
1491-
InsertSpaceAfterSemicolonInForStatements: this.formatCodeOptions.InsertSpaceAfterSemicolonInForStatements,
1492-
InsertSpaceBeforeAndAfterBinaryOperators: this.formatCodeOptions.InsertSpaceBeforeAndAfterBinaryOperators,
1493-
NewLineCharacter: this.formatCodeOptions.NewLineCharacter,
1494-
PlaceOpenBraceOnNewLineForControlBlocks: this.formatCodeOptions.PlaceOpenBraceOnNewLineForControlBlocks,
1495-
PlaceOpenBraceOnNewLineForFunctions: this.formatCodeOptions.PlaceOpenBraceOnNewLineForFunctions,
1496-
TabSize: this.formatCodeOptions.TabSize
1497-
}
1484+
return ts.clone(this.formatCodeOptions);
14981485
}
14991486

15001487
public setFormatOptions(formatCodeOptions: ts.FormatCodeOptions): ts.FormatCodeOptions {

src/services/formatting/smartIndenter.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,13 @@ module ts.formatting {
306306
return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options);
307307
}
308308

309+
/*
310+
Character is the actual index of the character since the beginning of the line.
311+
Column - position of the character after expanding tabs to spaces
312+
"0\t2$"
313+
value of 'character' for '$' is 3
314+
value of 'column' for '$' is 6 (assuming that tab size is 4)
315+
*/
309316
export function findFirstNonWhitespaceCharacterAndColumn(startPos: number, endPos: number, sourceFile: SourceFile, options: EditorOptions) {
310317
var character = 0;
311318
var column = 0;

0 commit comments

Comments
 (0)