diff --git a/src/lsp/cobol_lsp/lsp_request.ml b/src/lsp/cobol_lsp/lsp_request.ml index 337dc136a..8875feb81 100644 --- a/src/lsp/cobol_lsp/lsp_request.ml +++ b/src/lsp/cobol_lsp/lsp_request.ml @@ -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 = diff --git a/test/lsp/lsp_hover.ml b/test/lsp/lsp_hover.ml index 7fa51c180..955e8d468 100644 --- a/test/lsp/lsp_hover.ml +++ b/test/lsp/lsp_hover.ml @@ -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 @@ -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 @@ -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" =