Merge pull request #5197 from Microsoft/supportIndentStyle

Support different indentation styles
This commit is contained in:
Paul van Brenk
2015-10-09 16:46:31 -07:00
committed by Paul van Brenk
parent 12b436bb2c
commit 573652160c
8 changed files with 426 additions and 12 deletions

View File

@@ -1177,6 +1177,7 @@ namespace ts.server {
TabSize: 4,
NewLineCharacter: ts.sys ? ts.sys.newLine : '\n',
ConvertTabsToSpaces: true,
IndentStyle: ts.IndentStyle.Smart,
InsertSpaceAfterCommaDelimiter: true,
InsertSpaceAfterSemicolonInForStatements: true,
InsertSpaceBeforeAndAfterBinaryOperators: true,
@@ -1187,7 +1188,6 @@ namespace ts.server {
PlaceOpenBraceOnNewLineForFunctions: false,
PlaceOpenBraceOnNewLineForControlBlocks: false,
}
}
export interface LineCollection {

View File

@@ -606,6 +606,7 @@ namespace ts.server {
TabSize: formatOptions.TabSize,
NewLineCharacter: "\n",
ConvertTabsToSpaces: formatOptions.ConvertTabsToSpaces,
IndentStyle: ts.IndentStyle.Smart,
};
var indentPosition =
compilerService.languageService.getIndentationAtPosition(file, position, editorOptions);