MCPcopy Create free account
hub / github.com/bytebase/bytebase / reconnect

Function reconnect

frontend/src/react/components/monaco/lsp-client.ts:196–215  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

194};
195
196const reconnect = async () => {
197 setConnState({
198 ws: undefined,
199 state: "initial",
200 retries: 0,
201 });
202
203 await refreshTokens();
204
205 if (state.client) {
206 try {
207 state.client.dispose();
208 } catch {
209 // ignore
210 }
211 state.client = undefined;
212 }
213 state.clientInitialized = undefined;
214 await initializeLSPClient();
215};
216
217const createLanguageClient = async (): Promise<MonacoLanguageClient> => {
218 // `monaco-languageclient` v9+ requires `@codingame/monaco-vscode-api`'s

Callers 1

createLanguageClientFunction · 0.85

Calls 3

refreshTokensFunction · 0.90
setConnStateFunction · 0.85
initializeLSPClientFunction · 0.85

Tested by

no test coverage detected