connect method
This method is used to initialize the LSP server. and it's used internally by the CodeCrafter widget.
Calling it directly is not recommended and may crash the LSP server if called multiple times.
Implementation
Future<void> connect() async {
_channel.stream.listen((data) {
try {
final json = jsonDecode(data as String);
_responseController.add(json);
} catch (e) {
throw FormatException('Invalid JSON response: $data', e);
}
});
}