Skip to content

Commit 2c60cf9

Browse files
author
steveluc
committed
Add use of host-configured format options to additional code site.
1 parent 51c64b3 commit 2c60cf9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/server/session.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,9 @@ module ts.server {
465465

466466
var compilerService = project.compilerService;
467467
var position = compilerService.host.lineColToPosition(file, line, col);
468+
var formatOptions = this.projectService.getFormatCodeOptions();
468469
var edits = compilerService.languageService.getFormattingEditsAfterKeystroke(file, position, key,
469-
this.projectService.getFormatCodeOptions());
470+
formatOptions);
470471
// Check whether we should auto-indent. This will be when
471472
// the position is on a line containing only whitespace.
472473
// This should leave the edits returned from
@@ -482,8 +483,8 @@ module ts.server {
482483
if (lineText.search("\\S") < 0) {
483484
// TODO: get these options from host
484485
var editorOptions: ts.EditorOptions = {
485-
IndentSize: 4,
486-
TabSize: 4,
486+
IndentSize: formatOptions.IndentSize,
487+
TabSize: formatOptions.TabSize,
487488
NewLineCharacter: "\n",
488489
ConvertTabsToSpaces: true,
489490
};

0 commit comments

Comments
 (0)