mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
addressed CR feedback
This commit is contained in:
parent
db5b1b387c
commit
3119839d55
@ -1481,20 +1481,7 @@ module FourSlash {
|
||||
}
|
||||
|
||||
public copyFormatOptions(): ts.FormatCodeOptions {
|
||||
return {
|
||||
ConvertTabsToSpaces: this.formatCodeOptions.ConvertTabsToSpaces,
|
||||
IndentSize: this.formatCodeOptions.IndentSize,
|
||||
InsertSpaceAfterCommaDelimiter: this.formatCodeOptions.InsertSpaceAfterCommaDelimiter,
|
||||
InsertSpaceAfterFunctionKeywordForAnonymousFunctions: this.formatCodeOptions.InsertSpaceAfterFunctionKeywordForAnonymousFunctions,
|
||||
InsertSpaceAfterKeywordsInControlFlowStatements: this.formatCodeOptions.InsertSpaceAfterKeywordsInControlFlowStatements,
|
||||
InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: this.formatCodeOptions.InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis,
|
||||
InsertSpaceAfterSemicolonInForStatements: this.formatCodeOptions.InsertSpaceAfterSemicolonInForStatements,
|
||||
InsertSpaceBeforeAndAfterBinaryOperators: this.formatCodeOptions.InsertSpaceBeforeAndAfterBinaryOperators,
|
||||
NewLineCharacter: this.formatCodeOptions.NewLineCharacter,
|
||||
PlaceOpenBraceOnNewLineForControlBlocks: this.formatCodeOptions.PlaceOpenBraceOnNewLineForControlBlocks,
|
||||
PlaceOpenBraceOnNewLineForFunctions: this.formatCodeOptions.PlaceOpenBraceOnNewLineForFunctions,
|
||||
TabSize: this.formatCodeOptions.TabSize
|
||||
}
|
||||
return ts.clone(this.formatCodeOptions);
|
||||
}
|
||||
|
||||
public setFormatOptions(formatCodeOptions: ts.FormatCodeOptions): ts.FormatCodeOptions {
|
||||
|
||||
@ -306,6 +306,13 @@ module ts.formatting {
|
||||
return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options);
|
||||
}
|
||||
|
||||
/*
|
||||
Character is the actual index of the character since the beginning of the line.
|
||||
Column - position of the character after expanding tabs to spaces
|
||||
"0\t2$"
|
||||
value of 'character' for '$' is 3
|
||||
value of 'column' for '$' is 6 (assuming that tab size is 4)
|
||||
*/
|
||||
export function findFirstNonWhitespaceCharacterAndColumn(startPos: number, endPos: number, sourceFile: SourceFile, options: EditorOptions) {
|
||||
var character = 0;
|
||||
var column = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user