This PR does some necessary refactoring so that we can have concurrent editor services available and manage them. I will list all the things done here, but that main one is that I have split the DprintService up into a few different classes/services. These are
EditorService: An interface to define the API we use for all implementations
EditorServiceV4: the current implementation of communication model with the underlying dprint editor-service, this is an IntelliJ service
EditorServiceManager: an IntelliJ service to orchestrate creation of the correct implementation of the EditorService and expose it to the FormatterService
EditorProcess: a class to facilitate the lower level communication with the editor service (read/write strings and ints), as well as to create/destroy the underlying system process
I have also
Added the RestartAction, this should be similar to the VS Code one that restarts the underlying dprint editor-service and should be useful for changing config and restarting after errors
Pulled out the FormatResult class so it can be reused across implementations
Created the ProcessUnavailableException so we don't have to handle so many nulls
Overview
This PR does some necessary refactoring so that we can have concurrent editor services available and manage them. I will list all the things done here, but that main one is that I have split the
DprintService
up into a few different classes/services. These areeditor-service
, this is an IntelliJ serviceEditorService
and expose it to theFormatterService
I have also
RestartAction
, this should be similar to the VS Code one that restarts the underlying dprinteditor-service
and should be useful for changing config and restarting after errorsFormatResult
class so it can be reused across implementationsProcessUnavailableException
so we don't have to handle so many nulls