Skip to content

Commit e71a3df

Browse files
author
Calvinn Ng
committed
re-merge missing vscode files
1 parent 97f659b commit e71a3df

File tree

7 files changed

+0
-348
lines changed

7 files changed

+0
-348
lines changed
Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,3 @@
1-
<<<<<<< HEAD
2-
import { getTsConfigPath, migrate } from "core/util/paths";
3-
import { Telemetry } from "core/util/posthog";
4-
import path from "path";
5-
import * as vscode from "vscode";
6-
import { VsCodeExtension } from "../extension/vscodeExtension";
7-
import registerQuickFixProvider from "../lang-server/codeActions";
8-
import { getExtensionVersion } from "../util/util";
9-
import { getExtensionUri } from "../util/vscode";
10-
import { setupInlineTips } from "./inlineTips";
11-
12-
function showRefactorMigrationMessage(
13-
extensionContext: vscode.ExtensionContext,
14-
) {
15-
// Only if the vscode setting continue.manuallyRunningSserver is true
16-
const manuallyRunningServer =
17-
vscode.workspace
18-
.getConfiguration("ahrefs-continue")
19-
.get<boolean>("manuallyRunningServer") || false;
20-
if (
21-
manuallyRunningServer &&
22-
extensionContext?.globalState.get<boolean>(
23-
"continue.showRefactorMigrationMessage",
24-
) !== false
25-
) {
26-
vscode.window
27-
.showInformationMessage(
28-
"The Continue server protocol was recently updated in a way that requires the latest server version to work properly. Since you are manually running the server, please be sure to upgrade with `pip install --upgrade continuedev`.",
29-
"Got it",
30-
"Don't show again",
31-
)
32-
.then((selection) => {
33-
if (selection === "Don't show again") {
34-
// Get the global state
35-
extensionContext?.globalState.update(
36-
"continue.showRefactorMigrationMessage",
37-
false,
38-
);
39-
}
40-
});
41-
}
42-
}
43-
44-
export async function activateExtension(context: vscode.ExtensionContext) {
45-
// Add necessary files
46-
getTsConfigPath();
47-
48-
// Register commands and providers
49-
setupInlineTips(context);
50-
showRefactorMigrationMessage(context);
51-
=======
521
import { getTsConfigPath, getContinueRcPath, migrate } from "core/util/paths";
532
import { Telemetry } from "core/util/posthog";
543
import path from "node:path";
@@ -74,7 +23,6 @@ export async function activateExtension(context: vscode.ExtensionContext) {
7423
const workOsAuthProvider = new WorkOsAuthProvider(context);
7524
await workOsAuthProvider.initialize();
7625
context.subscriptions.push(workOsAuthProvider);
77-
>>>>>>> v0.9.184-vscode
7826

7927
const vscodeExtension = new VsCodeExtension(context);
8028

@@ -85,23 +33,13 @@ export async function activateExtension(context: vscode.ExtensionContext) {
8533
path.join(getExtensionUri().fsPath, "media", "welcome.md"),
8634
),
8735
);
88-
<<<<<<< HEAD
89-
=======
9036

9137
vscode.commands.executeCommand("continue.focusContinueInput");
92-
>>>>>>> v0.9.184-vscode
9338
});
9439

9540
// Load Continue configuration
9641
if (!context.globalState.get("hasBeenInstalled")) {
9742
context.globalState.update("hasBeenInstalled", true);
98-
<<<<<<< HEAD
99-
Telemetry.capture("install", {
100-
extensionVersion: getExtensionVersion(),
101-
});
102-
}
103-
}
104-
=======
10543
Telemetry.capture(
10644
"install",
10745
{
@@ -125,4 +63,3 @@ export async function activateExtension(context: vscode.ExtensionContext) {
12563
}
12664
: continuePublicApi;
12765
}
128-
>>>>>>> v0.9.184-vscode

extensions/vscode/src/activation/inlineTips.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
import * as vscode from "vscode";
2-
<<<<<<< HEAD
3-
import { getMetaKeyLabel } from "../util/util";
4-
5-
const inlineTipDecoration = vscode.window.createTextEditorDecorationType({
6-
after: {
7-
contentText: `${getMetaKeyLabel()} L to select code, ${getMetaKeyLabel()} I to edit`,
8-
=======
92
import { getMetaKeyName } from "../util/util";
103

114
const inlineTipDecoration = vscode.window.createTextEditorDecorationType({
125
after: {
136
contentText: `Add to chat (${getMetaKeyName()}+L) | Edit highlighted code (${getMetaKeyName()}+I).`,
14-
>>>>>>> v0.9.184-vscode
157
color: "#888",
168
margin: "0 0 0 6em",
179
fontWeight: "bold",
@@ -20,11 +12,7 @@ const inlineTipDecoration = vscode.window.createTextEditorDecorationType({
2012

2113
function showInlineTip() {
2214
return vscode.workspace
23-
<<<<<<< HEAD
24-
.getConfiguration("ahrefs-continue")
25-
=======
2615
.getConfiguration("continue")
27-
>>>>>>> v0.9.184-vscode
2816
.get<boolean>("showInlineTip");
2917
}
3018

@@ -44,11 +32,7 @@ function handleSelectionChange(e: vscode.TextEditorSelectionChangeEvent) {
4432
const line = Math.max(0, selection.start.line - 1);
4533

4634
const hoverMarkdown = new vscode.MarkdownString(
47-
<<<<<<< HEAD
48-
`Use ${getMetaKeyLabel()} L to select code, or ${getMetaKeyLabel()} I to edit highlighted code. Click [here](command:continue.hideInlineTip) if you don't want to see these inline suggestions.`,
49-
=======
5035
`Click [here](command:continue.hideInlineTip) to hide these suggestions`,
51-
>>>>>>> v0.9.184-vscode
5236
);
5337
hoverMarkdown.isTrusted = true;
5438
hoverMarkdown.supportHtml = true;
@@ -66,11 +50,7 @@ function handleSelectionChange(e: vscode.TextEditorSelectionChangeEvent) {
6650
const emptyFileTooltipDecoration = vscode.window.createTextEditorDecorationType(
6751
{
6852
after: {
69-
<<<<<<< HEAD
70-
contentText: `Use ${getMetaKeyLabel()} I to generate code`,
71-
=======
7253
contentText: `Use ${getMetaKeyName()}+I to generate code`,
73-
>>>>>>> v0.9.184-vscode
7454
color: "#888",
7555
margin: "2em 0 0 0",
7656
fontStyle: "italic",

extensions/vscode/src/activation/languageClient.ts

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@
22
* If we wanted to run or use another language server from our extension, this is how we would do it.
33
*/
44

5-
<<<<<<< HEAD
6-
import * as path from "path";
7-
import { ExtensionContext, extensions, workspace } from "vscode";
8-
9-
import {
10-
LanguageClient,
11-
LanguageClientOptions,
12-
ServerOptions,
13-
State,
14-
StateChangeEvent,
15-
=======
165
import * as path from "node:path";
176
import { type ExtensionContext, extensions, workspace } from "vscode";
187

@@ -22,19 +11,14 @@ import {
2211
type ServerOptions,
2312
State,
2413
type StateChangeEvent,
25-
>>>>>>> v0.9.184-vscode
2614
TransportKind,
2715
} from "vscode-languageclient/node";
2816
import { getExtensionUri } from "../util/vscode";
2917

3018
let client: LanguageClient;
3119

3220
export async function startLanguageClient(context: ExtensionContext) {
33-
<<<<<<< HEAD
34-
let pythonLS = startPythonLanguageServer(context);
35-
=======
3621
const pythonLS = startPythonLanguageServer(context);
37-
>>>>>>> v0.9.184-vscode
3822
pythonLS.start();
3923
}
4024

@@ -43,11 +27,7 @@ export async function makeRequest(method: string, param: any): Promise<any> {
4327
return;
4428
} else if (client.state === State.Starting) {
4529
return new Promise((resolve, reject) => {
46-
<<<<<<< HEAD
47-
let stateListener = client.onDidChangeState((e: StateChangeEvent) => {
48-
=======
4930
const stateListener = client.onDidChangeState((e: StateChangeEvent) => {
50-
>>>>>>> v0.9.184-vscode
5131
if (e.newState === State.Running) {
5232
stateListener.dispose();
5333
resolve(client.sendRequest(method, param));
@@ -70,11 +50,7 @@ export function deactivate(): Thenable<void> | undefined {
7050
}
7151

7252
function startPythonLanguageServer(context: ExtensionContext): LanguageClient {
73-
<<<<<<< HEAD
74-
let extensionPath = getExtensionUri().fsPath;
75-
=======
7653
const extensionPath = getExtensionUri().fsPath;
77-
>>>>>>> v0.9.184-vscode
7854
const command = `cd ${path.join(
7955
extensionPath,
8056
"scripts",
@@ -89,36 +65,15 @@ function startPythonLanguageServer(context: ExtensionContext): LanguageClient {
8965
configurationSection: "pyls",
9066
},
9167
};
92-
<<<<<<< HEAD
93-
return new LanguageClient(command, serverOptions, clientOptions);
94-
}
95-
96-
async function startPylance(context: ExtensionContext) {
97-
let pylance = extensions.getExtension("ms-python.vscode-pylance");
98-
=======
9968
return new LanguageClient(command, serverOptions, clientOptions)
10069
}
10170

10271
async function startPylance(context: ExtensionContext) {
10372
const pylance = extensions.getExtension("ms-python.vscode-pylance");
104-
>>>>>>> v0.9.184-vscode
10573
await pylance?.activate();
10674
if (!pylance) {
10775
return;
10876
}
109-
<<<<<<< HEAD
110-
let { path: lsPath } = await pylance.exports.languageServerFolder();
111-
112-
// The server is implemented in node
113-
let serverModule = context.asAbsolutePath(lsPath);
114-
// The debug options for the server
115-
// --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging
116-
let debugOptions = { execArgv: ["--nolazy", "--inspect=6009"] };
117-
118-
// If the extension is launched in debug mode then the debug server options are used
119-
// Otherwise the run options are used
120-
let serverOptions: ServerOptions = {
121-
=======
12277
const { path: lsPath } = await pylance.exports.languageServerFolder();
12378

12479
// The server is implemented in node
@@ -130,7 +85,6 @@ async function startPylance(context: ExtensionContext) {
13085
// If the extension is launched in debug mode then the debug server options are used
13186
// Otherwise the run options are used
13287
const serverOptions: ServerOptions = {
133-
>>>>>>> v0.9.184-vscode
13488
run: { module: serverModule, transport: TransportKind.ipc },
13589
debug: {
13690
module: serverModule,
@@ -140,11 +94,7 @@ async function startPylance(context: ExtensionContext) {
14094
};
14195

14296
// Options to control the language client
143-
<<<<<<< HEAD
144-
let clientOptions: LanguageClientOptions = {
145-
=======
14697
const clientOptions: LanguageClientOptions = {
147-
>>>>>>> v0.9.184-vscode
14898
// Register the server for plain text documents
14999
documentSelector: [{ scheme: "file", language: "python" }],
150100
synchronize: {
@@ -162,7 +112,3 @@ async function startPylance(context: ExtensionContext) {
162112
);
163113
return client;
164114
}
165-
<<<<<<< HEAD
166-
=======
167-
168-
>>>>>>> v0.9.184-vscode

extensions/vscode/src/autocomplete/completionProvider.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,18 @@ import {
44
CompletionProvider,
55
type AutocompleteInput,
66
} from "core/autocomplete/completionProvider";
7-
<<<<<<< HEAD
8-
import type { ConfigHandler } from "core/config/handler";
9-
=======
107
import { ConfigHandler } from "core/config/ConfigHandler";
11-
>>>>>>> v0.9.184-vscode
128
import { v4 as uuidv4 } from "uuid";
139
import * as vscode from "vscode";
1410
import type { TabAutocompleteModel } from "../util/loadAutocompleteModel";
1511
import { getDefinitionsFromLsp } from "./lsp";
1612
import { RecentlyEditedTracker } from "./recentlyEdited";
17-
<<<<<<< HEAD
18-
import { setupStatusBar, stopStatusBarLoading } from "./statusBar";
19-
=======
2013
import {
2114
StatusBarStatus,
2215
getStatusBarStatus,
2316
setupStatusBar,
2417
stopStatusBarLoading,
2518
} from "./statusBar";
26-
>>>>>>> v0.9.184-vscode
2719

2820
interface VsCodeCompletionInput {
2921
document: vscode.TextDocument;
@@ -87,13 +79,7 @@ export class ContinueCompletionProvider
8779
//@ts-ignore
8880
): ProviderResult<InlineCompletionItem[] | InlineCompletionList> {
8981
const enableTabAutocomplete =
90-
<<<<<<< HEAD
91-
vscode.workspace
92-
.getConfiguration("ahrefs-continue")
93-
.get<boolean>("enableTabAutocomplete") || false;
94-
=======
9582
getStatusBarStatus() === StatusBarStatus.Enabled;
96-
>>>>>>> v0.9.184-vscode
9783
if (token.isCancellationRequested || !enableTabAutocomplete) {
9884
return null;
9985
}
@@ -202,12 +188,8 @@ export class ContinueCompletionProvider
202188
completionId: uuidv4(),
203189
filepath: document.uri.fsPath,
204190
pos,
205-
<<<<<<< HEAD
206191
recentlyEditedFiles:
207192
await this.recentlyEditedTracker.getRecentlyEditedDocuments(),
208-
=======
209-
recentlyEditedFiles: [],
210-
>>>>>>> v0.9.184-vscode
211193
recentlyEditedRanges:
212194
await this.recentlyEditedTracker.getRecentlyEditedRanges(),
213195
clipboardText: clipboardText,
@@ -217,11 +199,7 @@ export class ContinueCompletionProvider
217199
injectDetails,
218200
};
219201

220-
<<<<<<< HEAD
221-
setupStatusBar(true, true);
222-
=======
223202
setupStatusBar(undefined, true);
224-
>>>>>>> v0.9.184-vscode
225203
const outcome =
226204
await this.completionProvider.provideInlineCompletionItems(
227205
input,
@@ -269,19 +247,11 @@ export class ContinueCompletionProvider
269247
startPos.translate(0, outcome.completion.length),
270248
);
271249
const completionItem = new vscode.InlineCompletionItem(
272-
<<<<<<< HEAD
273-
outcome.completion,
274-
completionRange,
275-
{
276-
title: "Log Autocomplete Outcome",
277-
command: "continue.logAutocompleteOutcome",
278-
=======
279250
outcome.completion,
280251
completionRange,
281252
{
282253
title: "Log Autocomplete Outcome",
283254
command: "continue.logAutocompleteOutcome",
284-
>>>>>>> v0.9.184-vscode
285255
arguments: [input.completionId, this.completionProvider],
286256
},
287257
);

0 commit comments

Comments
 (0)