Merge branch 'master' into import_completions_pr

This commit is contained in:
Richard Knoll
2016-07-05 16:26:46 -07:00
610 changed files with 16534 additions and 3223 deletions

View File

@@ -588,7 +588,7 @@ namespace ts.server {
throw new Error("Not Implemented Yet.");
}
isValidBraceCompletionAtPostion(fileName: string, position: number, openingBrace: number): boolean {
isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): boolean {
throw new Error("Not Implemented Yet.");
}

View File

@@ -1574,6 +1574,7 @@ namespace ts.server {
static getDefaultFormatCodeOptions(host: ServerHost): ts.FormatCodeOptions {
return ts.clone({
BaseIndentSize: 0,
IndentSize: 4,
TabSize: 4,
NewLineCharacter: host.newLine || "\n",
@@ -1587,6 +1588,7 @@ namespace ts.server {
InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false,
InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false,
InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false,
InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false,
PlaceOpenBraceOnNewLineForFunctions: false,
PlaceOpenBraceOnNewLineForControlBlocks: false,
});

View File

@@ -438,6 +438,9 @@ declare namespace ts.server.protocol {
/** Number of spaces to indent during formatting. Default value is 4. */
indentSize?: number;
/** Number of additional spaces to indent during formatting to preserve base indentation (ex. script block indentation). Default value is 0. */
baseIndentSize?: number;
/** The new line character to be used. Default value is the OS line delimiter. */
newLineCharacter?: string;
@@ -478,7 +481,7 @@ declare namespace ts.server.protocol {
placeOpenBraceOnNewLineForControlBlocks?: boolean;
/** Index operator */
[key: string]: string | number | boolean;
[key: string]: string | number | boolean | undefined;
}
/**

View File

@@ -703,6 +703,7 @@ namespace ts.server {
if (lineText.search("\\S") < 0) {
// TODO: get these options from host
const editorOptions: ts.EditorOptions = {
BaseIndentSize: formatOptions.BaseIndentSize,
IndentSize: formatOptions.IndentSize,
TabSize: formatOptions.TabSize,
NewLineCharacter: formatOptions.NewLineCharacter,