diff --git a/product.json b/product.json index 2a17a2a9..aff48369 100644 --- a/product.json +++ b/product.json @@ -1,8 +1,8 @@ { "nameShort": "Void", "nameLong": "Void", - "voidVersion": "1.4.2", - "voidRelease": "0037", + "voidVersion": "1.4.3", + "voidRelease": "0038", "applicationName": "void", "dataFolderName": ".void-editor", "win32MutexName": "voideditor", diff --git a/src/vs/workbench/contrib/void/browser/toolsService.ts b/src/vs/workbench/contrib/void/browser/toolsService.ts index abe1f877..dbd0bdd1 100644 --- a/src/vs/workbench/contrib/void/browser/toolsService.ts +++ b/src/vs/workbench/contrib/void/browser/toolsService.ts @@ -43,15 +43,28 @@ const validateURI = (uriStr: unknown) => { if (uriStr === null) throw new Error(`Invalid LLM output: uri was null.`) if (typeof uriStr !== 'string') throw new Error(`Invalid LLM output format: Provided uri must be a string, but it's a(n) ${typeof uriStr}. Full value: ${JSON.stringify(uriStr)}.`) - const uri = URI.file(uriStr) - return uri - // // Try to parse as full URI first (for remote schemes like ssh://, wsl://, etc.) - // try { - // const uri = URI.parse(uriStr) - // return uri - // } catch (e) { - // // If parsing as URI fails, treat as file path (backwards compatibility) - // } + // Check if it's already a full URI with scheme (e.g., vscode-remote://, file://, etc.) + // Look for :// pattern which indicates a scheme is present + // Examples of supported URIs: + // - vscode-remote://wsl+Ubuntu/home/user/file.txt (WSL) + // - vscode-remote://ssh-remote+myserver/home/user/file.txt (SSH) + // - file:///home/user/file.txt (local file with scheme) + // - /home/user/file.txt (local file path, will be converted to file://) + // - C:\Users\file.txt (Windows local path, will be converted to file://) + if (uriStr.includes('://')) { + try { + const uri = URI.parse(uriStr) + return uri + } catch (e) { + // If parsing fails, it's a malformed URI + throw new Error(`Invalid URI format: ${uriStr}. Error: ${e}`) + } + } else { + // No scheme present, treat as file path + // This handles regular file paths like /home/user/file.txt or C:\Users\file.txt + const uri = URI.file(uriStr) + return uri + } } const validateOptionalURI = (uriStr: unknown) => {