Open chrisoutwright opened 1 month ago
I tried:
"rust-analyzer.files.excludeDirs": [
"C:\\Users\\chris\\.continue\\.diffs\\*",
"C:\\Users\\chris\\.continue\\.diffs\\",
"\\.continue\\.diffs\\",
"/.continue/.diffs/"
]
Also I tried :
"files.watcherExclude": {
"**/.continue/.diffs/**": true,
"**/.continue/.diffs/*/**": true
}
but still happening. Settings wrong? What can I do next?
Seems to be an invalid path Continue is generating.
In my example with Continue Diff: C:\Users\chris\.continue\.diffs\c:_b_Users_b_chris_b_rust_projects_b_cfg_parser_b_async_tutorials_b_ch05_b_framestack_tester_b_src_b_main.rs
https://github.com/rust-lang/rust-analyzer/issues/17335#issuecomment-2144845280
Rust Analyzer Group took a look at it.
Why is the syntax for a temporary Continue Diff file containing the drive letter with colon in the middle of the path itself? .continue.diffs\c:_b_Users_b_chris_b_rust_projects_b_cfg_parser_b_async_tutorials_b_ch05_b_framestack_tester_b_src_b_main.rs
Maybe add an escaping for the drive letter?:
private getNewFilepath(originalFilepath: string): string {
if (vscode.env.remoteName) {
// If we're in a remote, use the remote's temp directory
// Doing this because there's no easy way to find the home directory,
// and there aren't write permissions to the root directory
// and writing these to local causes separate issues
// because the vscode.diff command will always try to read from remote
vscode.workspace.fs.createDirectory(uriFromFilePath(this.remoteTmpDir));
return path.join(
this.remoteTmpDir,
this.escapeFilepath(originalFilepath),
);
}
return path.join(DIFF_DIRECTORY, this.escapeFilepath(originalFilepath));
}
Colon is not a thing to be used in a filepath except for the absolute with drive letter at the beginning.
can you include escaping the colon maybe?:
private escapeFilepath(filepath: string): string {
return filepath.replace(/\//g, "_f_").replace(/\\/g, "_b_").replace(/:/g, "_c_");
}
Is there a solution to this problem yet?
I see no solution to this issue.
@chrisoutwright your solution was correct and I apologize for not having seen it earlier. I've made the change here and it will be available for testing later today in pre-release (0.9.x)
I'll wait to close the issue until there's confirmation that this actually solves it.
Before submitting your bug report
Relevant environment info
Description
When using the Continue extension in Visual Studio Code, attempting to open the Continue Diff feature causes the Rust Analyzer to crash. The crash occurs specifically when performing the following steps:
Highlight any code with Shift-Ctrl-L and choose the action /edit within the Continue panel. Wait for the Continue Diff to open. At this point, the Rust Analyzer panics and crashes with the following error message:
thread 'LspServer' panicked at crates\paths\src\lib.rs:200:9: assertion failed: path.is_absolute()
This issue results in the Rust Analyzer becoming unresponsive, and subsequent attempts to use its features fail. The error message indicates a problem with path handling in the Rust Analyze, but I am unsure how to cope with it, since I only encountered it with
Continue Diff
being openned, or LEFT openend when restarting!To reproduce
1) Shift-Ctrl-L any code and choose action /edit within Continue panel for the relevant part 2) Wait till Continue Diff opens, Rust Analyzer will panic with
Log output