folke / neoconf.nvim Goto Github PK
View Code? Open in Web Editor NEW๐ผ Neovim plugin to manage global and project-local settings
License: Apache License 2.0
๐ผ Neovim plugin to manage global and project-local settings
License: Apache License 2.0
Now I have to setup jsonls with setup handler:
local lspconfig = require("lspconfig")
lspconfig["jsonls"].setup({
settings = {
json = {
schemas = require("schemastore").json.schemas(),
validate = { enable = true },
},
},
})
But I want to config it in the neoconf.json
file like this:
{
"lspconfig": {
"jsonls": {
// Here I want neoconf could evaluate lua expression
"json.schemas": "require('schemastore').json.schemas()",
"json.validate.enable": true
}
}
}
N/A
No response
0.9.0
Linux
How to config for checkhealth?
Expect Neoconf checkhealth
works
![ๅพ็](https://user-images.githubusercontent.com/23305067/234752376-742ba386-0772-495a-8ebc-0433fb5b1393.png)
As title describe.
v0.9.0-dev-845+gfacbb11e0
Linux 6
When opening a crate within a cargo workspace, if a .neoconf.json
file is present at the root of the project, cargo check
(which is usually executed on save, to produce diagnostics) is instead executed at the root of the whole workspace. This either does not work at all (you don't need to have a Cargo.toml
present at the root of a workspace), or launches the check on the entire workspace, which can be prohibitively slow and expensive.
A workaround: create a .neoconf.json
file at the root of the crate, and it'll be used instead of the workspace-level one. Drawback: you need to duplicate the settings in every single crate that way. At least symlinks work.
As a side-note, it would be awesome to be able to "stack" config files within a project, where a folder could override the settings present in a parent folder, up to the root of the git repository (if one exists). This would be particularly useful for rust workspaces, for example when specifying feature flags specific to some crates.
This can be reproduced on any rust repository that contains several crates, for example nvim-oxi and checking the LSP logs.
I expect cargo check
to be run from the current working directory, as is the default behavior when no .neoconf.json
file is present.
No response
Please add a prefix to error messages that tells users where the error is coming from!
For example the nvim-lspconfig is missing error took me quite some time to track down, where it's coming from. I would be awesome if the error would read "Neoconf: nvim-lspconfig not installed?".
Since we're already talking about it: please note in the README install instructions that there is a default (but optional) dependency on nvim-lspconfig. It could read something like:
use({
"folke/neoconf.nvim",
-- if plugins.lspconfig.enabled = true (default):
requires = 'neovim/nvim-lspconfig'
})
0.9.0
Windows 11
When neoconf is loaded it internally loads "lspconfig" to check if any servers are already active.
neoconf.nvim/lua/neoconf/health.lua
Lines 66 to 75 in bbf98ce
This is fine if the only thing using neoconf are plugins that are also dependencies of lspconfig but when an external dependency (especially one that is loaded earlier than lspconfig) is ran it will cause neoconf to load lspconfig before it returns (which in this configuration loads a lsp server).
Setup
require("neoconf").setup()
should be run BEFORE setting up any lsp server with lspconfig
Neoconf doesn't load lspconfig which creates the server but instead has some way of initializing without fetching the server count or solve it some other way that I haven't thought of
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
{
'glepnir/dashboard-nvim',
event = 'VimEnter',
opts = function() return require 'neoconf'.get("plugins.dashboard", {}) end
},
{
'neovim/nvim-lspconfig',
config = function()
local lspconfig = require 'lspconfig'
lspconfig.lua_ls.setup {}
end,
event = "BufAdd",
dependencies =
{
"folke/neoconf.nvim"
}
}
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
defaults = {lazy = true}
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
NVIM v0.9.1
Windows 10 21H2
Global config files don't get recognized under Windows and the popup window for selecting / editing config files is empty
using local config files works (except they don't show up in the popup either)
Neoconf Popup should show either global or local config to edit
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
"folke/neoconf.nvim",
"neovim/nvim-lspconfig",
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
require("neoconf").setup({})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
Neoconf seems to set itself as a configuration manager of lsp server. Therefore, it requires lspconfig plugin.
But is it possible to use it as a general configuration manager for non-lsp plugins?
If we target it as a general configuration manager(manager for both lsp&non-lsp plugins), then it's kind of weird that neoconf will crash without installing lspconfig first.
0.9.1
Ubuntu 20.04
I'm trying to use neoconf to pick up the custom clangd settings from our company provided .vscode/settings.json
file at the root of our project directory.
I see that Neoconf show
does show the custom clangd
settings. I see something like this:
clangd = {
arguments = { "--malloc-trim", "--pretty", "--pch-storage=disk", "--background-index", "--compile-commands-dir=${workspaceFolder}", "-j=8", "-log=verbose" },
detectExtensionConflicts = true,
onConfigChanged = "restart",
path = "/path/to/company/provided/clangd",
restartAfterCrash = true
},
However Neoconf lsp
just shows an empty directory:
* /path/to/root/.vscode/settings.json
```lua
vim.empty_dict()
I verified that neoconf
is sourced before lspconfig
by putting print statements.
Create a directory (say /tmp/repro
)
Create a file /tmp/repro/init.lua
with contents as shown in the minimal repro box below
Create a file .vscode/settings.json
with contents below:
{
"clangd.detectExtensionConflicts": true,
"clangd.arguments": [
"--malloc-trim",
"--pretty",
"--pch-storage=disk",
"--background-index",
"--compile-commands-dir=${workspaceFolder}",
"-j=8",
"-log=verbose"
],
"clangd.restartAfterCrash": true,
"clangd.onConfigChanged": "restart",
"clangd.path": "/tmp/repro/tools/clangd",
}
You'll need to manually copy over a working clangd
into the tools
subdirectory.
Now open neovim by doing
nvim -u init.lua foo.cpp
When the C++ file is opened, LspInfo
should show the path to the clangd in the tools
subdirectory. However, it will probably error out.
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
{
-- allows for project specific settings for clangd etc.
-- Automatically picks up .vscode/settings.json etc.
"folke/neoconf.nvim",
config = function()
require('neoconf').setup()
end,
},
{
"neovim/nvim-lspconfig", -- enable LSP
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"folke/neoconf.nvim", -- neoconf needs to be setup before lspconfig
},
config = function()
local lspconfig = require('lspconfig')
-- lspconfig.clangd.setup({
-- cmd = { "/tmp/repro_neconf/proj/tools/clangd" }
-- })
lspconfig.clangd.setup({})
end
},
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
I have a need to override the cmd
entry for one of the language servers I have depending on the project directory.
From what I can understand from lspconfig plugin code, it only updates the settings
key of the server configuration.
I'd like to be able to override other configuration parameters, e.g. cmd
and have neoconf.nvim restart the affected servers when parameters other than settings
are changed.
Can't find one.
No response
neoconf.nvim/lua/neoconf/init.lua
Lines 18 to 20 in 4b82da7
Sometimes you want to generate project-specific configuration containing data that can't be statically baked.
For example, with Nix you can create a shell environment that automatically pull dependencies for the project. But sometimes, you need to pass these dependencies to the LSP configuration. Since the data is dynamic and can't be known beforehand, you can't just hardcode it in a .neoconf.json
Being able to specify the absolute path to the config file via an env var (e.g. NEOCONF_PATH
) will allow the user to dynamically generate a config file and pass the path to neoconf via the environment variable.
The only other alternative is to manually create the config file and adjust them regularly.
No response
Can we please add spec for ruff_lsp.
ruff_lsp has a spec located here:
https://raw.githubusercontent.com/astral-sh/ruff-vscode/main/package.json
From the basic understanding I can see packages being fetched form the gist, but gist is not being maintain any longer.
function M.update_index()
local url = "https://gist.githubusercontent.com/williamboman/a01c3ce1884d4b57cc93422e7eae7702/raw/lsp-packages.json"
local index = Util.fetch(url)
Util.write_file("schemas/index.json", index)
end
NA
No response
With a recent change in lua_ls (PRs listed below), the expected values for workspace.checkThirdParty
has changed from a boolean to string enum.
Please update the schema to align with the latest changes.
Please see # Describe the solution you'd like
section for the explanation of the new values.
Sidenote:
Not related to the new schema but there seems to still be an issue with type conversion atm to keep backwards compatibility working.
Change schema for lua_ls.
This lets you skip the "apply third party library to workspace configuration" prompt.
The value of Lua.workspace.checkThirdParty can now be one of:
Ask (ask every time; this is equivalent to true) Apply (always apply third-party libraries and set the workspace configuration) ApplyInMemory (always apply third-party libraries but don't set the workspace configuration) Disable (don't ask and don't apply; this is equivalent to false)
Backwards compatibility with the old boolean configuration values is maintained; true is treated as Ask and false is treated as Disable.
None.
No response
json
{
"lspconfig": {
"lua_ls": {
"Lua": {
"workspace": {
"library": {
"[vim.fn.expand('$VIMRUNTIME/lua')]": true,
"[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')]": true
}
}
}
}
}
lua
{
lspconfig = {
lua_ls = {
Lua = {
workspace = {
library = {
["[vim.fn.expand('$VIMRUNTIME/lua')]"] = true,
["[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')]"] = true
}
}
}
}
}
}
which dosent work
I think that this would be pretty neat to be able to create the different dap configurations in neoconf.nvim
as well!
I'm willing to help a bit, if you explain me what I need to do.
v0.8.3
MacOS 13.1
I'm not sure if this is a bug, but it is the only other issue template alongside feature request.
I have this config in lua/plugins/typescript_lsp.lua
Configuration lifted from Deno docs here
return {
"neovim/nvim-lspconfig",
dependencies = { "jose-elias-alvarez/typescript.nvim" },
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
tsserver = { root_dir = require("lspconfig").util.root_pattern("package.json"), single_file_support = false },
denols = { root_dir = require("lspconfig").util.root_pattern("deno.json", "deno.jsonc") },
},
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
-- setup = {
-- tsserver = function(_, opts)
-- require("typescript").setup({
-- server = opts,
-- root_dir = lspconfig.util.root_pattern("package.json"),
-- single_file_support = false,
-- })
-- return true
-- end,
-- },
},
}
But I noticed that on a directory with just deno.json
that tsserver is still activated when I do space
cl
I also tried this same thing with the file in lua/config/
and also with the part commented out uncommented, but the same experience.
I'm new to vim/LazyVim, so I might be doing sth totally wrong.
cl
, both denols and tserver will be activatedExpected result is that only denols should be on.
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
"folke/LazyVim",
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
require("config.lazy")
v0.8.3
Gentoo Linux
neoconf
automatically breaks keys with .
in the configuration into an table hierarchy for lspconfig, which makes it impossible to configure schema URLs for yamlls
Using this configuration:
{
"lspconfig": {
"yamlls": {
"yaml.schemas": {
"https://json.schemastore.org/clang-format.json": ".clang-format"
}
}
}
}
neoconf produces:
{
redhat = {
telemetry = {
enabled = false
}
},
yaml = {
schemas = {
["https://json"] = {
schemastore = {
["org/clang-format"] = {
json = ".clang-format"
}
}
}
}
}
}
nvim -u repro.lua test.yaml
:Neoconf lsp
This configuration
{
redhat = {
telemetry = {
enabled = false
}
},
yaml = {
schemas = {
["https://json.schemastore.org/clang-format"] = {
json = ".clang-format"
}
}
}
}
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
"folke/neoconf.nvim",
"neovim/nvim-lspconfig",
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
require("neoconf").setup({})
require("mason").setup({})
require("mason-lspconfig").setup({ ensure_installed = { "yamlls" } })
require("lspconfig").yamlls.setup({})
NVIM v0.9.5
archlinux
Here my .neoconf.json
file:
{
"lspconfig": {
"jdtls": {
"java.configuration.runtimes": [
{
"name": "JavaSE-17",
"path": "/home/jcabre/.sdkman/candidates/java/17.0.10-tem",
},
{
"name": "JavaSE-11",
"path": "/home/jcabre/.sdkman/candidates/java/11.0.22-tem",
"default": true
}
]
}
}
}
I'm trying to change jdt runtime using JdtSetRuntime
command, see here.
As you can see, I', getting this message:
No runtimes found in 'config.settings.java.configuration.runtimes'. You need to add runtime paths to change runtimes.
I'd also like get what are current jdtls settings. How could I get jdtls settings?
Any ideas?
neoconf.json
file seems to be ignored...new jdtls settings are populated.
Hi, I'm trying to understand the API doc: https://github.com/folke/neoconf.nvim#-api.
But still have some questions:
Neoconf
defined? I copied the sample but my neovim reports: there's no Neoconf
defined, it's nil
value.~/.config/nvim/neoconf.json
(see below), but cannot get it with API: require('neoconf').get('myconfig.perf.file.maxsize')
, nvim reports the returned value is nil
:
{
"myconfig": {
"perf.file.maxsize": 1024
}
}
I have read through documentation and even half of the source code, but still can't get in-lua auto-completion work as shown in readme.
So far, I think the key logic on in-lua(not in json config) auto-completetion, lives in lua/neoconf/plugins/lua_ls.lua
, which injects two files types/lsp.lua
& types/lua/lspconfig.lua
into lua_ls
's workspace library.
If i get it wrong, pls correct me.
I could verify that i've successfully inject those two files into lua_ls
through :Neoconf lsp
Hope someone tell me how to make it work.
v0.9.5 Release
Linux 6.6
When starting a Slint LSP, I get the following error:
[lspconfig] unhandled error: ....local/share/nvim/lazy/neoconf.nvim/lua/neoconf/util.lua:54: attempt to call upvalue 'root_dir' (a nil value)
And the server isn't started.
:se ft=slint
:LspStart
The LSP starts without errors.
-- With this repro, the server still doesn't start but I don't get the error either...
-- My regular setup uses LazyVim. Should I open an issue there?
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
"folke/neoconf.nvim",
"williamboman/mason-lspconfig.nvim",
{
"williamboman/mason.nvim",
config = function()
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = { "slint_lsp" },
})
end,
},
"neovim/nvim-lspconfig",
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
The schema gist that Neoconf is using is no longer maintained, and some LSPs are already outdated (for example, Volar), and build steps no longer generate JSON files.
Perhaps we should consider switching sources, as suggested by the original gist author? Link
Maintaining the old gist seems unlikely, as it would require a significant amount of effort
No response
0.9.1
Linux or MacOS
Relative paths in values within .vscode/settings.json
files don't work if being pulled from a parent directory outside the scope/folder currently being opened in nvim.
I have a nested folder structure containing multiple "projects" with the top-level containing a .vscode/settings.json
file.
There is a setting for rust analyzer that goes into vscode's settings.json called LinkedProjects
where you put an array of relative paths for vscode to pick up your projects properly.
This essentially keeps vscode working as expected when you have one or more rust projects not at the root folder.
When opening one of these in nvim so that a single rust project is essentially the root folder, it breaks rust analyzer (oddly just all proc macros) with a pretty much un-Googleable error:
proc macro
main
not expanded: proc macro crate is missing dylib
This is due to it going up beyond the root folder being opened, finding a .vscode/settings.json
file up in a parent folder somewhere and applying those settings relative to the folder you have opened in nvim NOT relative to the .vscode
folder it found the settings in.
My current workaround after realising what was breaking it was to just have a .neoconf.json
file inside each subfolder setting import -> vscode to false:
{
"import": {
"vscode": false
}
}
Not great if you actually need other settings from vscode's settings but at the moment I don't.
I imagine there is a much simpler way to reproduce the underlying issue but in my specific case:
Install rust with rustup.
Install nvim (I used LazyVim this time but all others I tried such as Astro etc all reproduced it).
Add rust-analyzer with Mason.
Quit nvim.
Create a new folder to act as the root folder and within it create the following .vscode/settings.json
file:
{
"rust-analyzer.linkedProjects": [
"./stuff/Cargo.toml"
]
}
cargo new stuff
Cargo.toml
file, ie:[dependencies]
tokio = { version = "1.32.0", features = ["full"]
src/main.rs
:#[tokio::main]
async fn main() {
println!("Hello, world!");
}
Now the hierarchy should look like:
/.vscode/settings.json
/stuff/Cargo.toml
/stuff/src/main.rs
other files created automatically by cargo new
omitted.
cd
into stuff
and run:
nvim .
main.rs
, wait for rust-analyzer to index and be greeted with an error on the #[tokio::main]
line.Ideally either:
I used the current out-the-box LazyVim
Some language servers use environmental variables for configuration options, with vscode settings, defining these is possible, is there some way to do this from the neoconf json config file?
There should really be some more documentation as to the format of neoconf.json file, since I find it pretty confusing to know what the structure of it should be.
many projects use a .editorconfig (ini) file. It would be nice if neoconf.nvim could import these settings or clarify it's relationship to https://github.com/editorconfig/editorconfig-vim#readme .
Kind regards,
I store my config in a different place and add it to the runtime path using vim.opt.runtimepath:append. Is there a way to tell this plugin my root directory is in some other place?
neovim-nightly
Ubuntu 22.04
I think it should set filetype when edit a new file with .neoconf.json name
when I touch .neoconf.json file then edit it, the filetype is set correctly
:e .neoconf.json
it should be set filetype with jsonc
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
"folke/neoconf.nvim",
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
v0.10.0-dev-2280+g43661a0ab-Homebrew
macOS 14.4.1
I have noticed that both .neoconf.json
and .vscode/settings.json
have no effect on the binary path that is used for clangd
.
This is probably the root cause of #40.
mkdir /tmp/bug-no-path-overwrite && cd /tmp/bug-no-path-overwrite
echo '{"lspconfig":{"clangd.path":"foo/bar"}}' > .neoconf.json && mkdir .vscode && echo '{"clangd.path":"foo/bar"}' > .vscode/settings.json && touch main.c
repro.lua
nvim -u repro.lua -c LspInfo main.c
I would expect the clangd
to point to /foo/bar
instead it points to /usr/bin/clangd
.
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
"folke/neoconf.nvim",
"neovim/nvim-lspconfig"
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- setup neoconf
require("neoconf").setup({})
-- setup clangd
require("lspconfig").clangd.setup({})
This issue is a continuation of neovim/nvim-lspconfig#2273.
Yesterday I had an issue in which my custom root_dir
configuration was being ignored. I found that it is caused by neoconf.nvim
.
Here is the minimal configuration with which it can be reproduced:
require("neoconf").setup({})
local lspconfig = require("lspconfig")
lspconfig.denols.setup({
root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc"),
})
lspconfig.tsserver.setup({
root_dir = lspconfig.util.root_pattern("package.json"),
})
You need to have either a deno or a tsserver project with a .vscode/settings.json
file.
As you can see in the following screenshot, both language servers are being loaded. If I remove the .vscode/settings.json
file it works as expected.
0.10.0-dev-1456+g4c32927084
EndeavourOS x86_64 (6.5.9-arch2-1)
coc.nvim's local config file is not loaded.
I think this part should be .vim/coc-settings.json
instead of coc-settings.json
, since coc.nvim creates local settings there:
neoconf.nvim/lua/neoconf/import.lua
Line 16 in 6443778
(This path is documented in coc.nvim: https://github.com/neoclide/coc.nvim/blob/e3f91b5ed551ae95d1f5c3b75f557f188ad17b52/doc/coc.txt#L241.)
:CocLocalConfig
.{"test.config.foo": "test"}
for example.:e test.txt
).:Neoconf
. The config is not loaded in neoconf side.echo coc#util#get_config('test.config')
. It should return {"foo": "test"}
.Neoconf loads the local coc.nvim settings.
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
"folke/neoconf.nvim",
"neovim/nvim-lspconfig",
{"neoclide/coc.nvim", branch = "release"},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
NVIM v0.9.0-dev-1115+g446c353a5
Windows 11
I opened a python file and use cmd "Neoconf local" to edit the local lsp configuration file. Then it report a bug as follow
the reference json file should be found in the right path.
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
"folke/neoconf.nvim",
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
Are there any plans to support null-ls?
NVIM v0.10.0 ***
Windows 10
hey, I noticed that the types are not being correctly updated with the language server fsautocomplete.
they just added
"FSharp.fsac.sourceTextImplementation": {
"default": "NamedText",
"description": "EXPERIMENTAL. Enables the use of a new source text implementation. This may have better memory characteristics. Requires restart.",
"enum": [
"NamedText",
"RoslynSourceText"
]
},
in between
"FSharp.fsac.netCoreDllPath": {
"default": "",
"description": "The path to the \u0027fsautocomplete.dll\u0027, a directory containing TFM-specific versions of fsautocomplete.dll, or a directory containing fsautocomplete.dll. Useful for debugging a self-built FSAC. If a DLL is specified, uses it directly. If a directory is specified and it contains TFM-specific folders (net6.0, net7.0, etc) then that directory will be probed for the best TFM to use for the current runtime. This is useful when working with a local copy of FSAC, you can point directly to the bin/Debug or bin/Release folder and it\u0027ll Just Work. Finally, if a directory is specified and there are no TFM paths, then fsautocomplete.dll from that directory is used. Requires restart.",
"scope": "machine-overridable",
"type": "string"
},
"FSharp.fsac.sourceTextImplementation": {
"default": "NamedText",
"description": "EXPERIMENTAL. Enables the use of a new source text implementation. This may have better memory characteristics. Requires restart.",
"enum": [
"NamedText",
"RoslynSourceText"
]
},
"FSharp.fsac.parallelReferenceResolution": {
"default": false,
"description": "EXPERIMENTAL: Speed up analyzing of projects in parallel. Requires restart.",
"type": "boolean"
},
I looked at the github actions for the repo and see there have been some failing ones. that might be part of what's going on.
it's not really a steps thing i don't think.
that the types would be correctly auto generated.
-- I don't think doing a minimal repro will likely help the situation, so I haven't changed anything here.
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
"folke/neoconf.nvim",
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.