mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-16 05:21:13 -06:00
use server side format code options matching arguments is omitted
This commit is contained in:
parent
6374a3f055
commit
71a3d0a42f
2
src/server/protocol.d.ts
vendored
2
src/server/protocol.d.ts
vendored
@ -111,7 +111,7 @@ declare namespace ts.server.protocol {
|
||||
}
|
||||
|
||||
export interface IndentationRequestArgs extends FileLocationRequestArgs {
|
||||
options: EditorSettings;
|
||||
options?: EditorSettings;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -783,7 +783,8 @@ namespace ts.server {
|
||||
private getIndentation(args: protocol.IndentationRequestArgs) {
|
||||
const { file, project } = this.getFileAndProject(args);
|
||||
const position = this.getPosition(args, project.getScriptInfoForNormalizedPath(file));
|
||||
const indentation = project.languageService.getIndentationAtPosition(file, position, args.options);
|
||||
const options = args.options || this.projectService.getFormatCodeOptions(file);
|
||||
const indentation = project.languageService.getIndentationAtPosition(file, position, options);
|
||||
return { position, indentation };
|
||||
}
|
||||
|
||||
@ -855,17 +856,20 @@ namespace ts.server {
|
||||
|
||||
private getFormattingEditsForRangeFull(args: protocol.FormatRequestArgs) {
|
||||
const { file, project } = this.getFileAndProject(args);
|
||||
return project.languageService.getFormattingEditsForRange(file, args.position, args.endPosition, args.options);
|
||||
const options = args.options || this.projectService.getFormatCodeOptions(file);
|
||||
return project.languageService.getFormattingEditsForRange(file, args.position, args.endPosition, options);
|
||||
}
|
||||
|
||||
private getFormattingEditsForDocumentFull(args: protocol.FormatRequestArgs) {
|
||||
const { file, project } = this.getFileAndProject(args);
|
||||
return project.languageService.getFormattingEditsForDocument(file, args.options);
|
||||
const options = args.options || this.projectService.getFormatCodeOptions(file);
|
||||
return project.languageService.getFormattingEditsForDocument(file, options);
|
||||
}
|
||||
|
||||
private getFormattingEditsAfterKeystrokeFull(args: protocol.FormatOnKeyRequestArgs) {
|
||||
const { file, project } = this.getFileAndProject(args);
|
||||
return project.languageService.getFormattingEditsAfterKeystroke(file, args.position, args.key, args.options);
|
||||
const options = args.options || this.projectService.getFormatCodeOptions(file);
|
||||
return project.languageService.getFormattingEditsAfterKeystroke(file, args.position, args.key, options);
|
||||
}
|
||||
|
||||
private getFormattingEditsAfterKeystroke(args: protocol.FormatOnKeyRequestArgs): protocol.CodeEdit[] {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user