Duane Bester
3c23ee9be4
editor: Add InlineCompletion LSP support ( #1736 )
...
Closes [1729](https://github.com/longbridge/gpui-component/issues/1729 )
## Description
Adds support for inline completions, which allows the editor to support
agentic "tab to complete" solutions. This works, (tested macOS), but not
sure of any gotchas or different approaches.
## Screenshot
https://github.com/user-attachments/assets/8e437f1e-9792-4417-b070-0a1dd8de6024
## How to Test
User implements the `inline_completion` method in CompletionsProvider.
Not implementing should have no effect.
## Checklist
- [x] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and
followed the guidelines.
- [x] Reviewed the changes in this PR and confirmed AI generated code
(If any) is accurate.
- [x] Passed `cargo run` for story tests related to the changes.
- [ ] Tested macOS, Windows and Linux platforms performance (if the
change is platform-specific)
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-12-08 10:53:36 +08:00
Jason Lee
6c4de54fa4
theme: Use font_family for all elements. ( #1618 )
...
Close #1613
- And add `mono_font_family` and `mono_font_size` for code editor.
2025-11-17 03:18:17 +00:00
Jason Lee
37d1678b6f
assets: Add gpui-component-assets crate. ( #1601 )
2025-11-14 15:03:26 +08:00
Jason Lee
724ccd64a7
chore: Add ui folder to Cargo default-members. ( #1600 )
...
This to help `cargo test` default will test `ui` and `story`.
2025-11-14 06:16:03 +00:00
Jason Lee
945db0be56
dialog: Rename Modal to Dialog. ( #1538 )
...
## Break Change
- Renamed `Modal` to `Dialog`.
```diff
- window.open_modal(...)
+ window.open_dialog(...)
- window.close_modal(...);
+ window.close_dialog(...);
```
- Renamed `show_close` method to `close_button` in Dialog.
```diff
- .show_close(false)
+ .close_button(true)
```
2025-11-07 17:25:55 +08:00
Jason Lee
80689264e2
sheet: Rename Drawer to Sheet. ( #1527 )
...
## Break Change
- Renamed `Drawer` to `Sheet`, also renamed relative method contains
`drawer` to `sheet`.
- Renamed `ContextModal` to `WindowExt`.
```diff
- use gpui_component::drawer::Drawer
+ use gpui_component::sheet::Sheet
- use gpui_component::ContextModal
+ use gpui_component::WindowExt
```
2025-11-06 07:19:10 +00:00
Jason Lee
4b3fb51fb8
editor: Fix indent guides render position. ( #1524 )
2025-11-05 13:17:32 +00:00
Jason Lee
998a5fd922
chore: Standardize the overall API and improve docs. ( #1516 )
2025-11-05 19:10:30 +08:00
Jason Lee
e75c37a1ac
chore: Update List, Tree, Kbd exports. ( #1467 )
...
## Break Change
- Removed `Kbd` from root export, use `gpui_component::kbd::Kbd`
instead.
- Removed `List` from root export, use `gpui_component::list::*`
instead.
- Removed `Tree` from root export, use `gpui_component::tree:*` instead.
2025-10-30 07:19:39 +00:00
Jason Lee
2727a65494
resizable: Simplify Resizable API. ( #1459 )
...
- Added `on_resize` callback method to `ResizabelPanelGroup`.
## Break Changes
- Remove `state` argument from `h_resizable`, `v_resizable` method.
```diff
- v_resizable("resizable-1", state)
+ v_resizable("resizable-1")
```
- Removed `group` method from `ResizabelPanelGroup`, use `child`
instead.
```diff
- v_resizable(..).group(..)
+ v_resizable(..).child(..)
```
2025-10-29 23:01:05 +08:00
Jason Lee
a1ca8624af
example: Add file tree to Editor example. ( #1457 )
...
<img width="1205" height="861" alt="image"
src="https://github.com/user-attachments/assets/4b3814cd-7dc0-4fc1-8f0f-d98d7cc29294 "
/>
2025-10-29 12:58:40 +00:00
Jason Lee
34ef0ff6d0
chore: Rename Dropdown to Select, TextInput to Input. ( #1449 )
...
## Break Change
- The `Dropdown` has been renamed to `Select`.
- The `TextInput` has been renamed to `Input`.
| Before | After |
| --- | --- |
| TextInput | Input |
| Dropdown | Select |
| DropdownItem | SelectItem |
| DropdownItemGroup | SelectGroup |
| DropdownState | SelectState |
| DropdownEvent | SelectEvent |
| DropdownDelegate | SelectDelegate |
| dropdown::ListEvent | ~~Removed~~ |
- Renamed `PopupMenuExt` to `DropdownMenu`.
- Removed pub mod `menu::popup_menu`, `menu::context_menu`, they are
moved into `menu` mod.
- Renamed `popup_menu` method to `dropdown_menu` for `DropdownMenu`,
`Panel`, `PanelView` and `DropdownButton`.
| Before | After |
| --- | --- |
| popup_menu::PopupMenuExt | menu::DropdownMenu |
| popup_menu | dropdown_menu |
| popup_menu_with_anchor | dropdown_menu_with_anchor |
2025-10-28 21:22:31 +08:00
Jason Lee
6ebb9418a0
editor: Use measure_indent_width for indent guides width. ( #1428 )
...
Continue #1426 , this changes I was forgotten to push before #1426
merged.
2025-10-24 20:18:30 +08:00
Jason Lee
178269be63
editor: Add indent guides. ( #1426 )
...
<img width="1070" height="1006" alt="image"
src="https://github.com/user-attachments/assets/a456b055-b45f-45ae-84b0-452a952cc19c "
/>
2025-10-24 19:03:09 +08:00
Jason Lee
2574e7f812
story: Add open file to Markdown and Editor example. ( #1363 )
...
Close #1352
2025-10-13 11:52:16 +08:00
Jason Lee
6817c8d3cc
menu: Add AppMenuBar. ( #1338 )
...
- input: Change Input to not unselect when blur.
- popup_menu: Fix get key binding on PopupMenu with action context.
<img width="935" height="694" alt="image"
src="https://github.com/user-attachments/assets/295fa84e-f1d8-4f6f-8a77-601a45f8ad6d "
/>
## TODO
- [x] Keyboard support.
- [x] Add submenu to example.
- [ ] ~~Icon~~ and check support. Wait
https://github.com/zed-industries/zed/pull/39876
2025-10-10 21:03:16 +08:00
Jason Lee
d0396d779e
editor: Add document_colors LSP. ( #1329 )
2025-10-06 18:08:12 +08:00
Jason Lee
cfd060b66d
editor: Split Input and Editor background color. ( #1323 )
...
Keep input to use window background color, the `editor.background` only
for Editor mode.
2025-10-03 11:20:01 +08:00
Sunli
34b570cd8f
text_view: Refactor TextView, SyntaxHighlighter to use async to parsing. ( #1299 )
...
1. Parse content in the background thread
2. Remove unnecessary clones
3. `TextViewStyle` and `LanguageRegistry` can now be used across threads
2025-09-29 14:04:24 +08:00
Jason Lee
1c3eca93b8
editor: Revert to use ropey. ( #1284 )
...
For the License reason.
- The performance is slow down, before version can handle 200K lines,
now 150K lines is good.
2025-09-24 20:52:18 +08:00
Jason Lee
f93e9a9475
editor: Change to pass cursor as offset for completions method. ( #1271 )
...
And to support `filter_text` as completion item highlight match.
2025-09-22 16:29:51 +08:00
Jason Lee
62748aad9b
editor: Update CompletionProvider return type. ( #1270 )
2025-09-22 14:31:21 +08:00
Jason Lee
aa0f6d6222
editor: Improve range_to_utf16 and range_from_utf16 by use Rope. ( #1268 )
...
Now, we can work on 200K lines (editing).
--------
Now, all cost are on tree-sitter parse.
<img width="1091" height="672" alt="image"
src="https://github.com/user-attachments/assets/b111bc58-1334-40b2-9920-7006ad86bb3c "
/>
2025-09-22 14:07:30 +08:00