aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2021-03-13 12:17:21 +0100
committerDanielGavin <danielgavin5@hotmail.com>2021-03-13 12:17:21 +0100
commita8cfb48af3586903ec07dc518932b317c248012c (patch)
treef2b282545223685428d82af78f705a4b005832c4 /src
parent71858cbde659212a5ee0eec2ee6fd9498b41107e (diff)
remove import on formatter, since it's not in the real odin version yet.
Diffstat (limited to 'src')
-rw-r--r--src/server/format.odin38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/server/format.odin b/src/server/format.odin
index 40bdaa5..180d0d2 100644
--- a/src/server/format.odin
+++ b/src/server/format.odin
@@ -2,7 +2,8 @@ package server
import "shared:common"
-import "core:odin/printer"
+
+//import "core:odin/printer"
FormattingOptions :: struct {
tabSize: uint,
@@ -25,32 +26,31 @@ TextEdit :: struct {
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,
+ start = {
+ character = 0,
+ line = 0,
+ },
+ end = {
+ character = 1,
+ line = end_line + 1,
+ },
},
- 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;
+ return {}, true;
}