diff --git a/README.md b/README.md index 6ec9635..b674e6c 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,16 @@ Other than small retouch the setup is virtually identitcal to Josean's setup, ch - Neovim 0.12 or later. - A C compiler on `PATH` (e.g. gcc from MinGW) to build treesitter parsers and telescope-fzf-native. nvim-treesitter also needs the `tree-sitter` CLI, which Mason installs; on a fresh machine parsers install once Mason has it. - For Rust, rust-analyzer from your toolchain: `rustup component add rust-analyzer`. rustaceanvim starts it (and Mason's codelldb for debugging); don't install rust-analyzer through Mason. -- For C#, the .NET SDK. Mason installs Roslyn (the language server VS Code's C# extension uses) and netcoredbg. `dc` in a C# file offers *Build and debug a project*: pick a runnable project from the solution, and it builds it (build errors go to quickfix) and starts the debugger on its output. +- For C#, the .NET 10 SDK, which the pinned Roslyn needs to install and run. Mason installs Roslyn (the language server VS Code's C# extension uses) when `dotnet` is on `PATH`, and netcoredbg. `dc` in a C# file offers *Build and debug a project*: pick a runnable project from the solution, and it builds it (build errors go to quickfix) and starts the debugger on its output. + +## WSL + +The same config runs in WSL (Ubuntu 24.04): + +- **Neovim** comes from Homebrew (`brew install neovim`), which `~/.bashrc` puts on `PATH` with `eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv bash)"`. Upgrade it with `brew upgrade neovim`; CI tests the release pinned in `.github/actions/setup-nvim/action.yml`. +- **Config**: a clone of this repo in `~/.config/nvim`. Update it with `git -C ~/.config/nvim pull`, then run `:Lazy restore` to check out the plugin commits in `lazy-lock.json`. Mason installs the language servers on the first interactive start (mason-lspconfig skips them in headless runs). Plugins, Mason packages and parsers live in `~/.local/share/nvim`; to reinstall them from scratch, move its `lazy`, `mason` and `site` folders aside and restart. +- **Tools**: `build-essential`, `unzip`, `ripgrep` and `fd-find` from apt (with `fdfind` linked as `~/.local/bin/fd`), Node.js from nvm for Mason's npm packages, Go, rustup with rust-analyzer, and lazygit (`brew install lazygit`). Without `dotnet`, Mason skips Roslyn, so C# has no language server. +- **Clipboard**: `unnamedplus` goes through `win32yank.exe` from the Windows Neovim install, which WSL finds on the Windows `PATH`. ## Updates @@ -28,6 +37,8 @@ Run the smoke test locally from this directory: nvim --headless --cmd "luafile tests/smoke.lua" ``` +In WSL, run the same command from `~/.config/nvim`. + To hide the bulk reformat commit from `git blame`, run `git config blame.ignoreRevsFile .git-blame-ignore-revs`. ## AI PR review diff --git a/lua/simonkdev/lazy/lsp/mason.lua b/lua/simonkdev/lazy/lsp/mason.lua index 6824ccd..9744efe 100644 --- a/lua/simonkdev/lazy/lsp/mason.lua +++ b/lua/simonkdev/lazy/lsp/mason.lua @@ -48,7 +48,15 @@ return { "tree-sitter-cli", -- nvim-treesitter compiles parsers with it (treesitter.lua) -- Microsoft's package from nuget.org, pinned because Mason's registry lags behind and its default is -- older than roslyn.nvim supports. The plugin update workflow doesn't bump this; do it by hand. - { "roslyn-language-server", version = "5.13.0-1.26514.10" }, + -- Mason installs it with `dotnet tool`, so skip it where there's no .NET (e.g. WSL without C#) + -- rather than report a failed install on every start. + { + "roslyn-language-server", + version = "5.13.0-1.26514.10", + condition = function() + return vim.fn.executable("dotnet") == 1 + end, + }, }, }) end,