unison/docs/commandline-editor-dev.md
Paul Chiusano dafe9419ea we think we fixed issues with branches not being saved to disk
The new approach is that CommandLine.main reads the loop state at each step and makes sure that the info is propagated as needed (to the autocomplete provider and also the file system listener that awaits new branch files arriving externally).
2019-03-04 16:56:35 -05:00

813 B

The Unison CLI code is made up of a few components:

CommandLine.Main sets up threads to watch the filesystem and parse stdin to produce Editor.Events and Editor.Inputs respectively.

Editor.Input parsers are defined in InputPattern.hs and InputPatterns.hs.

Action.loop receives Editor.Events and Editor.Inputs and executes Editor.Commands. This loop can't use IO or access the Codebase -- any access to these things must come from what Editor.Command provides.

Editor.Commands are defined in Editor.hs and interpreted by Editor.commandLine. Editor.commandLine does use IO and access the Codebase.`

One of the Editor.Commands that can be executed is Notify, which presents an Editor.Output to the user. Our current implementation is in OutputMessages.notifyUser.