show react immediately
This commit is contained in:
parent
c761f3b567
commit
59c549a468
2 changed files with 39 additions and 41 deletions
|
|
@ -35,46 +35,48 @@ export async function activateExtension(context: vscode.ExtensionContext) {
|
|||
})
|
||||
.catch((e) => console.log("Error checking for extension updates: ", e));
|
||||
|
||||
// Start the Python server
|
||||
await new Promise((resolve, reject) => {
|
||||
vscode.window.withProgress(
|
||||
{
|
||||
location: vscode.ProgressLocation.Notification,
|
||||
title:
|
||||
"Starting Continue Server... (it may take a minute to download Python packages)",
|
||||
cancellable: false,
|
||||
},
|
||||
async (progress, token) => {
|
||||
await startContinuePythonServer();
|
||||
resolve(null);
|
||||
}
|
||||
const sessionIdPromise = (async () => {
|
||||
// Start the Python server
|
||||
await new Promise((resolve, reject) => {
|
||||
vscode.window.withProgress(
|
||||
{
|
||||
location: vscode.ProgressLocation.Notification,
|
||||
title:
|
||||
"Starting Continue Server... (it may take a minute to download Python packages)",
|
||||
cancellable: false,
|
||||
},
|
||||
async (progress, token) => {
|
||||
await startContinuePythonServer();
|
||||
resolve(null);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Initialize IDE Protocol Client
|
||||
const serverUrl = getContinueServerUrl();
|
||||
ideProtocolClient = new IdeProtocolClient(
|
||||
`${serverUrl.replace("http", "ws")}/ide/ws`,
|
||||
context
|
||||
);
|
||||
});
|
||||
|
||||
return ideProtocolClient.getSessionId();
|
||||
})();
|
||||
|
||||
// Register the webview
|
||||
const provider = new ContinueGUIWebviewViewProvider(sessionIdPromise);
|
||||
|
||||
context.subscriptions.push(
|
||||
vscode.window.registerWebviewViewProvider(
|
||||
"continue.continueGUIView",
|
||||
provider,
|
||||
{
|
||||
webviewOptions: { retainContextWhenHidden: true },
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
// Register commands and providers
|
||||
sendTelemetryEvent(TelemetryEvent.ExtensionActivated);
|
||||
registerAllCodeLensProviders(context);
|
||||
registerAllCommands(context);
|
||||
|
||||
// Initialize IDE Protocol Client
|
||||
const serverUrl = getContinueServerUrl();
|
||||
ideProtocolClient = new IdeProtocolClient(
|
||||
`${serverUrl.replace("http", "ws")}/ide/ws`,
|
||||
context
|
||||
);
|
||||
|
||||
{
|
||||
const sessionIdPromise = await ideProtocolClient.getSessionId();
|
||||
const provider = new ContinueGUIWebviewViewProvider(sessionIdPromise);
|
||||
|
||||
context.subscriptions.push(
|
||||
vscode.window.registerWebviewViewProvider(
|
||||
"continue.continueGUIView",
|
||||
provider,
|
||||
{
|
||||
webviewOptions: { retainContextWhenHidden: true },
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
import fetch from "node-fetch";
|
||||
import * as path from "path";
|
||||
import * as vscode from "vscode";
|
||||
import {
|
||||
Configuration,
|
||||
DebugApi,
|
||||
UnittestApi,
|
||||
} from "./client";
|
||||
import { Configuration, DebugApi, UnittestApi } from "./client";
|
||||
import { convertSingleToDoubleQuoteJSON } from "./util/util";
|
||||
import { getExtensionUri } from "./util/vscode";
|
||||
import { extensionContext } from "./activation/activate";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue