Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(workspace/#640): persistence infrastructure + persist workspace and window state #1703

Merged
merged 38 commits into from
May 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c808165
add Filesystem.getStoreFolder
glennsl Apr 29, 2020
e87b127
expose Filesystem.getOrCreateConfigFolder
glennsl Apr 29, 2020
50742b1
add definition of Persistence "items"
glennsl Apr 29, 2020
8a695b9
add definitions for Global store
glennsl Apr 29, 2020
1594e65
add store instantiation
glennsl Apr 29, 2020
cb95acb
add logic to write to file
glennsl Apr 29, 2020
167d7f9
trigger on state change
glennsl Apr 29, 2020
c88b5df
add Workspace store
glennsl Apr 30, 2020
c6beaa0
persist workspace store on move and resize
glennsl Apr 30, 2020
0b2d522
remove cliOptions from StoreThread in favor of explicit arguments
glennsl Apr 30, 2020
9a41093
move Cli from Core to bin_editor
glennsl Apr 30, 2020
49a5875
fall back to persisted working directory if not specified on the comm…
glennsl May 1, 2020
02697c7
read store file on instantiation
glennsl May 1, 2020
11b5167
add get function to retrieve an item from the store
glennsl May 1, 2020
130c9a9
make state.workspace non-optional
glennsl May 1, 2020
c69f28a
set window size and position initially based on persisted workspace s…
glennsl May 1, 2020
8db83d4
post-rebase fix
glennsl May 1, 2020
827a44d
fix warning
glennsl May 1, 2020
9dd7376
add interface
glennsl May 1, 2020
213b535
refactor
glennsl May 1, 2020
a5a37f8
special case hash for "global"
glennsl May 1, 2020
b0c3a07
fix window positioning
glennsl May 2, 2020
e0cd7e4
add bool codec
glennsl May 2, 2020
0ae738b
persist maximized window state
glennsl May 2, 2020
4bb9089
cache store file path
glennsl May 2, 2020
fc2929b
use Luv for non-blocking I/O on persist
glennsl May 2, 2020
004d96d
fall back to Documents instead of working directory
glennsl May 2, 2020
df58ab9
move Persistence infrastructure to Core
glennsl May 2, 2020
347ca20
forward store infrastructure functions to builtin stores
glennsl May 2, 2020
6bd69ec
refactor store API for great good
glennsl May 2, 2020
016735f
simplify builtin store API
glennsl May 2, 2020
788f607
fix tests
glennsl May 2, 2020
e9a8e2e
handle missing store path more gracefully
glennsl May 2, 2020
175b6e5
Switch to new Dir API
bryphe May 4, 2020
ee3637f
Use forked dir for now
bryphe May 4, 2020
219a442
Update lockfiles
bryphe May 5, 2020
3927744
Formatting
bryphe May 5, 2020
f3eb4b3
Merge master
bryphe May 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
419 changes: 205 additions & 214 deletions bench.esy.lock/index.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bench.esy.lock/opam/conf-pkg-config.1.1/opam

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bench/lib/Helpers.re
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ let simpleState = {
State.initial(
~getUserSettings=() => Ok(Config.Settings.empty),
~contributedCommands=[],
~workingDirectory=Sys.getcwd(),
);

Reducer.reduce(
Expand Down
419 changes: 205 additions & 214 deletions esy.lock/index.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion esy.lock/opam/conf-pkg-config.1.1/opam

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 1 addition & 10 deletions integration_test/ZenModeSingleFileModeTest.re
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
open Oni_Core;
open Oni_Model;
open Oni_IntegrationTestLib;

Expand All @@ -8,17 +7,9 @@ let configuration = {|
{ "editor.zenMode.singleFile": true }
|};

let cliOptions =
Cli.create(
~folder=Revery.Environment.getWorkingDirectory(),
// Specify a single file
~filesToOpen=["some-random-file.txt"],
(),
);

runTest(
~configuration=Some(configuration),
~cliOptions=Some(cliOptions),
~filesToOpen=["some-random-file.txt"],
~name="ZenMode: Single-file mode works as expected",
(_dispatch, wait, _runEffects) => {
wait(~name="Wait for split to be created 1", (state: State.t) => {
Expand Down
12 changes: 9 additions & 3 deletions integration_test/lib/Oni_IntegrationTestLib.re
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ let runTest =
(
~configuration=None,
~keybindings=None,
~cliOptions=None,
~filesToOpen=[],
~name="AnonymousTest",
~onAfterDispatch=_ => (),
test: testCallback,
Expand Down Expand Up @@ -94,7 +94,13 @@ let runTest =
let getUserSettings = () => Ok(currentUserSettings^);

let currentState =
ref(Model.State.initial(~getUserSettings, ~contributedCommands=[]));
ref(
Model.State.initial(
~getUserSettings,
~contributedCommands=[],
~workingDirectory=Sys.getcwd(),
),
);

let headlessWindow =
Revery.Utility.HeadlessWindow.create(
Expand Down Expand Up @@ -147,11 +153,11 @@ let runTest =
~executingDirectory=Revery.Environment.getExecutingDirectory(),
~getState=() => currentState^,
~onStateChanged,
~cliOptions,
~configurationFilePath=Some(configurationFilePath),
~keybindingsFilePath=Some(keybindingsFilePath),
~quit,
~window=None,
~filesToOpen,
(),
);

Expand Down
2 changes: 1 addition & 1 deletion integration_test/lib/Oni_IntegrationTestLib.rei
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let runTest:
(
~configuration: option(string)=?,
~keybindings: option(string)=?,
~cliOptions: option(Core.Cli.t)=?,
~filesToOpen: list(string)=?,
~name: string=?,
~onAfterDispatch: Model.Actions.t => unit=?,
testCallback
Expand Down
Loading