🛠 Improvements
This release introduces general improvements to the Language server code base that can be categorized into:
- Isolating Flow client
The Flow client was extracted and exposed via an interface, that allows us to mock it out during testing and to encapsulate all the flow client logic. - Simplifying the state management
There was a couple of complexities removed from the LS, most notably how accounts are managed, previously the accounts were managed on network, using the contract to resolve names to addresses, which provided another state that was required to be synced between LS, client and blockchain. This was removed and encapsulated within the Flow client implementation and it only contains a simple list of accounts which can be listed to the client via API if needed (clearly marking currently active account) and also can be easily switched between active accounts. No setup is required. - Better error handling
Commands were refactored in how they handle errors, previously each command had to handle the error and send the response to the client, now the errors are returned from the command layer to the server where the response is handled in once place: - Testing
The unit test of each of the integration components were added as well as end-to-end tests testing all the commands.
#1752 @sideninja