Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Don't send patches if client doesn't support streaming #334

Merged
merged 1 commit into from
Aug 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,18 @@ export function registerLanguageHandler(messageEmitter: MessageEmitter, messageW
if (isRequestMessage(message)) {
const subscription = observable
.do(patch => {
span.log({ event: 'partialResult', patch });
// Send $/partialResult for partial result patches
// TODO only send if client supports it
messageWriter.write({
jsonrpc: '2.0',
method: '$/partialResult',
params: {
id: message.id,
patch: [patch]
} as PartialResultParams
});
if (streaming) {
span.log({ event: 'partialResult', patch });
// Send $/partialResult for partial result patches only if client supports it
messageWriter.write({
jsonrpc: '2.0',
method: '$/partialResult',
params: {
id: message.id,
patch: [patch]
} as PartialResultParams
});
}
})
// Build up final result for BC
// TODO send null if client declared streaming capability
Expand Down