aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/server')
-rw-r--r--src/server/ast.odin22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/server/ast.odin b/src/server/ast.odin
index c6966fa..59e3de2 100644
--- a/src/server/ast.odin
+++ b/src/server/ast.odin
@@ -2,7 +2,6 @@
package server
import "core:fmt"
-import "core:log"
import "core:mem"
import "core:odin/ast"
import "core:odin/parser"
@@ -572,7 +571,26 @@ get_doc :: proc(comment: ^ast.Comment_Group, allocator: mem.Allocator) -> string
tmp: string
for doc in comment.list {
- tmp = strings.concatenate({tmp, "\n", doc.text}, context.temp_allocator)
+ if strings.starts_with(doc.text, "/*") && doc.pos.column != 1 {
+ lines := strings.split(doc.text, "\n", context.temp_allocator)
+ for line, i in lines {
+ if i != 0 && len(line) > 0 {
+ column := 0
+ for column < doc.pos.column - 1 {
+ if line[column] == '\t' || line[column] == ' ' {
+ column += 1
+ } else {
+ break
+ }
+ }
+ tmp = strings.concatenate({tmp, "\n", line[column:]}, context.temp_allocator)
+ } else {
+ tmp = strings.concatenate({tmp, "\n", line}, context.temp_allocator)
+ }
+ }
+ } else {
+ tmp = strings.concatenate({tmp, "\n", doc.text}, context.temp_allocator)
+ }
}
if tmp != "" {