aboutsummaryrefslogtreecommitdiff
path: root/src/server/format.odin
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2021-03-12 16:31:09 +0100
committerDanielGavin <danielgavin5@hotmail.com>2021-03-12 16:31:09 +0100
commit00ccd7e03e17dac40efb9b34a048d968dd77c218 (patch)
tree24e9e8d9743bc3e98b63183d1f976b11ab6d93d2 /src/server/format.odin
parentbaf86e02a2c45170d58ab828a13f52361129b255 (diff)
ran odinfmt on project
Diffstat (limited to 'src/server/format.odin')
-rw-r--r--src/server/format.odin46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/server/format.odin b/src/server/format.odin
index 46d21e2..3ad492c 100644
--- a/src/server/format.odin
+++ b/src/server/format.odin
@@ -5,51 +5,51 @@ import "shared:common"
import "core:odin/printer"
FormattingOptions :: struct {
- tabSize: uint,
- insertSpaces: bool, //tabs or spaces
+ tabSize: uint,
+ insertSpaces: bool, //tabs or spaces
trimTrailingWhitespace: bool,
- insertFinalNewline: bool,
- trimFinalNewlines: bool,
+ insertFinalNewline: bool,
+ trimFinalNewlines: bool,
}
DocumentFormattingParams :: struct {
textDocument: TextDocumentIdentifier,
- options: FormattingOptions,
+ options: FormattingOptions,
}
TextEdit :: struct {
- range: common.Range,
+ range: common.Range,
newText: string,
}
-get_complete_format :: proc(document: ^Document) -> ([] TextEdit, bool) {
+get_complete_format :: proc (document: ^Document) -> ([]TextEdit, bool) {
/*
- prnt := printer.make_printer(printer.default_style, context.temp_allocator);
+ prnt := printer.make_printer(printer.default_style, context.temp_allocator);
- printer.print_file(&prnt, &document.ast);
+ printer.print_file(&prnt, &document.ast);
- end_line := document.ast.decls[len(document.ast.decls)-1].end.line;
+ end_line := document.ast.decls[len(document.ast.decls)-1].end.line;
- edit := TextEdit {
+ edit := TextEdit {
newText = printer.to_string(prnt),
range = {
- start = {
- character = 0,
- line = 0,
- },
- end = {
- character = 1,
- line = end_line + 1,
- }
+ start = {
+ character = 0,
+ line = 0,
+ },
+ end = {
+ character = 1,
+ line = end_line + 1,
}
- };
+ }
+ };
- edits := make([dynamic] TextEdit, context.temp_allocator);
+ edits := make([dynamic] TextEdit, context.temp_allocator);
- append(&edits, edit);
+ append(&edits, edit);
- return edits[:], true;
+ return edits[:], true;
*/
return {}, false;