Conversation
There was a problem hiding this comment.
Pull Request Overview
Modernizes the Lua bootstrap workflow by promoting the Neovim 0.11+ native vim.lsp.config configuration as the default init.lua, consolidating Windows bootstrap scripts into a unified solution, and updating documentation to reflect new requirements and processes.
- Promote vim.lsp.config-based configuration to default init.lua
- Merge Windows bootstrap helpers into single install-lua.ps1 with backup, install, and sync capabilities
- Update documentation to reflect Neovim 0.11+ requirements and new entry points
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| install-lua.ps1 | Unified Windows installer with backup, local/remote install, and first-launch sync |
| install-local-lua.ps1 | Removed legacy local installer (functionality merged into install-lua.ps1) |
| init.lua | Updated to use vim.lsp.config as default, simplified plugin configuration |
| init-modern.lua | Removed experimental file (promoted to main init.lua) |
| first-launch.ps1 | Removed standalone first-launch helper (integrated into install-lua.ps1) |
| README.md | Updated requirements to Neovim 0.11+ and new installation workflow |
| QUICKSTART_LUA.md | Removed in favor of updated main documentation |
| NEOVIM_COMPAT_FIX.md | Removed legacy compatibility guide |
| LSP_CONFIG_GUIDE.md | Updated to reflect new vim.lsp.config default approach |
| FIRST_LAUNCH_GUIDE.md | Removed in favor of integrated workflow in install-lua.ps1 |
| CHANGELOG.md | Added v0.2.0 entry documenting major changes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| } | ||
| Write-Host " ✓ lazy.nvim installed" -ForegroundColor Green | ||
| } catch { | ||
| throw "无法安装 lazy.nvim:$_" |
There was a problem hiding this comment.
[nitpick] Error message contains Chinese text in an otherwise English codebase. Consider using English for consistency.
| throw "无法安装 lazy.nvim:$_" | |
| throw "Failed to install lazy.nvim: $_" |
| else | ||
| -- 降级到传统方式(需要 nvim-lspconfig 插件) | ||
| vim.notify("vim.lsp.config not available, falling back to nvim-lspconfig", vim.log.levels.WARN) | ||
| vim.notify("请使用仓库中的 config.vim 或旧版 init.lua(nvim-lspconfig)", vim.log.levels.ERROR) |
There was a problem hiding this comment.
[nitpick] Error message contains Chinese text in an otherwise English codebase. Consider using English for consistency.
| vim.notify("请使用仓库中的 config.vim 或旧版 init.lua(nvim-lspconfig)", vim.log.levels.ERROR) | |
| vim.notify("Please use config.vim from the repository or the old version of init.lua (nvim-lspconfig).", vim.log.levels.ERROR) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| if vim.lsp.config then | ||
| vim.notify("Using Neovim 0.11+ native LSP config", vim.log.levels.INFO) | ||
|
|
||
| -- 使用新的配置方式 | ||
| vim.lsp.config({ | ||
| on_attach = on_attach, | ||
| capabilities = capabilities, | ||
|
|
||
| servers = { | ||
| clangd = { | ||
| cmd = { | ||
| "clangd", | ||
| "--background-index", | ||
| "--clang-tidy", | ||
| "--header-insertion=iwyu", | ||
| "--completion-style=detailed", | ||
| "--function-arg-placeholders", | ||
| }, | ||
| filetypes = { "c", "cpp", "objc", "objcpp", "cuda" }, | ||
| }, | ||
| workspace = { | ||
| library = vim.api.nvim_get_runtime_file("", true), | ||
| checkThirdParty = false, | ||
|
|
||
| lua_ls = { | ||
| settings = { | ||
| Lua = { | ||
| diagnostics = { globals = { "vim" } }, | ||
| workspace = { | ||
| library = vim.api.nvim_get_runtime_file("", true), | ||
| checkThirdParty = false, | ||
| }, | ||
| telemetry = { enable = false }, | ||
| }, | ||
| }, | ||
| }, | ||
| telemetry = { enable = false }, | ||
| } | ||
| }, | ||
| }) | ||
| }, | ||
| }) |
There was a problem hiding this comment.
Call vim.lsp.config as a function
The new init.lua treats vim.lsp.config as an invokable function (vim.lsp.config({ … })). In Neovim 0.11 the symbol is a module table that exposes helpers like vim.lsp.config.clangd and vim.lsp.enable; it is not callable. When this branch runs on a nightly/0.11 build the expression raises attempt to call a table value, aborting startup before diagnostics and keymaps are registered, effectively disabling the entire configuration. Consider using the module’s documented entry points (vim.lsp.config.* + vim.lsp.enable/vim.lsp.start) instead of calling the table directly.
Useful? React with 👍 / 👎.
Summary
vim.lsp.configconfiguration as the defaultinit.luaand fold historical fix notes into the changeloginstall-lua.ps1that performs backups, installs, and the first-launch Lazy syncTesting
https://chatgpt.com/codex/tasks/task_e_68f10665380883289efa647fd005fd39