Skip to content

Commit

Permalink
fix: don't remove the space between marker and com
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoKaios committed Aug 13, 2024
1 parent defdb52 commit 5c12525
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/lsp/cobol_lsp/lsp_request.ml
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,8 @@ let doc_of_datadef ~rev_comments ~filename data_def =
end (None, None) rev_comments
in
match inline, full_line with
| Some comment, _ -> "\n---\n" ^ String.sub comment 3 (String.length comment - 3)
| None, Some comment -> "\n---\n" ^ String.sub comment 2 (String.length comment - 2)
| Some comment, _ -> "\n---\n" ^ String.sub comment 2 (String.length comment - 2)
| None, Some comment -> "\n---\n" ^ String.sub comment 1 (String.length comment - 1)
| _ -> ""

let lookup_data_definition_for_hover cu_name element_at_pos group =
Expand Down
6 changes: 3 additions & 3 deletions test/lsp/lsp_hover.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,7 @@ let%expect_test "hover-comment" =
Group of 2 subfields
Size: 16 bits
---
inline comment
inline comment
(line 12, character 25):
__rootdir__/prog.cob:13.24-13.29:
10 * val2 only line comment
Expand All @@ -1195,7 +1195,7 @@ let%expect_test "hover-comment" =
```
ALPHANUMERIC(1)
---
val1 only inline comment
val1 only inline comment
(line 12, character 31):
__rootdir__/prog.cob:13.30-13.35:
10 * val2 only line comment
Expand All @@ -1213,7 +1213,7 @@ let%expect_test "hover-comment" =
```
ALPHANUMERIC(1)
---
val2 only line comment |}];;
val2 only line comment |}];;


let%expect_test "hover-comment-copy" =
Expand Down

0 comments on commit 5c12525

Please sign in to comment.