Max Brunsfeld
92df76e632
Fix accidental ignoring of git FS events
2023-06-30 11:20:50 -07:00
Kirill Bulatov
167dd1c5d2
Support basic inlay hints ( #2660 )
...
Part of https://github.com/zed-industries/community/issues/138
Part of https://linear.app/zed-industries/issue/Z-477/inlay-hints
Supports LSP requests for inlay hints, LSP /refresh request to reload
them.
Reworks DisplayMap and underlying layer to unite suggestions with inlay
hints into new, `InlayMap`.
Adds a hint cache inside `Editor` that tracks buffer/project/LSP request
events, updates the hints and ensures opened editors are showing up to
date text hints on top.
Things left to do after this PR:
* docs on how to configure inlay hints
* blogpost
* dynamic hints: resolve, hover, navigation on click, etc.
Release Notes:
- Added basic support of inlay hints
2023-06-29 22:49:39 +03:00
Kirill Bulatov
b146762f68
Remove a flacky test, fix the failing one
2023-06-29 22:45:04 +03:00
Kirill Bulatov
652909cdba
Post-rebase fixes
2023-06-29 22:39:33 +03:00
Kirill Bulatov
3445bc42b6
Invalidate refresh tasks better
2023-06-29 22:39:18 +03:00
Kirill Bulatov
98edc0f885
Simplify the hint cache code
2023-06-29 22:39:18 +03:00
Kirill Bulatov
083e4e76e2
Better tests, invalidate multibuffer excerpts better
2023-06-29 22:39:18 +03:00
Kirill Bulatov
943c93fda7
Simplify hint task queueing
2023-06-29 22:39:18 +03:00
Kirill Bulatov
30e77aa388
More inlay hint cache tests
2023-06-29 22:39:18 +03:00
Kirill Bulatov
429a9cddae
Use fold points to go to display map's prev/next line boundary
...
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:39:18 +03:00
Kirill Bulatov
bb9ade5b6f
Fix wrap map test
...
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:39:18 +03:00
Kirill Bulatov
2b59f27c3b
Fix fold map tests
...
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:39:18 +03:00
Kirill Bulatov
0972766d1d
Add more hint tests
2023-06-29 22:39:18 +03:00
Kirill Bulatov
15e0feb91d
Move highlights from fold to inlay randomized tests
2023-06-29 22:39:18 +03:00
Kirill Bulatov
667b70afde
Move hint settings on the language level
2023-06-29 22:39:18 +03:00
Kirill Bulatov
480d8c511b
Theme hints and suggestions differently
2023-06-29 22:39:18 +03:00
Kirill Bulatov
3312c9114b
Improve inlay hint highlights
...
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:39:18 +03:00
Kirill Bulatov
2c54d926ea
Test inlay hint cache
2023-06-29 22:39:18 +03:00
Nate Butler
143a020694
Update Hint Style
...
zzz
2023-06-29 22:39:17 +03:00
Kirill Bulatov
67214f0e55
Only skip /refresh inlay queries when vislble range is not updated
2023-06-29 22:25:50 +03:00
Kirill Bulatov
096bad1f73
Revert useless changes, simplify
2023-06-29 22:25:50 +03:00
Antonio Scandurra
f77b680db9
Account for inlay biases when clipping a point
2023-06-29 22:25:50 +03:00
Antonio Scandurra
976edfedf7
Add Cursor::next_item
2023-06-29 22:25:50 +03:00
Kirill Bulatov
5c21ed4263
Properly filter out task hints
2023-06-29 22:25:50 +03:00
Kirill Bulatov
dfb30218ca
Remove mutex usage from *Map contents
2023-06-29 22:25:50 +03:00
Kirill Bulatov
acef5ff195
Query hints when editors gets open and visible
2023-06-29 22:25:50 +03:00
Kirill Bulatov
11fee4ce42
Do not eagerly cancel running tasks
2023-06-29 22:25:49 +03:00
Kirill Bulatov
4d4544f680
Split excerpts into mutliple ranges for inlay hint queries
2023-06-29 22:25:49 +03:00
Kirill Bulatov
2c7900e11b
Use excerpt visible range in query filtering
2023-06-29 22:25:49 +03:00
Kirill Bulatov
83b3a914bc
Support better inlay cache parallelization
2023-06-29 22:25:49 +03:00
Kirill Bulatov
890b164278
Forward inlay hint refresh requests to clients, test coop inlay hints
2023-06-29 22:25:49 +03:00
Kirill Bulatov
a68e68a0d9
Properly filter out new hints outside of excerpts' visible ranges
2023-06-29 22:25:49 +03:00
Kirill Bulatov
ba3d1e4dba
Deduplicate inlay hints queries with buffer versions
2023-06-29 22:25:49 +03:00
Kirill Bulatov
f25a09bfd8
Avoid excessive allocations with Arc around excerpt cached inlays
2023-06-29 22:25:49 +03:00
Kirill Bulatov
48982c3036
Filter away new hints not in excerpt range
2023-06-29 22:25:49 +03:00
Kirill Bulatov
316e19ce94
Remove stale cancelled inlay hints workaround
2023-06-29 22:25:49 +03:00
Kirill Bulatov
96a34ad0ee
Use text anchors as hint position in hints cache
...
co-authored-by: Max Brunsfeld <max@zed.dev>
2023-06-29 22:25:49 +03:00
Kirill Bulatov
781fa0cff4
Deduplicate LSP requests on multibuffer scroll
2023-06-29 22:25:49 +03:00
Kirill Bulatov
c61de29c11
Use proper anchors for remote LSP queries
2023-06-29 22:25:49 +03:00
Kirill Bulatov
cb4b92aa61
Simplify hint event management slightly
2023-06-29 22:25:49 +03:00
Kirill Bulatov
d59e91aff2
Insert new hints into cache better
2023-06-29 22:25:49 +03:00
Kirill Bulatov
d6828583d8
Box the cache for better performance
2023-06-29 22:25:49 +03:00
Kirill Bulatov
1722d61190
Mitigate odd offset calculations
2023-06-29 22:25:49 +03:00
Kirill Bulatov
7fddc223cd
Move away heavy inlay computations into background tasks
2023-06-29 22:25:49 +03:00
Kirill Bulatov
31f0f9f7b1
Forbid extra inlay updates
2023-06-29 22:25:49 +03:00
Kirill Bulatov
97e5d40579
Add snapshot version to use when avoiding wrong state updates
2023-06-29 22:25:49 +03:00
Kirill Bulatov
8d982a6c2d
Finish modelling
2023-06-29 22:25:49 +03:00
Kirill Bulatov
4c78019317
Start to model the background threads for InlayHintCache
2023-06-29 22:25:49 +03:00
Kirill Bulatov
2f1a27631e
React on multibuffer scrolls again
2023-06-29 22:25:49 +03:00
Kirill Bulatov
a31d3eca45
Spawn cache updates in separate tasks
2023-06-29 22:25:49 +03:00