diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2023-08-17 15:46:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-17 10:46:11 -0400 |
commit | 6de35e4b2e47117deb87ba95acd271ee851fdbd9 (patch) | |
tree | c3ee8534135f0654a53d3f0f5e95ccadb431411d /cli/tsc/99_main_compiler.js | |
parent | 4535f79a4afb3bd58e46b9fbbb216cffe9d05129 (diff) |
fix(lsp): pass fmt options to completion requests (#20184)
Fixes https://github.com/denoland/vscode_deno/issues/856.
Diffstat (limited to 'cli/tsc/99_main_compiler.js')
-rw-r--r-- | cli/tsc/99_main_compiler.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index 43a3c3bcf..f2ccec466 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -1035,10 +1035,8 @@ delete Object.prototype.__proto__; languageService.getEditsForRefactor( request.specifier, { - indentSize: 2, + ...request.formatCodeSettings, indentStyle: ts.IndentStyle.Smart, - semicolons: ts.SemicolonPreference.Insert, - convertTabsToSpaces: true, insertSpaceBeforeAndAfterBinaryOperators: true, insertSpaceAfterCommaDelimiter: true, }, @@ -1060,9 +1058,8 @@ delete Object.prototype.__proto__; request.endPosition, request.errorCodes.map((v) => Number(v)), { - indentSize: 2, + ...request.formatCodeSettings, indentStyle: ts.IndentStyle.Block, - semicolons: ts.SemicolonPreference.Insert, }, { quotePreference: "double", @@ -1080,9 +1077,8 @@ delete Object.prototype.__proto__; }, request.fixId, { - indentSize: 2, + ...request.formatCodeSettings, indentStyle: ts.IndentStyle.Block, - semicolons: ts.SemicolonPreference.Insert, }, { quotePreference: "double", @@ -1100,7 +1096,7 @@ delete Object.prototype.__proto__; request.args.specifier, request.args.position, request.args.name, - {}, + request.args.formatCodeSettings ?? {}, request.args.source, request.args.preferences, request.args.data, @@ -1114,6 +1110,7 @@ delete Object.prototype.__proto__; request.specifier, request.position, request.preferences, + request.formatCodeSettings, ), ); } |