Commit Graph

298 Commits

Author SHA1 Message Date
Max Brunsfeld
d37a98782e Improve border parsing in themes
The `top`, `left`, `bottom` and `right` fields are optional.
If none are specified, then they are all set to true.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-04 17:19:42 -07:00
Nathan Sobo
85a076312a Merge branch 'main' into theme-variables 2021-08-04 16:47:43 -06:00
Max Brunsfeld
802f1f4e78 Get new theme structure working
* Fix precedence of extends directives
* Always group color with font properties for text theming

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-04 14:07:19 -07:00
Nathan Sobo
56354c7623 Avoid crashes when laying out lines containing byte order marks
This solution isn't perfect and we'll probably have layout bugs with these lines, but this prevents us from triggering undefined behavior.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-08-04 11:52:21 -06:00
Nathan Sobo
90b51c3356 Implement themes::ThemeRegistry::get
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-08-03 19:35:15 -06:00
Max Brunsfeld
81041d7841 Restructure Theme with new style objects 2021-08-03 13:36:58 -07:00
Max Brunsfeld
ef0ffbe819 Use custom color wrapper type everywhere in gpui & zed
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-03 12:48:58 -07:00
Max Brunsfeld
fa01273466 Extract {Container,Label}Style structs from those elements
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-03 11:07:03 -07:00
Nathan Sobo
4c53470800 Notify all views when a theme is selected 2021-08-02 16:57:10 -06:00
Max Brunsfeld
b30d0daabf Add a theme picker
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-02 14:55:27 -07:00
Max Brunsfeld
e080739d57 Remove use of replace_with crate for managing element lifecycles
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-02 13:11:11 -07:00
Max Brunsfeld
8785f1f9c6 Use deterministic executor in randomized synchronous tests
Remove App::test function
2021-07-30 14:07:37 -07:00
Max Brunsfeld
4c3f97d123 Fix type of Workspace::open_new_file context parameter
Fixes #118
2021-07-30 10:11:46 -07:00
Max Brunsfeld
372d2ccb6d Extract most colors in codebase into theme file. switch to dark 2021-07-30 09:50:28 -07:00
Nathan Sobo
6efadd19dd Reuse FontCache across randomized tests
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-07-30 09:50:28 -07:00
Antonio Scandurra
b647e3ee71 Make WrapMap and DisplayMap models
This removes the need for a lock around in `WrapMap` and also removes
`WrapMap::notifications` because gpui already has a standard way of
notifying when a model updates.
2021-07-26 13:02:31 +02:00
Nathan Sobo
f81f043058 WIP 2021-07-23 12:25:09 -06:00
Nathan Sobo
11285f3762 Pass a MutableAppContext to Element::layout and ::dispatch_event
We need to mutate the app in these cases to relay layout state, so this just makes things easier. We won't be able to perform layout in parallel but it's questionable whether we'll ever actually do that. If we do, we can revisit.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-23 10:52:08 -06:00
Antonio Scandurra
502f54a021 Don't poll foreground futures during DeterministicExecutor::block_on 2021-07-23 12:06:58 +02:00
Max Brunsfeld
5d22c6c4bd Start restructuring WrapMap with simpler concurrency
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-22 16:21:42 -07:00
Max Brunsfeld
d0fdc7b5e8 Get simple unit test passing for soft-wrap in DisplayMap 2021-07-20 15:22:11 -07:00
Max Brunsfeld
61397f2f2f Avoid holding executor's state lock while parked
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-20 11:37:02 -07:00
Nathan Sobo
ee213696aa Replace DeterministicExecutor::reset with forbid_parking
There's really no point calling reset if we plan on parking afterwards.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-20 12:28:04 -06:00
Nathan Sobo
64927abbc4 Allow DeterministicExecutor to park until forbid_parking is called
This allows us to perform async setup such as talking to the database.
2021-07-20 12:22:02 -06:00
Antonio Scandurra
3d3a14b650 Add DeterministicExecutor::block_on(duration, future)
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-07-20 19:20:50 +02:00
Max Brunsfeld
f9e13f3429 Start work on WrapMap::chunks_at
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-19 16:23:56 -07:00
Nathan Sobo
e193a660aa WIP 2021-07-19 13:59:07 -06:00
Max Brunsfeld
05e5e5f747 Implement FontSystem::wrap_line 2021-07-16 17:14:43 -07:00
Antonio Scandurra
9895c77f5c WIP 2021-07-16 18:43:50 +02:00
Antonio Scandurra
1ba9e48271 Start on adding a randomized test for BackgroundWrapper
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-16 17:53:23 +02:00
Antonio Scandurra
2e645bcf6a Use an unbounded channel for waking executor::Deterministic
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-07-13 18:46:48 +02:00
Antonio Scandurra
c4e37dc47c Use the same background executor for spawning CPU intensive tasks
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2021-07-13 18:13:25 +02:00
Antonio Scandurra
f836a25500 Use an executor::Background in AppContext::thread_pool 2021-07-13 14:06:38 +02:00
Antonio Scandurra
68f747d6df Allow printing a trace of a run of the executor 2021-07-13 12:31:36 +02:00
Nathan Sobo
1537500fcb Include contents of the zed-server repo
We're going full monorepo.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-07-12 14:14:39 -06:00
Antonio Scandurra
58bae3a9a7 Ensure root view is always rendered when opening a window
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-12 17:44:10 +02:00
Antonio Scandurra
1813a3cc91 Allow resetting executor::Deterministic's RNG 2021-07-11 11:26:06 +02:00
Max Brunsfeld
eeebc761b6 Restructure Peer to handle connections' messages in order 2021-07-09 16:27:34 -07:00
Antonio Scandurra
4f4233e00b Schedule foreground-spawned futures sequentially
Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-09 18:55:42 +02:00
Antonio Scandurra
13c56cf6ce WIP 2021-07-09 18:32:57 +02:00
Antonio Scandurra
102026f3c7 Implement a scoped pool on executor::Background 2021-07-09 15:00:51 +02:00
Max Brunsfeld
2965fce70d Avoid panic when spawn is called after run exits in deterministic executor 2021-07-08 17:38:54 -07:00
Max Brunsfeld
140c8833fe Start work on a deterministic executor for tests
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-07-08 13:39:24 -07:00
Antonio Scandurra
792926c675
Merge pull request #100 from zed-industries/fix-url-to-path-conversion
Fix URL to `PathBuf` conversion in `mac::Platform`
2021-07-08 17:51:09 +02:00
Max Brunsfeld
f46c0a790e Improve support for gpui tests that need multiple contexts
If a test function takes multiple contexts, pass it however many
distinct contexts are needed. Construct each one with a different
starting entity id so that they do not share any entity ids.
2021-07-07 17:18:42 -07:00
Antonio Scandurra
75fc371f36 Ensure returned URLs are files before returning them in path prompts 2021-07-06 16:08:19 +02:00
Antonio Scandurra
ed1eb24ee2 Convert URLs to paths returned from NSSavePanel using [Url path] 2021-07-06 15:54:42 +02:00
Antonio Scandurra
39d3b21780 Convert URLs to paths returned from NSOpenPanel using [Url path] 2021-07-06 15:54:29 +02:00
Max Brunsfeld
58eefcd331 Add ModelHandle::spawn_weak, fix worktree leak from spawn call 2021-07-05 17:55:52 -07:00
Antonio Scandurra
e80439daaa Merge branch 'main' into rpc 2021-06-29 10:25:42 +02:00