-
Notifications
You must be signed in to change notification settings - Fork 83
fix: delay request if process not ready yet #340
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,12 @@ class SocketCustomLintServerToClientChannel { | |
final CustomLintWorkspace _workspace; | ||
|
||
AnalysisSetContextRootsParams _contextRoots; | ||
bool _initialed = false; | ||
|
||
/// Initial state | ||
/// | ||
/// Returns `true` if requested `analysis.setContextRoots` | ||
bool get initialed => _initialed; | ||
|
||
late final Stream<CustomLintMessage> _messages = _channel.messages | ||
.map((e) => e! as Map<String, Object?>) | ||
|
@@ -127,6 +133,7 @@ class SocketCustomLintServerToClientChannel { | |
sendAnalyzerPluginRequest(_version.toRequest(const Uuid().v4())), | ||
sendAnalyzerPluginRequest(_contextRoots.toRequest(const Uuid().v4())), | ||
]); | ||
_initialed = true; | ||
|
||
} | ||
|
||
/// Updates the context roots on the client | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the point of all of this logic if we're unawaiting the requests anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic is same
_requestSubscription
, we just need replay request after delay, so no need to await or handle response. I also added test for this MR