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

Bad Interaction with neoconf: Rustaceanvim ignores .vscode/settings.json lsp settings loaded by neoconf #475

Closed
6 of 7 tasks
futile opened this issue Aug 6, 2024 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@futile
Copy link

futile commented Aug 6, 2024

Have you read the docs and searched existing issues?

Neovim version (nvim -v)

v0.10.1

Operating system/version

NixOS 24.11 (unstable)

Output of :checkhealth rustaceanvim

==============================================================================
rustaceanvim: require("rustaceanvim.health").check()

Checking for Lua dependencies ~
- WARNING dap not installed. Needed for debugging features [mfussenegger/nvim-dap](https://github.com/mfussenegger/nvim-dap)

Checking external dependencies ~
- OK rust-analyzer: found rust-analyzer 1.81.0-nightly (fcc325f 2024-07-17)
- OK Cargo: found cargo 1.81.0-nightly (a2b58c3da 2024-07-16)
- OK rustc: found rustc 1.81.0-nightly (fcc325f1b 2024-07-17)

Checking config ~
- OK No errors found in config.

Checking for conflicting plugins ~
- OK No conflicting plugins detected.

Checking for tree-sitter parser ~
- OK tree-sitter parser for Rust detected.

How to reproduce the issue

1. Use a config with both `rustaceanvim` and `neoconf`
2. Add a `.vscode/settings.json` to a project, check that it is loaded by neoconf using `:Neoconf show` and/or `:Neoconf lsp`
3. `rustaceanvim` will not pick up the settings shown by `neoconf`

Expected behaviour

rustaceanvim should ideally also pick up the settings loaded from the .vscode/settings.json file by neoconf.

Alternatively: A snippet in the Readme on how to set this up? I couldn't figure it out at least, although https://github.com/mrcjkb/rustaceanvim?tab=readme-ov-file#how-to-dynamically-load-different-rust-analyzer-settings-per-project looked like it goes in this direction, but it wasn't enough for me.

Sorry for not including more detailed steps, I thought it's probably the case that neoconf tries to configure lspconfig somehow, which rustaceanvim overrides.

Actual behaviour

rustaceanvim does not pick up the settings loaded from the .vscode/settings.json file by neoconf.

The minimal config used to reproduce this issue.

vim.env.LAZY_STDPATH = '.repro'
load(vim.fn.system('curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua'))()

require('lazy.minit').repro {
  spec = {
    {
      'mrcjkb/rustaceanvim',
      version = '^5',
      init = function()
        -- Configure rustaceanvim here
        vim.g.rustaceanvim = {}
      end,
      lazy = false,
    },
    {
      "folke/neoconf.nvim",
    },
  },
}
@futile futile added the bug Something isn't working label Aug 6, 2024
@mrcjkb mrcjkb removed the bug Something isn't working label Aug 6, 2024
@mrcjkb
Copy link
Owner

mrcjkb commented Aug 6, 2024

Duplicate of

Neoconf support is not planned.
rustaceanvim has experimental support for loading .vscode/settings.json settings (disabled by default, can be enabled with vim.g.rustaceanvim.server.load_vscode_settings, see :h rustaceanvim.config).

It's been around for a while, so maybe it's time to make it non-experimental.

@mrcjkb mrcjkb added the duplicate This issue or pull request already exists label Aug 6, 2024
@mrcjkb mrcjkb closed this as completed Aug 6, 2024
@futile
Copy link
Author

futile commented Aug 6, 2024

Ohh thanks, missed that option and issue, thanks a lot for the quick reply!

@mrcjkb
Copy link
Owner

mrcjkb commented Aug 6, 2024

It's been around for a while, so maybe it's time to make it non-experimental.

https://github.com/mrcjkb/rustaceanvim/releases/tag/5.2.0

@futile
Copy link
Author

futile commented Aug 6, 2024

It's working, thanks so much! :) Only issue seems to be that variables, e.g., ${workspaceFolder}, are not expanded. Not super horrible, I can just adjust them, but wanted to let you know.

Thanks again! :)

@mrcjkb
Copy link
Owner

mrcjkb commented Aug 6, 2024

Only issue seems to be that variables, e.g., ${workspaceFolder}, are not expanded.

Yep, the support is very rudimental 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants