Commit graph

14140 commits

Author SHA1 Message Date
Joseph T. Lyons
a0de7d52c8 v0.112.x stable 2023-11-15 12:47:19 -05:00
Joseph T. Lyons
86eafb6b6c zed 0.112.3 2023-11-10 15:56:49 -05:00
Max Brunsfeld
2d3a34c864 Refine search query suggestions (#3293)
This PR fixes some issues in response to feedback from Dan Abramov and
Jose Valim.

To do:

* [x] fix non-word search suggestions
* [x] add setting for disabling search suggestions

Release Notes:

- Fixed an issue where opening a search without text selected would
populate the search query with non-word characters adjacent to the
cursor.
- Added a setting, `seed_search_query_from_cursor`, which controls
whether the search query is automatically populated from the buffer when
starting a new buffer search or project search.

By default, the search query will always be set to the word under the
cursor. If you want to only populate the search query when text is
selected, you can add the following to your `~/.zed/settings.json`:

  ```json
  {
    "seed_search_query_from_cursor": "selection"
  }
  ```

If you don't want the search query to be automatically populated, even
when there is text selected, add the following:

  ```json
  {
    "seed_search_query_from_cursor": "never"
  }
  ```
2023-11-09 15:33:15 -08:00
Joseph T. Lyons
67068faa1d zed 0.112.2 2023-11-09 14:18:47 -05:00
Max Brunsfeld
1d175b4848 Use normal JS comments within JSX tags and JSX expression blocks (#3290)
This fix only required changing the `overrides` queries for JavaScript
and TSX. I've made the fix in both the `zed2` and `zed` crates.

Release Notes:

- Fixed an issue in JavaScript and TSX files, where the 'toggle
comments' command used the wrong comment syntax inside of JSX tags and
expressions within JSX.
2023-11-09 14:17:59 -05:00
Kirill Bulatov
c51d54d86d Do not use prettier for formatting node_modules/** files (#3286)
Fixes

> the most annoying thing i'm running into right now is that when i'm
patching something inside node_modules, Zed tries to pretty-format it
according to my prettier config. this messes up the patch because it has
formatting changes now. i need the pretty formatting on save to be off
inside node_modules, that never makes sense

feedback from #influencers 

Do note though, that language servers will still format any file inside
node_modules, but at least it's not prettier now.
VSCode seem to format the node_modules/** files via language servers
too, so that seems ok for now, and the rest could be fixed during

> "project diagnostics" (eslint) seem to be running inside node_modules,
e.g. i'm seeing 3182 "errors" in my project. that doesn't make sense and
probably wastes resources in addition to being annoying

feedback later.

Release Notes:

- Fixed prettier formatting files inside node_modules
2023-11-09 11:19:24 -05:00
Joseph T. Lyons
dc55644e7d zed 0.112.1 2023-11-09 10:20:51 -05:00
Julia
af9af3ff74 Get tsserver running again 2023-11-09 10:15:29 -05:00
Joseph T. Lyons
8539d97f43 v0.112.x preview 2023-11-08 10:53:12 -05:00
Antonio Scandurra
131074732f
Wire up mouse interaction in editor2 (#3267)
Release Notes:

- N/A
2023-11-08 15:36:47 +01:00
Antonio Scandurra
55dca1e3e1 💄 2023-11-08 15:33:11 +01:00
Antonio Scandurra
15d40d6df5 Determine whether the gutter was hovered 2023-11-08 15:30:41 +01:00
Antonio Scandurra
dfc536b4f5 Handle MouseUpEvent in editor2 2023-11-08 15:17:30 +01:00
Antonio Scandurra
e500c05880 Move building of key listeners outside of EditorElement::initialize 2023-11-08 15:12:54 +01:00
Antonio Scandurra
bef3b80bd4 Clear hover background highlights
Co-Authored-By: Piotr <piotr@zed.dev>
2023-11-08 15:08:54 +01:00
Piotr Osiewicz
e5f78ec122 Uncomment mouse_dragged event
Co-authored-by: Antonio <antonio@zed.dev>
2023-11-08 15:02:35 +01:00
Piotr Osiewicz
1b085bd618 Extract mouse event handlers into paint_mouse_listeners
Co-authored-by: Antonio <antonio@zed.dev>
2023-11-08 14:40:08 +01:00
Piotr Osiewicz
dd20032eab Hook up mouse_down function handler
Co-authored-by: Antonio <antonio@zed.dev>
2023-11-08 14:36:05 +01:00
Piotr Osiewicz
e30449e61a Pass text_bounds instead of full editor bounds into mouse_moved.
Co-authored-by: Antonio <antonio@zed.dev>
2023-11-08 14:28:16 +01:00
Piotr Osiewicz
334829f868 uncomment show_hover 2023-11-08 14:24:28 +01:00
Piotr Osiewicz
cd3773531c uncomment mouse moved 2023-11-08 14:24:28 +01:00
Antonio Scandurra
e4bc03217d
gpui2: Type-erase futures. (#3266)
Project2's LLVM IR size is ~33-44% bigger than project1 due to the fact
that in gpui2 we call async_task::spawn(_local) with impl Future instead
of dyn Future, which leads to quite a few more instantiations of
RawTask.

LLVM-IR size for project2:
|  build_type  |  main   |  this branch  | project1 |
|  debug       | 2617795 |    2022814    | 1817866  |
|  release     | 4439033 |    3715086    | 3314489  |

Note that this PR is in line with what was done in GPUI1 (we've also
boxed futures there).
Release Notes:

- N/A
2023-11-08 14:21:40 +01:00
Antonio Scandurra
b1f5723d84
Re-enable most of the features in editor2 (#3265)
Release Notes:

- N/A
2023-11-08 14:20:09 +01:00
Piotr Osiewicz
2364f6b22e gpui2: Type-erase futures.
Project2's LLVM IR size is ~20-25% bigger than project1 due to the fact that in gpui2 we call async_task::spawn(_local) with impl Future instead of dyn Future, which leads to quite a few more instantiations of RawTask.

LLVM-IR size for project2:
|  build_type  |  main   |  this branch  | project1 |
|  debug       | 2617795 |    2022814    | 1817866  |
|  release     | 4439033 |    3715086    | 3314489  |
2023-11-08 13:06:28 +01:00
Antonio Scandurra
c5d5571ad3 Fix warnings when generating function name for ctor
Co-Authored-By: Piotr <piotr@zed.dev>
2023-11-08 12:31:35 +01:00
Antonio Scandurra
6a0789c88e Don't alpha blend when rasterizing paths
Co-Authored-By: Piotr <piotr@zed.dev>
2023-11-08 12:04:25 +01:00
Antonio Scandurra
8ac8a6f1d9 Re-enable most of the functionalities in editor2 2023-11-08 11:30:32 +01:00
Nathan Sobo
d67581875f
Register actions statically / globally (#3264)
This updates our approach to action registration to make it
static/global.

There are 3 different approaches to creating an action, depending on the
complexity of your action's implementation. All of them involve defining
a data type with the correct trait implementations and registering it,
each a bit more powerful / verbose.

* Define a simple list of unit structs that implement `Action` -
`actions!(Foo, Bar, Baz)`
* Make a more complex data type into an action with `#[action]`. This
derives all the necessary traits and registers the action.
  ```rs
  #[action]
  struct MoveLeft {
    word: true
  }
  ```
* Implement all traits yourself and just register the action with
`#[register_action]`.

Release Notes:

N/A
2023-11-07 22:05:59 -07:00
Nathan Sobo
408edaae39 Remove call to removed method 2023-11-07 21:58:46 -07:00
Nathan Sobo
1949fa5147 Merge remote-tracking branch 'origin/main' into register-actions 2023-11-07 21:56:08 -07:00
Nathan Sobo
2a55b0dbfb Simplify actions macro. 2023-11-07 21:48:47 -07:00
Nathan Sobo
fdc9ea7f9b Docs and cleanup 2023-11-07 21:26:51 -07:00
Nathan Sobo
814e62050c Register actions globally before main 2023-11-07 20:58:37 -07:00
Nathan Sobo
80630cd4d9 WIP 2023-11-07 20:23:02 -07:00
Nate Butler
776338d27a
Update default theme player colors and add players story (#3263)
[[PR Description]]

- Update the default theme player colors for `Zed Pro Moonlight` and
`Zed Pro Daylight`
- Adds the ability to create stories in the `theme2` crate


![image](https://github.com/zed-industries/zed/assets/1714999/61fca222-1512-43b1-a229-fae1080d07fa)

You can see them by running:
- `cargo run -p storybook2 -- components/players --theme "Zed Pro
Daylight"`
- `cargo run -p storybook2 -- components/players --theme`

The player colors crisscross back and forth on the color wheel so that
the colors are as distinct as possible.


![image](https://github.com/zed-industries/zed/assets/1714999/255c9fd2-34da-4f75-9aad-0dd02f7009bf)

We do have room to add additional players if needed. Just let me know if
we feel like the default 8 aren't cutting it.


Release Notes:

- N/A
2023-11-07 22:00:49 -05:00
Nate Butler
0dd6ea6d41 Add new default player colors and the players story. 2023-11-07 21:51:12 -05:00
Nate Butler
79b4f78cb3 Extend the theme crate to enable stories, add players story 2023-11-07 21:08:33 -05:00
Nate Butler
a39865b4b2 Update default player colors 2023-11-07 20:27:00 -05:00
Max Brunsfeld
bcc92e9c4e
Implement basic text input handling (#3262)
This PR adds basic text input to Editors in zed2.

Note that we have *not* yet implemented the
`InputHandler::bounds_for_range` method on `Editor`, so the composition
and emoji picker windows are not yet positioned correctly.
2023-11-07 16:57:26 -08:00
Max Brunsfeld
9fe3073af7 Get basic text input working
Co-authored-by: Marshall <marshall@zed.dev>
2023-11-07 16:33:02 -08:00
Max Brunsfeld
bd12e3edb6 Assign editors as text input handlers
Co-authored-by: Marshall <marshall@zed.dev>
2023-11-07 15:44:00 -08:00
Conrad Irwin
b2ae08b159 Implement an InputHandler trait for gpui2
Co-Authored-By: Marshall <marshall@zed.dev>
Co-Authored-By: Max <max@zed.dev>
Co-Authored-By: Julia <julia@zed.dev>
2023-11-07 16:30:04 -07:00
Conrad Irwin
9cdfce4956
Make it possible to render a single line editor (#3259)
[[PR Description]]

Release Notes:

- (Added|Fixed|Improved) ...
([#<public_issue_number_if_exists>](https://github.com/zed-industries/community/issues/<public_issue_number_if_exists>)).
2023-11-07 14:26:10 -07:00
Conrad Irwin
5c450843a5 Add text and focus to editor 2023-11-07 14:19:15 -07:00
Conrad Irwin
a21c49c015 Make it possible to render a single line editor 2023-11-07 14:05:23 -07:00
Mikayla Maki
c7f5888348
editor singleline (#3257)
- Implement Editor::single_line
- Fix confusing error message
- Fix loading keyfiles
- Wire up GoToLine modal
2023-11-07 11:41:33 -08:00
Nate Butler
b692fb1464
Start documenting ThemeColors (#3258)
[[PR Description]]
- Adds doc comments for most fields on ThemeColors
- Scaffolds out some upcoming additional fields (Will add in a later PR)
- Renames a few fields:
    - `element_placeholder` -> `element_placeholder_text`
    - `element_drop_target` -> `drop_target_background`
- Removes the redundant `element_placeholder_text` (This should be set
using `text_placeholder`

Release Notes:

- N/A
2023-11-07 14:14:56 -05:00
Conrad Irwin
1e6a0f1c7b Wire up GoToLine modal 2023-11-07 12:12:05 -07:00
Conrad Irwin
0233864e92 Fix loading keyfiles 2023-11-07 12:04:37 -07:00
Conrad Irwin
b804b25c21 Fix confusing error message 2023-11-07 12:04:21 -07:00