Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lsp): normalize case sensitive root_dir on Windows #152

Merged
merged 5 commits into from
Jan 14, 2024

Conversation

TrungNguyen153
Copy link
Contributor

No description provided.

Copy link
Contributor

Review Checklist

Does this PR follow the Contribution Guidelines? Following is a partial checklist:

Proper conventional commit scoping:

  • For example, fix(lsp): some lsp-related bugfix

  • Pull request title has the appropriate conventional commit prefix.

If applicable:

  • Tested
    • Tests have been added.
    • Tested manually (Steps to reproduce in PR description).
  • Updated documentation.
  • Updated CHANGELOG.md

@mrcjkb mrcjkb changed the title fast fix root_dir case sensive on windows fix(lsp): root_dir case sensive on windows Jan 12, 2024
Copy link
Owner

@mrcjkb mrcjkb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

lua/rustaceanvim/lsp.lua Outdated Show resolved Hide resolved
lua/rustaceanvim/lsp.lua Outdated Show resolved Hide resolved
@mrcjkb
Copy link
Owner

mrcjkb commented Jan 12, 2024

Looks good. Only the stylua check is failing now.

@mrcjkb mrcjkb enabled auto-merge (squash) January 14, 2024 00:11
lua/rustaceanvim/lsp.lua Outdated Show resolved Hide resolved
@mrcjkb mrcjkb changed the title fix(lsp): root_dir case sensive on windows fix(lsp): normalize case sensitive root_dir on Windows Jan 14, 2024
@mrcjkb mrcjkb disabled auto-merge January 14, 2024 21:05
@mrcjkb mrcjkb linked an issue Jan 14, 2024 that may be closed by this pull request
mrcjkb
mrcjkb previously approved these changes Jan 14, 2024
lua/rustaceanvim/lsp.lua Outdated Show resolved Hide resolved
@mrcjkb mrcjkb merged commit c549be2 into mrcjkb:master Jan 14, 2024
5 checks passed
@TrungNguyen153
Copy link
Contributor Author

Tks for merge it. Work as expected. Sorry about not response.

bltavares added a commit to bltavares/rustaceanvim that referenced this pull request Feb 20, 2024
In PR mrcjkb#152, rustacenavim
begin storing the `root_dir` with a normalized disk drive format to
avoid spawning multiple rust-analyzers while navigating files.

This change caused an unintend regression on the neotest integration, as
'find_buffer_by_name' will not match the passed in `path_files`.
https://github.com/mrcjkb/rustaceanvim/blob/4987d4159df2f80eb1deda1793ad54082d8ba454/lua/rustaceanvim/rust_analyzer.lua#L61-L63

In summary, neotest would send the following:

```
:Neotest run file
-- -> file_path: C:\Users\me\repos\project\src\lib.rs
-- -> root_dir: c:\Users\me\projects\src\lib.rs
-- -> vim.startswith(file_path, root_dir) -- false
No tests found!
```

This commit changes the `rust_analyzer` function to ensure we use the
normalized file path when performing the root_dir comparisson, so we can
find runnables from Neotest
bltavares added a commit to bltavares/rustaceanvim that referenced this pull request Feb 20, 2024
In PR mrcjkb#152, rustacenavim
begin storing the `root_dir` with a normalized disk drive format to
avoid spawning multiple rust-analyzers while navigating files.

This change caused an unintend regression on the neotest integration, as
'find_buffer_by_name' will not match the passed in `path_files`.
https://github.com/mrcjkb/rustaceanvim/blob/4987d4159df2f80eb1deda1793ad54082d8ba454/lua/rustaceanvim/rust_analyzer.lua#L61-L63

In summary, neotest would send the following:

```
:Neotest run file
-- -> file_path: C:\Users\me\repos\project\src\lib.rs
-- -> root_dir: c:\Users\me\projects\src\lib.rs
-- -> vim.startswith(file_path, root_dir) -- false
No tests found!
```

This commit changes the `rust_analyzer` function to ensure we use the
normalized file path when performing the root_dir comparisson, so we can
find runnables from Neotest
bltavares added a commit to bltavares/rustaceanvim that referenced this pull request Feb 20, 2024
In PR mrcjkb#152, rustacenavim
begin storing the `root_dir` with a normalized disk drive format to
avoid spawning multiple rust-analyzers while navigating files.

This change caused an unintend regression on the neotest integration, as
'vim.startswith' will not match the passed in `path_files`.
https://github.com/mrcjkb/rustaceanvim/blob/4987d4159df2f80eb1deda1793ad54082d8ba454/lua/rustaceanvim/rust_analyzer.lua#L77

In summary, neotest would send the following:

```
:Neotest run file
-- -> file_path: C:\Users\me\repos\project\src\lib.rs
-- -> root_dir: c:\Users\me\projects\src\lib.rs
-- -> vim.startswith(file_path, root_dir) -- false
No tests found!
```

This commit changes the `rust_analyzer` function to ensure we use the
normalized file path when performing the root_dir comparisson, so we can
find runnables from Neotest
bltavares added a commit to bltavares/rustaceanvim that referenced this pull request Feb 20, 2024
In PR mrcjkb#152, rustacenavim
begin storing the `root_dir` with a normalized disk drive format to
avoid spawning multiple rust-analyzers while navigating files.

This change caused an unintend regression on the neotest integration, as
'vim.startswith' will not match the passed in `path_files`.
https://github.com/mrcjkb/rustaceanvim/blob/4987d4159df2f80eb1deda1793ad54082d8ba454/lua/rustaceanvim/rust_analyzer.lua#L77

In summary, neotest would send the following:

```
:Neotest run file
-- -> file_path: C:\Users\me\repos\project\src\lib.rs
-- -> root_dir: c:\Users\me\projects\src\lib.rs
-- -> vim.startswith(file_path, root_dir) -- false
No tests found!
```

This commit changes the `rust_analyzer` function to ensure we use the
normalized file path when performing the root_dir comparisson, so we can
find runnables from Neotest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Windows] rustaceanvim spawns many instances of RustAnalyzer
2 participants