path -> uri extensions/vscode

This commit is contained in:
Dallin Romney 2024-12-10 21:27:45 -08:00
parent 3a99509915
commit fe47f45ddf
11 changed files with 14 additions and 19 deletions

View file

@ -729,6 +729,7 @@ export class Core {
if (data?.uris?.length) {
for (const uri of data.uris) {
// Listen for file changes in the workspace
// URI TODO is this equality statement valid?
const filePath = getFullPath(uri);
if (filePath === getConfigJsonPath()) {
// Trigger a toast notification to provide UI feedback that config

View file

@ -216,8 +216,8 @@ export class ContinueGUIWebviewViewProvider
<script>window.fullColorTheme = ${JSON.stringify(currentTheme)}</script>
<script>window.colorThemeName = "dark-plus"</script>
<script>window.workspacePaths = ${JSON.stringify(
vscode.workspace.workspaceFolders?.map(
(folder) => folder.uri.fsPath,
vscode.workspace.workspaceFolders?.map((folder) =>
folder.uri.toString(),
) || [],
)}</script>
<script>window.isFullScreen = ${isFullScreen}</script>

View file

@ -55,7 +55,7 @@ function startPythonLanguageServer(context: ExtensionContext): LanguageClient {
const command = `cd ${path.join(
extensionPath,
"scripts",
)} && source env/bin/activate.fish && python -m pyls`;
)} && source ${path.join("env", "bin", "activate.fish")} && python -m pyls`;
const serverOptions: ServerOptions = {
command: command,
args: ["-vv"],
@ -113,4 +113,3 @@ async function startPylance(context: ExtensionContext) {
);
return client;
}

View file

@ -9,10 +9,7 @@ export class ConfigPyCodeLensProvider implements vscode.CodeLensProvider {
): vscode.CodeLens[] | Thenable<vscode.CodeLens[]> {
const codeLenses: vscode.CodeLens[] = [];
if (
!document.uri.fsPath.endsWith(".continue/config.json") &&
!document.uri.fsPath.endsWith(".continue\\config.json")
) {
if (!document.uri.path.endsWith(".continue/config.json")) {
return codeLenses;
}

View file

@ -15,7 +15,9 @@ export class DiffViewerCodeLensProvider implements vscode.CodeLensProvider {
if (path.dirname(document.uri.fsPath) === DIFF_DIRECTORY) {
const codeLenses: vscode.CodeLens[] = [];
let range = new vscode.Range(0, 0, 1, 0);
const diffInfo = this.diffManager.diffAtNewFilepath(document.uri.fsPath);
const diffInfo = this.diffManager.diffAtNewFilepath(
document.uri.toString(),
);
if (diffInfo) {
range = diffInfo.range;
}
@ -23,12 +25,12 @@ export class DiffViewerCodeLensProvider implements vscode.CodeLensProvider {
new vscode.CodeLens(range, {
title: `Accept All ✅ (${getMetaKeyLabel()}⇧⏎)`,
command: "continue.acceptDiff",
arguments: [document.uri.fsPath],
arguments: [document.uri.toString()],
}),
new vscode.CodeLens(range, {
title: `Reject All ❌ (${getMetaKeyLabel()}⇧⌫)`,
command: "continue.rejectDiff",
arguments: [document.uri.fsPath],
arguments: [document.uri.toString()],
}),
);
return codeLenses;

View file

@ -24,8 +24,8 @@ export class VerticalDiffCodeLensProvider implements vscode.CodeLensProvider {
document: vscode.TextDocument,
_: vscode.CancellationToken,
): vscode.CodeLens[] | Thenable<vscode.CodeLens[]> {
const filepath = document.uri.fsPath;
const blocks = this.editorToVerticalDiffCodeLens.get(filepath);
const uri = document.uri.toString();
const blocks = this.editorToVerticalDiffCodeLens.get(uri);
if (!blocks) {
return [];
@ -45,12 +45,12 @@ export class VerticalDiffCodeLensProvider implements vscode.CodeLensProvider {
new vscode.CodeLens(range, {
title: `Accept`,
command: "continue.acceptVerticalDiffBlock",
arguments: [filepath, i],
arguments: [uri, i],
}),
new vscode.CodeLens(range, {
title: `Reject`,
command: "continue.rejectVerticalDiffBlock",
arguments: [filepath, i],
arguments: [uri, i],
}),
);

View file

@ -1,7 +1,5 @@
import * as vscode from "vscode";
import { VsCodeIde } from "../VsCodeIde";
const os = require("node:os");
function charIsEscapedAtIndex(index: number, str: string): boolean {