Skip to content

fix(ls): write the absolute path for a file renamed into a directory named ^ - #1109

Merged
camc314 merged 1 commit into
oxc-project:mainfrom
magurotuna:fix/ls-file-rename-rooted-relative-path
Nov 26, 2026
Merged

camc314 merged 1 commit into
oxc-project:mainfrom
magurotuna:fix/ls-file-rename-rooted-relative-path

Conversation

@magurotuna

Copy link
Copy Markdown
Member

workspace/willRenameFiles wrote ^/x.ts for a file moved into a directory named ^:

// a.ts: /// <reference path="./x.ts" />
// rename x.ts to ^/x.ts
tsgo: /// <reference path="<dir>/^/x.ts" />
tsrs: /// <reference path="^/x.ts" />

Go relativePathFromDirectory keeps the absolute path when RelativePathFromDirectory returns false. tsrs had no such check. This PR uses tspath::relative_path_from_path there. The same function writes the files and include entries of tsconfig.json.

Tests: will_rename_files_into_caret_directory in tsrs_lsp.

AI assistance: written with Claude Code.

…named ^

`workspace/willRenameFiles` wrote `^/x.ts` for a file moved into a
directory named `^`:

```
// a.ts: /// <reference path="./x.ts" />
// rename x.ts to ^/x.ts
tsgo: /// <reference path="<dir>/^/x.ts" />
tsrs: /// <reference path="^/x.ts" />
```

Go `relativePathFromDirectory` (`ls/file_rename.go:385`) keeps the absolute
path when `RelativePathFromDirectory` returns `false`. tsrs had no such
check. Use `tspath::relative_path_from_path` there. The same function
writes the `files` and `include` entries of `tsconfig.json`.

Tests: `will_rename_files_into_caret_directory` in `tsrs_lsp`.

AI assistance: written with Claude Code.
@codspeed

codspeed Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

Warning

oxc-project has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed.

1 warning

⚠️ 4 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

βœ… 8 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing magurotuna:fix/ls-file-rename-rooted-relative-path (9a71942) with main (9fb8d5a)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@camc314
camc314 added this pull request to the merge queue Nov 26, 2026
Merged via the queue into oxc-project:main with commit 8ce267e Nov 26, 2026
71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants