Commit Graph

10288 Commits

Author SHA1 Message Date
Kirill Bulatov
7ac1885449 Properly refresh hints on editor open 2023-06-29 22:25:49 +03:00
Kirill Bulatov
58343563ba Fix hint querying bugs 2023-06-29 22:25:49 +03:00
Kirill Bulatov
debdc3603e Finish rest of the inlay cache logic 2023-06-29 22:25:49 +03:00
Kirill Bulatov
ddcbc73bf0 Implement inlay hint replaces for conflict-less case 2023-06-29 22:25:49 +03:00
Kirill Bulatov
6368cf1a27 Merge excerpt-related hint data, move next_inlay_id into Editor 2023-06-29 22:25:49 +03:00
Kirill Bulatov
8c03e9e122 Move InlayId generation back to InlayCache 2023-06-29 22:25:49 +03:00
Kirill Bulatov
e82b4d8957 Properly handle hint addition queries 2023-06-29 22:25:49 +03:00
Kirill Bulatov
5322aa09b9 Properly handle settings toggle 2023-06-29 22:25:49 +03:00
Kirill Bulatov
8f68688a64 Allow readding inlays with existing ids, move inlay types 2023-06-29 22:25:49 +03:00
Kirill Bulatov
49c00fd571 Generate InlayIds in InlayMap, prepare InlayCache for refactoring 2023-06-29 22:25:49 +03:00
Kirill Bulatov
e217a95fcc Cleanup the warnings 2023-06-29 22:25:49 +03:00
Kirill Bulatov
76d35b7122 Use proper, limited excerpt ranges and manage inlay cache properly 2023-06-29 22:25:49 +03:00
Kirill Bulatov
2b989a9f12 Fix all the tests
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
d4d88252c3 Fix most of the FoldMap random tests with inlays
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
f2c510000b Fix all FoldMap tests (without real inlays inside)
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
29bb6c67b0 Fix first FoldMap methods after the map move
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
9ae611fa89 Fix InlayMap bugs after the map order revers
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
05dc672c2a Apply questionable changes to make things compile 2023-06-29 22:25:49 +03:00
Kirill Bulatov
10765d69f4 Move inlay map to be the first one
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
e744fb8842 Avoid having carriage returns (\r) in inlays
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
d2fef07782 Remove the SuggestionMap
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
8cdf1a0faf Switch over to inlay map for Copilot suggestions
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Antonio Scandurra
89137e2e83 Fix InlayMap::buffer_rows 2023-06-29 22:25:49 +03:00
Kirill Bulatov
34c6d66d04 Implement InlayBufferRows properly
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
bec9c26fa2 Fix more inlay_map corner cases and hangings
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
02e124cec4 Fix inlay map tests
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
b231fa47af Apply hints setings on startup 2023-06-29 22:25:49 +03:00
Kirill Bulatov
c898298c5c Properly update inlay hints when settings are changed 2023-06-29 22:25:49 +03:00
Kirill Bulatov
1ed52276e0 Add inlay hint settings 2023-06-29 22:25:49 +03:00
Kirill Bulatov
ea837a183b Store inlays per paths and query on editor open 2023-06-29 22:25:49 +03:00
Kirill Bulatov
8acc5cf8f4 Deserialize more LSP inlay hint information 2023-06-29 22:25:49 +03:00
Kirill Bulatov
f155f5ded7 Better rpc inlay hint handling 2023-06-29 22:25:49 +03:00
Kirill Bulatov
b3aa75a363 Refresh inlays on buffer reopens 2023-06-29 22:25:49 +03:00
Kirill Bulatov
e1f22c3684 Cache anchors from all versions, remove out of range hints 2023-06-29 22:25:49 +03:00
Kirill Bulatov
7abaf22b93 Generate proper inlay diffs for splice 2023-06-29 22:25:49 +03:00
Kirill Bulatov
6d1068d1e9 Query inlay hints for excerpt ranges only 2023-06-29 22:25:49 +03:00
Kirill Bulatov
271cd25a1d Display excerpt-ranged hints only 2023-06-29 22:25:49 +03:00
Kirill Bulatov
addb62c1fc Fix the duplicate hints
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
63074c5cd8 Better bias selection for hints that prefix the type
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Antonio Scandurra
2b1b1225f5 Simplify InlayMap::splice interface 2023-06-29 22:25:49 +03:00
Antonio Scandurra
7684a26daa Fix point/offset translation and clipping in the InlayMap
This makes all randomized tests pass. We're only missing `buffer_rows`
now and we should move the map right above `MultiBuffer` and below `FoldMap`.
2023-06-29 22:25:49 +03:00
Kirill Bulatov
c7fa8dbc70 React with inlay updates on excerpt events 2023-06-29 22:25:49 +03:00
Kirill Bulatov
df20a43704 Reuse the copilot suggestion style for inlays 2023-06-29 22:25:49 +03:00
Kirill Bulatov
8a64b07622 Fixed inlay hints' edits generation and moved on with the randomized
test

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Antonio Scandurra
e280483c5f Make the randomized tests pass
Right now we only check that the text is correct, but I think
we're getting there.
2023-06-29 22:25:49 +03:00
Kirill Bulatov
afa59eed01 Fix the randomized tests
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
f940104b6f Add inlay hint randomization in the text
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
dbd4b33568 Fix splice edits generation
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
9ce9b73879 Generate edits for inlay hints
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
f5f495831a Add inlay hints randomized test, fix the errors
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:25:49 +03:00