aboutsummaryrefslogtreecommitdiff
path: root/src/server/format.odin
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2024-08-10 18:16:26 +0200
committerDanielGavin <danielgavin5@hotmail.com>2024-08-10 18:16:26 +0200
commit64b23cd4ca41bfd44a83f945b0704df1021e7c9c (patch)
tree0f2620f2c45d0fba965a94ab1665b5d4d06c986f /src/server/format.odin
parentfe8353ad6e852275570b6fb90e472f3f96d445f7 (diff)
Change odinfmt to use 120 characters instead. Add support for infering Maybe in comp literals.
Diffstat (limited to 'src/server/format.odin')
-rw-r--r--src/server/format.odin16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/server/format.odin b/src/server/format.odin
index fbf9837..c518532 100644
--- a/src/server/format.odin
+++ b/src/server/format.odin
@@ -20,13 +20,7 @@ DocumentFormattingParams :: struct {
options: FormattingOptions,
}
-get_complete_format :: proc(
- document: ^Document,
- config: ^common.Config,
-) -> (
- []TextEdit,
- bool,
-) {
+get_complete_format :: proc(document: ^Document, config: ^common.Config) -> ([]TextEdit, bool) {
if document.ast.syntax_error_count > 0 {
return {}, true
}
@@ -39,18 +33,14 @@ get_complete_format :: proc(
fix_imports(document)
}
- style := format.find_config_file_or_default(
- filepath.dir(document.fullpath, context.temp_allocator),
- )
+ style := format.find_config_file_or_default(filepath.dir(document.fullpath, context.temp_allocator))
prnt := printer.make_printer(style, context.temp_allocator)
src := printer.print(&prnt, &document.ast)
edit := TextEdit {
newText = src,
- range = common.get_document_range(
- document.text[0:document.used_text],
- ),
+ range = common.get_document_range(document.text[0:document.used_text]),
}
edits := make([dynamic]TextEdit, context.temp_allocator)