@@ -299,23 +299,77 @@ declare module ts.server.protocol {
299299 body ?: RenameResponseBody ;
300300 }
301301
302+ /**
303+ * Editor options
304+ */
305+ export interface EditorOptions {
306+
307+ /** Number of spaces for each tab. Default value is 4. */
308+ tabSize ?: number ;
309+
310+ /** Number of spaces to indent during formatting. Default value is 4. */
311+ indentSize ?: number ;
312+
313+ /** The new line character to be used. Default value is the OS line delimiter. */
314+ newLineCharacter ?: string ;
315+
316+ /** Whether tabs should be converted to spaces. Default value is true. */
317+ convertTabsToSpaces ?: boolean ;
318+ }
319+
320+ /**
321+ * Format options
322+ */
323+ export interface FormatOptions extends EditorOptions {
324+
325+ /** Defines space handling after a comma delimiter. Default value is true. */
326+ insertSpaceAfterCommaDelimiter ?: boolean ;
327+
328+ /** Defines space handling after a semicolon in a for statemen. Default value is true */
329+ insertSpaceAfterSemicolonInForStatements ?: boolean ;
330+
331+ /** Defines space handling after a binary operator. Default value is true. */
332+ insertSpaceBeforeAndAfterBinaryOperators ?: boolean ;
333+
334+ /** Defines space handling after keywords in control flow statement. Default value is true. */
335+ insertSpaceAfterKeywordsInControlFlowStatements ?: boolean ;
336+
337+ /** Defines space handling after function keyword for anonymous functions. Default value is false. */
338+ insertSpaceAfterFunctionKeywordForAnonymousFunctions ?: boolean ;
339+
340+ /** Defines space handling after opening and before closing non empty parenthesis. Default value is false. */
341+ insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis ?: boolean ;
342+
343+ /** Defines whether an open brace is put onto a new line for functions or not. Default value is false. */
344+ placeOpenBraceOnNewLineForFunctions ?: boolean ;
345+
346+ /** Defines whether an open brace is put onto a new line for control blocks or not. Default value is false. */
347+ placeOpenBraceOnNewLineForControlBlocks ?: boolean ;
348+
349+ /** Index operator */
350+ [ key :string ] : string | number | boolean ;
351+ }
352+
302353 /**
303354 * Information found in a configure request.
304355 */
305356 export interface ConfigureRequestArguments {
306- /** Number of spaces for each tab */
307- tabSize : number ;
308- /** Number of spaces to indent during formatting */
309- indentSize : number ;
357+
310358 /**
311359 * Information about the host, for example 'Emacs 24.4' or
312360 * 'Sublime Text version 3075'
313361 */
314- hostInfo : string ;
362+ hostInfo ?: string ;
363+
315364 /**
316365 * If present, tab settings apply only to this file.
317366 */
318367 file ?: string ;
368+
369+ /**
370+ * The format options to use during formatting and other code editing features.
371+ */
372+ formatOptions ?: FormatOptions ;
319373 }
320374
321375 /**
@@ -337,10 +391,6 @@ declare module ts.server.protocol {
337391 * Information found in an "open" request.
338392 */
339393 export interface OpenRequestArgs extends FileRequestArgs {
340- /** Initial tab size of file. */
341- tabSize ?: number ;
342- /** Number of spaces to indent during formatting */
343- indentSize ?: number ;
344394 }
345395
346396 /**
0 commit comments