Commit Graph
14241 Commits
Author SHA1 Message Date
Kirill Bulatov fa4e7604c6 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 17:42:58 +02:00
Kirill Bulatov 01d7e2d231 Port changes to gpui2 2023-11-09 17:18:41 +02:00
Julia 2b093c7839 Get tsserver running again (#3277)
Release Notes:

- Fixed a few issues preventing Javascript/Typescript language server
from working with latest upstream changes.
2023-11-09 10:14:36 -05:00
Kirill Bulatov 23c8be7dac Do not propose prettier formatters for documents in node_modules/ 2023-11-09 14:49:37 +02:00
Kirill Bulatov 8d8e38a741 Adjust the tests 2023-11-09 14:40:32 +02:00
Kirill Bulatov 7918982c6e Change locate prettier method signature 2023-11-09 14:23:33 +02:00
Mikayla Maki bb08571de8 port notifications2 and integration tests (#3283)
Release Notes:

- N/A
2023-11-08 21:32:33 -08:00
Nathan Sobo 9f9938ffc6 Simplify input handling (#3282)
This PR takes a different approach to input handling.

Rather than returning the optional input handler, focus handle pair from
the element trait, we instead allow you to register an input handler
imperatively on the window context with `WindowContext::handle_input`.
You pass a focus handle reference and any implementer of
`PlatformInputHandler`. There's an `ElementInputHandler<V>` that
implements `PlatformWindowHandler` so long as `V` implements
`InputHandler`.

Release Notes:

- N/A
2023-11-08 22:27:36 -07:00
Mikayla 94ae2091ff Add notifications2 2023-11-08 21:23:31 -08:00
Nathan Sobo cb13d7fa6f Add docs 2023-11-08 22:03:26 -07:00
Nathan Sobo ff4f9512bd Remove comments 2023-11-08 21:49:21 -07:00
Nathan Sobo 243c19cebe Actually set the input handler 2023-11-08 21:43:14 -07:00
Mikayla Maki f836ecd436 port rope2 to zed2 (#3224)
port rope2 to zed2

Release Notes:

- NA
2023-11-08 20:19:05 -08:00
Mikayla Maki 5c3ef189ae Switch from associated type to generic on EventEmitter trait (#3281)
This removes a lot of ad-hoc event translation code in the workspace and
replaces it with a GPUI feature and trait bounds.

TODO:
- [x] Proof out idea
- [x] Convert the workspace
- [x] Convert the rest of the app

Release Notes:

- N/A
2023-11-08 20:16:33 -08:00
Mikayla 22a19cd8ff Merge branch 'main' into event-emitter 2023-11-08 20:10:38 -08:00
Nathan Sobo bac0b84dfa Simplify IME support 2023-11-08 21:06:00 -07:00
Mikayla e9267a7495 Update editor to use new event emitter 2023-11-08 19:52:43 -08:00
Mikayla 9fd7066ac1 Get workspace compiling with new event emitters 2023-11-08 19:29:00 -08:00
Conrad Irwin 755bf38f0b de-dbg (#3280)
Remove some debugging from GoToLine

Release Notes:

- N/A
2023-11-08 18:45:42 -07:00
Max Brunsfeld 2fb47b086a Implement bounds_for_range, so that text input windows are positioned correctly (#3278)
![Screenshot 2023-11-08 at 5 33
10 PM](https://github.com/zed-industries/zed/assets/326587/09efd785-2c43-41b2-9429-c17067497fd2)

![Screenshot 2023-11-08 at 5 33
28 PM](https://github.com/zed-industries/zed/assets/326587/14a9faee-3547-40b6-a31f-16f653cdcb36)
2023-11-08 17:38:11 -08:00
Conrad Irwin 1f1e8fd81a de-dbg 2023-11-08 18:36:12 -07:00
Max Brunsfeld ffeed40e87 Merge branch 'main' into bounds-for-range 2023-11-08 17:31:00 -08:00
Max Brunsfeld 52d538170b Fix vertical position in first_rect_for_character_range 2023-11-08 17:27:32 -08:00
Max Brunsfeld 3f288f7977 Assign gutter widht on editor view when painting element 2023-11-08 17:01:50 -08:00
Mikayla 6770b76688 First pass at allowing multiple event types to be emitted by an entity 2023-11-08 16:34:38 -08:00
Marshall Bowers edd44b05c9 Merge branch 'bounds-for-range' of github.com:zed-industries/zed into bounds-for-range 2023-11-08 19:25:18 -05:00
Marshall Bowers 3fa42ab59e Hard-code the gutter margin temporarily 2023-11-08 19:25:12 -05:00
Max Brunsfeld 15578ecd0d 🎨 2023-11-08 16:24:11 -08:00
Conrad Irwin 800a7adcf2 go to line2 (#3261)
- MODAL
- center a div
- MOAR CODE
- Beautiful go to line modal


Release Notes:
- N/A
2023-11-08 17:16:00 -07:00
Max BrunsfeldandMarshall 44a83ffef2 Account for element's bounds in Editor::bounds_for_range
Co-authored-by: Marshall <marshall@zed.dev>
2023-11-08 16:15:10 -08:00
Conrad Irwin b839006d27 tidy tidy 2023-11-08 17:09:38 -07:00
Max BrunsfeldandMarshall 3497a236c1 Register text input handlers via new element hook
Provide element bounds to the input handler's `bounds_for_rect` method.

Co-authored-by: Marshall <marshall@zed.dev>
2023-11-08 15:48:55 -08:00
Conrad Irwin 282360a8db Refactor GoToLine to use cx.observe_new_views() 2023-11-08 16:23:05 -07:00
Max BrunsfeldandMarshall bc284a96f6 Fix DisplaySnapshot::x_for_point always returning 0
Co-authored-by: Marshall <marshall@zed.dev>
2023-11-08 13:55:39 -08:00
Max Brunsfeld e000126645 Fix blinking in editor2 (#3272)
This also introduces new APIs in `ViewContext` for observing window
focus changes.

Release Notes:

- N/A
2023-11-08 13:53:43 -08:00
Julia eedb8fb633 Get tsserver running again 2023-11-08 16:51:54 -05:00
Conrad Irwin e486dff146 Merge branch 'main' into go-to-line2 2023-11-08 14:46:52 -07:00
Conrad Irwin c0c4c4f1f3 Make Modals dismissable in theory 2023-11-08 14:45:54 -07:00
Nate Butler aa604a3623 Document ColorScaleSteps (#3271)
[[PR Description]]

Adds documentation to ColorScaleSteps:

```rust
/// Returns the specified step in the [`ColorScale`].
    #[inline]
    pub fn step(&self, step: ColorScaleStep) -> Hsla {
        // Steps are one-based, so we need convert to the zero-based vec index.
        self.0[step.0 - 1]
    }

    /// `Step 1` - Used for main application backgrounds.
    ///
    /// This step provides a neutral base for any overlaying components, ideal for applications' main backdrop or empty spaces such as canvas areas.
    ///
    #[inline]
    pub fn step_1(&self) -> Hsla {
        self.step(ColorScaleStep::ONE)
    }

    /// `Step 2` - Used for both main application backgrounds and subtle component backgrounds.
    ///
    /// Like `Step 1`, this step allows variations in background styles, from striped tables, sidebar backgrounds, to card backgrounds.
    #[inline]
    pub fn step_2(&self) -> Hsla {
        self.step(ColorScaleStep::TWO)
    }

    /// `Step 3` - Used for UI component backgrounds in their normal states.
    ///
    /// This step maintains accessibility by guaranteeing a contrast ratio of 4.5:1 with steps 11 and 12 for text. It could also suit hover states for transparent components.
    #[inline]
    pub fn step_3(&self) -> Hsla {
        self.step(ColorScaleStep::THREE)
    }

    /// `Step 4` - Used for UI component backgrounds in their hover states.
    ///
    /// Also suited for pressed or selected states of components with a transparent background.
    #[inline]
    pub fn step_4(&self) -> Hsla {
        self.step(ColorScaleStep::FOUR)
    }

    /// `Step 5` - Used for UI component backgrounds in their pressed or selected states.
    #[inline]
    pub fn step_5(&self) -> Hsla {
        self.step(ColorScaleStep::FIVE)
    }

    /// `Step 6` - Used for subtle borders on non-interactive components.
    ///
    /// Its usage spans from sidebars' borders, headers' dividers, cards' outlines, to alerts' edges and separators.
    #[inline]
    pub fn step_6(&self) -> Hsla {
        self.step(ColorScaleStep::SIX)
    }

    /// `Step 7` - Used for subtle borders on interactive components.
    ///
    /// This step subtly delineates the boundary of elements users interact with.
    #[inline]
    pub fn step_7(&self) -> Hsla {
        self.step(ColorScaleStep::SEVEN)
    }

    /// `Step 8` - Used for stronger borders on interactive components and focus rings.
    ///
    /// It strengthens the visibility and accessibility of active elements and their focus states.
    #[inline]
    pub fn step_8(&self) -> Hsla {
        self.step(ColorScaleStep::EIGHT)
    }

    /// `Step 9` - Used for solid backgrounds.
    ///
    /// `Step 9` is the most saturated step, having the least mix of white or black.
    ///
    /// Due to its high chroma, `Step 9` is versatile and particularly useful for semantic colors such as
    /// error, warning, and success indicators.
    #[inline]
    pub fn step_9(&self) -> Hsla {
        self.step(ColorScaleStep::NINE)
    }

    /// `Step 10` - Used for hovered or active solid backgrounds, particularly when `Step 9` is their normal state.
    #[inline]
    pub fn step_10(&self) -> Hsla {
        self.step(ColorScaleStep::TEN)
    }

    /// `Step 11` - Used for text and icons requiring low contrast or less emphasis.
    #[inline]
    pub fn step_11(&self) -> Hsla {
        self.step(ColorScaleStep::ELEVEN)
    }

    /// `Step 12` - Used for text and icons requiring high contrast or prominence.
    #[inline]
    pub fn step_12(&self) -> Hsla {
        self.step(ColorScaleStep::TWELVE)
    }
```

Release Notes:

- N/A
2023-11-08 16:25:17 -05:00
Nate Butler fd64d86611 Extend Styled for Zed-specific methods (#3276)
[[PR Description]]

- Adds `StyledExt` for Zed-specific methods like `ui_text`, `v_flex`,
etc.
- Updates components previously using `text_*` methods.

Release Notes:

- N/A
2023-11-08 16:04:46 -05:00
Mikayla b37f5c083e WIP 2023-11-08 12:49:09 -08:00
Nate ButlerandMarshall Bowers 7cab4b8784 Update usages of text_size_* to text_ui in ui components
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-08 15:28:38 -05:00
Nate ButlerandMarshall Bowers 30d837f5ca Update StyledExt to impl over I & F as well as V for Div
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-08 15:25:44 -05:00
Marshall Bowers 1047c1d378 Use a fork of ctor to silence warnings generated by macro (#3275)
This PR switches us over to a fork of `ctor` that contains the fixes
from https://github.com/mmastrac/rust-ctor/pull/295, backported to our
current version of `ctor` (v0.1.20).

Once 1) the `ctor` maintainer publishes a new version with that change
and 2) we're ready to upgrade to the latest version of `ctor` we can
switch back to the mainline version.

Release Notes:

- N/A
2023-11-08 15:05:19 -05:00
Nate ButlerandMarshall Bowers 55abfc6eca Remove the Stack trait, update StyledExt to include stacks
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-08 15:00:47 -05:00
Nate Butler f396e9d48f Remove unused code in avatar 2023-11-08 14:46:47 -05:00
Mikayla Maki 50c038fefd WIP: Add collab tests (#3232)
TODO:
- [x] GPUI2: Implement record_backtrace on executor
- [x] GPUI2: Implement rng on executor
- [x] GPUI2: Determine whether to Implement global notifications for
removals
- [x] Get existing tests passing

TODO later:
- [ ] Port: collab_ui and uncomment tests
- [ ] Port: editor and uncomment tests
- [ ] Port: notifications and uncomment tests



Release Notes:

- N/A
2023-11-08 11:46:22 -08:00
Nate Butler ed6dbf0861 Update StyledExt to use more idiomatic method naming 2023-11-08 14:42:56 -05:00
Conrad Irwin 5083adda17 Silence problem 2023-11-08 12:37:35 -07:00
Conrad Irwin 185d8f7a15 Merge branch 'main' into add-collab-tests 2023-11-08 12:33:15 -07:00