Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
client.onDidChangeState(stateChangeEvent => {
var states : { [key in State]: string } = {
[State.Running]: "running",
[State.Starting]: "starting",
[State.Stopped]: "stopped"
};
console.log(`[qsharp-lsp] State ${states[stateChangeEvent.oldState]} -> ${states[stateChangeEvent.newState]}`);
})
);
this._client.onDidChangeState(({ oldState, newState }) => {
if (newState === State.Running) {
this._setStatus(Status.ok);
} else if (newState === State.Stopped) {
this._setStatus(Status.error);
}
});
client.onDidChangeState(event => {
if (event.newState === State.Running) {
extensionStatus = Status.RUNNING;
serverRunning = true;
} else {
extensionStatus = Status.ERROR;
client.info("The graphql server has stopped running");
serverRunning = false;
}
updateStatusBar(statusBarItem, editor);
});
updateStatusBar(statusBarItem, editor);
client.onDidChangeState((event) => {
if (event.newState === ClientState.Running) {
client.info(running);
statusBarItem.tooltip = running;
serverRunning = true;
} else {
client.info(stopped);
statusBarItem.tooltip = stopped;
serverRunning = false;
}
udpateStatusBarVisibility(window.activeTextEditor);
});
this.languageClient.onDidChangeState(event => {
if (event.newState === State.Running) {
this.languageClient.onNotification('rustDocument/diagnosticsBegin', () => {
this.statusBarItem.setText('Analysis started');
});
this.languageClient.onNotification('rustDocument/diagnosticsEnd', () => {
this.statusBarItem.setText('Analysis finished');
});
}
});
}
(event) => {
if (event.oldState === State.Running && event.newState === State.Stopped) {
sendTelemetryEvent(EventNames.lspStopped);
}
}
);
client.onDidChangeState((event) => {
if (event.newState === ClientState.Running) {
client.info(running);
statusBarItem.tooltip = running;
serverRunning = true;
} else {
client.info(stopped);
statusBarItem.tooltip = stopped;
serverRunning = false;
}
updateStatusBarVisibility();
});
client.onReady().then(() => {
client.onDidChangeState(e => {
if (e.newState === State.Running) {
client.onRequest(Methods.readConfiguration, configFromKey)
client.onRequest(Methods.objectDetails, objectDetailFromUrl)
client.onRequest(Methods.readEditorObjectSource, readEditorObjectSource)
client.onRequest(Methods.readObjectSourceOrMain, readObjectSource)
client.onRequest(Methods.vsUri, getVSCodeUri)
client.onRequest(Methods.setSearchProgress, setSearchProgress)
client.onRequest(Methods.logCall, logCall)
client.onRequest(Methods.logHTTP, logHttp)
}
})
client.start()
client.onDidChangeState(event => {
if (event.newState === State.Running) {
client.info('Flow starting')
statusBar.busy()
} else {
client.info('Flow stopped')
statusBar.stopped()
}
})
public update(state: State) {
if (state === State.Running) {
this.drawIcon(Messages.SERVER_RUNNING, Colors.NORMAL);
} else {
this.drawIcon(Messages.SERVER_STOPPED, Colors.ERROR);
}
}