mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
refactor: simplify URI creation logic in createSafeContentUri function
This commit is contained in:
parent
ed73805f31
commit
8fba4467f5
1 changed files with 3 additions and 3 deletions
|
|
@ -17,10 +17,10 @@ export function createSafeContentUri(scheme: string, path: string, content: stri
|
|||
try {
|
||||
const base64Content = Buffer.from(content).toString("base64")
|
||||
const baseUri = `${scheme}:${path}`
|
||||
const testUri = vscode.Uri.parse(baseUri).with({ query: base64Content }).toString()
|
||||
const uri = vscode.Uri.parse(baseUri).with({ query: base64Content })
|
||||
|
||||
if (testUri.length <= MAX_SAFE_URI_LENGTH) {
|
||||
return vscode.Uri.parse(baseUri).with({ query: base64Content })
|
||||
if (uri.toString().length <= MAX_SAFE_URI_LENGTH) {
|
||||
return uri
|
||||
}
|
||||
|
||||
// Calculate available space for content after accounting for URI overhead
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue