Closed Qluxzz closed 9 months ago
Thank you, seems sane to me. I will probably squash this when merging.
Yeah, go right ahead and squash, I naively assumed that squashing was the default merging strategy.
Unfortunatly this regresses a bit
With your MR
Total parses: 20011; successful parses: 19930; failed parses: 81; success percentage: 99.60%
Main branch
Total parses: 20011; successful parses: 19938; failed parses: 73; success percentage: 99.64%
I guess we should check those 8 cases
I diffed the log files and these are the new regressions.
examples-full/Janiczek/elm-graph/src/Graph.elm 1 ms (ERROR [70, 8] - [77, 9])
examples-full/Kurren123/k-dropdown-container/src/DropdownContainer.elm 0 ms (ERROR [63, 13] - [63, 16])
examples-full/MacCASOutreach/graphicsvg/src/GraphicSVG.elm 11 ms (ERROR [514, 4] - [514, 7])
examples-full/arowM/elm-neat-layout/src/Neat/Internal.elm 1 ms (ERROR [64, 4] - [64, 7])
examples-full/evancz/elm-playground/src/Playground.elm 4 ms (ERROR [828, 2] - [828, 5])
examples-full/folkertdev/elm-brotli/src/RingBuffer.elm 1 ms (ERROR [19, 21] - [19, 24])
examples-full/jeongoon/elmnt-scrollpicker/src/Elmnt/BaseScrollPicker.elm 6 ms (ERROR [248, 32] - [248, 47])
examples-full/pfcoperez/elm-playground/src/Playground.elm 4 ms (ERROR [828, 2] - [828, 5])
I compared the new regressions to the main branch and these new tests catch the regression:
================================================================================
Type declaration with union variant and associated data and line comment on new line
================================================================================
type Foo
= Bar
-- First associated data
Int
--------------------------------------------------------------------------------
(file
(type_declaration
(type)
(upper_case_identifier)
(eq)
(union_variant
(upper_case_identifier)
(line_comment)
(type_ref
(upper_case_qid
(upper_case_identifier))))))
================================================================================
Type declaration with union variant and associated data with line comment on same line
================================================================================
type Foo
= Bar
Int -- First associated data
Float -- Second associated data
--------------------------------------------------------------------------------
(file
(type_declaration
(type)
(upper_case_identifier)
(eq)
(union_variant
(upper_case_identifier)
(type_ref
(upper_case_qid
(upper_case_identifier)))
(line_comment)
(type_ref
(upper_case_qid
(upper_case_identifier))))
(line_comment)))
I'm currently working on a fix.
Running npm run test-full
with the latest changes does now not report any regressions, compared to the main branch.
Total parses: 20011; successful parses: 19938; failed parses: 73; success percentage: 99.64%
LGTM, let's see if this still works in the server
Currently when hovering over
Foo
in VS Code the result is this:The ending line comment is dropped.
However for types with multiple variants, such as the following:
The result when hovering is the following:
The first variant's line comment is included, but not the last one.
The following changes makes it so the ending line comment is included in the correct node text.
I've also verified that these changes have the correct behaviour in the elm-language-server repo with the following tests added to test/hoverProvider.test.ts and using a locally built tree-sitter-elm.wasm version: