mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-10 23:13:17 +00:00
Merge branch 'main' into no-default-mappings-option
This commit is contained in:
commit
5074314b56
11 changed files with 149 additions and 33 deletions
3
.github/typos.toml
vendored
3
.github/typos.toml
vendored
|
|
@ -10,6 +10,7 @@ default.extend-ignore-words-re = [
|
|||
"esy",
|
||||
"BA", # somehow "BANanaD3V" is valid, but BA is not...
|
||||
"Emac",
|
||||
"tese" # for glsl shaders
|
||||
"tese", # for glsl shaders
|
||||
"Caue",
|
||||
]
|
||||
|
||||
|
|
|
|||
6
.github/workflows/cachix.yml
vendored
6
.github/workflows/cachix.yml
vendored
|
|
@ -25,7 +25,7 @@ jobs:
|
|||
name: Checkout
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v31.10.3
|
||||
uses: cachix/install-nix-action@v31.10.4
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
extra_nix_config: |
|
||||
|
|
@ -36,7 +36,7 @@ jobs:
|
|||
with:
|
||||
authToken: ${{ secrets.CACHIX_TOKEN }}
|
||||
extraPullNames: nix-community
|
||||
name: neovim-flake
|
||||
name: nvf
|
||||
|
||||
- name: Set default git branch (to reduce log spam)
|
||||
run: git config --global init.defaultBranch main
|
||||
|
|
@ -44,5 +44,5 @@ jobs:
|
|||
- name: Validate Flakes
|
||||
run: nix flake check
|
||||
|
||||
- name: Build neovim-flake with default settings
|
||||
- name: Build nvf with default settings
|
||||
run: nix build .#${{ matrix.package }} --print-build-logs
|
||||
|
|
|
|||
10
.github/workflows/check.yml
vendored
10
.github/workflows/check.yml
vendored
|
|
@ -18,7 +18,7 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- uses: cachix/install-nix-action@v31.10.3
|
||||
- uses: cachix/install-nix-action@v31.10.4
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
extra_nix_config: |
|
||||
|
|
@ -37,7 +37,7 @@ jobs:
|
|||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v31.10.3
|
||||
uses: cachix/install-nix-action@v31.10.4
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
extra_nix_config: |
|
||||
|
|
@ -93,7 +93,7 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- uses: cachix/install-nix-action@v31.10.3
|
||||
- uses: cachix/install-nix-action@v31.10.4
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
extra_nix_config: |
|
||||
|
|
@ -131,7 +131,7 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- uses: cachix/install-nix-action@v31.10.3
|
||||
- uses: cachix/install-nix-action@v31.10.4
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
extra_nix_config: |
|
||||
|
|
@ -169,7 +169,7 @@ jobs:
|
|||
cat "$HOME/changed_files"
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v31.10.3
|
||||
uses: cachix/install-nix-action@v31.10.4
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
extra_nix_config: |
|
||||
|
|
|
|||
8
.github/workflows/docs-preview.yml
vendored
8
.github/workflows/docs-preview.yml
vendored
|
|
@ -25,13 +25,19 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: cachix/install-nix-action@v31.10.3
|
||||
- uses: cachix/install-nix-action@v31.10.4
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
extra_nix_config: |
|
||||
substituters = https://cache.nixos.org/ https://feel-co.cachix.org
|
||||
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= feel-co.cachix.org-1:nwEFNnwZvtl4KKSH5LDg+/+K7bV0vcs6faMHAJ6xx0w=
|
||||
|
||||
- uses: cachix/cachix-action@v17
|
||||
with:
|
||||
authToken: ${{ secrets.CACHIX_TOKEN }}
|
||||
extraPullNames: nix-community
|
||||
name: nvf
|
||||
|
||||
- name: Set default git branch (to reduce log spam)
|
||||
run: git config --global init.defaultBranch main
|
||||
|
||||
|
|
|
|||
2
.github/workflows/manual.yml
vendored
2
.github/workflows/manual.yml
vendored
|
|
@ -44,7 +44,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: cachix/install-nix-action@v31.10.3
|
||||
- uses: cachix/install-nix-action@v31.10.4
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
extra_nix_config: |
|
||||
|
|
|
|||
2
.github/workflows/update.yml
vendored
2
.github/workflows/update.yml
vendored
|
|
@ -12,7 +12,7 @@ jobs:
|
|||
uses: actions/checkout@v6
|
||||
|
||||
- name: "Install Nix"
|
||||
uses: cachix/install-nix-action@v31.10.3
|
||||
uses: cachix/install-nix-action@v31.10.4
|
||||
|
||||
- name: Set up Git
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ When working with NodeJS, which is _obviously_ known for its meticulous
|
|||
standards, most things are bound to work as expected but some projects, tools
|
||||
and settings may fool the default configurations of tools provided by **nvf**.
|
||||
|
||||
If
|
||||
|
||||
If [eslint-plugin-prettier] or similar is included, you might get a situation
|
||||
where your Eslint configuration diagnoses your formatting according to its own
|
||||
config (usually `.eslintrc.js`). The issue there is your formatting is made via
|
||||
|
|
|
|||
|
|
@ -304,6 +304,8 @@
|
|||
|
||||
- Added `languages.jq`. Supports highlighting, formatting and lsp.
|
||||
|
||||
- Extend `languages.asm` to support more filetypes out of the box.
|
||||
|
||||
- Didn't Add
|
||||
[`syntax-gaslighting`](https://github.com/NotAShelf/syntax-gaslighting.nvim),
|
||||
you're crazy.
|
||||
|
|
@ -381,4 +383,8 @@ https://github.com/gorbit99/codewindow.nvim
|
|||
|
||||
- Added configuration option for `foldenable`
|
||||
|
||||
[CaueAnjos](https://github.com/caueanjos)
|
||||
|
||||
- Add razor support for `roslyn_ls` and `csharp_ls`
|
||||
|
||||
<!-- vim: set textwidth=80: -->
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
asm-lsp = {
|
||||
enable = true;
|
||||
cmd = [(getExe pkgs.asm-lsp)];
|
||||
filetypes = ["asm" "vmasm"];
|
||||
filetypes = ["asm" "nasm" "masm" "vmasm" "fasm" "tasm" "tiasm" "asm68k" "asm8300"];
|
||||
root_markers = [".asm-lsp.toml" ".git"];
|
||||
};
|
||||
};
|
||||
|
|
@ -33,7 +33,9 @@ in {
|
|||
default = config.vim.languages.enableTreesitter;
|
||||
defaultText = literalExpression "config.vim.languages.enableTreesitter";
|
||||
};
|
||||
package = mkGrammarOption pkgs "asm";
|
||||
packageASM = mkGrammarOption pkgs "asm";
|
||||
packageNASM = mkGrammarOption pkgs "nasm";
|
||||
packagePicoASM = mkGrammarOption pkgs "picoasm";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
|
|
@ -53,7 +55,11 @@ in {
|
|||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
vim.treesitter.grammars = [
|
||||
cfg.treesitter.packageASM
|
||||
cfg.treesitter.packageNASM
|
||||
cfg.treesitter.packagePicoASM
|
||||
];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
inherit (lib.meta) getExe;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.nvim.types) mkGrammarOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption deprecatedSingleOrListOf;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
|
||||
|
|
@ -24,9 +24,6 @@
|
|||
in
|
||||
optionalString (key != null) "vim.keymap.set('n', '${key}', ${action}, {buffer=bufnr, noremap=true, silent=true, desc='${desc}'})";
|
||||
|
||||
# Omnisharp doesn't have colors in popup docs for some reason, and I've also
|
||||
# seen mentions of it being way slower, so until someone finds missing
|
||||
# functionality, this will be the default.
|
||||
defaultServers = ["csharp_ls"];
|
||||
servers = {
|
||||
omnisharp = {
|
||||
|
|
@ -118,8 +115,8 @@
|
|||
};
|
||||
|
||||
csharp_ls = {
|
||||
cmd = [(lib.getExe pkgs.csharp-ls)];
|
||||
filetypes = ["cs"];
|
||||
cmd = [(lib.getExe pkgs.csharp-ls) "--features" "razor-support"];
|
||||
filetypes = ["cs" "razor"];
|
||||
root_dir = mkLuaInline ''
|
||||
function(bufnr, on_dir)
|
||||
local function find_root_pattern(fname, lua_pattern)
|
||||
|
|
@ -162,19 +159,85 @@
|
|||
'';
|
||||
init_options = {};
|
||||
};
|
||||
|
||||
roslyn = let
|
||||
pkg = pkgs.vscode-extensions.ms-dotnettools.csharp;
|
||||
pluginRoot = "${pkg}/share/vscode/extensions/ms-dotnettools.csharp";
|
||||
exe = "${pluginRoot}/.roslyn/Microsoft.CodeAnalysis.LanguageServer";
|
||||
razorSourceGenerator = "${pluginRoot}/.razorExtension/Microsoft.CodeAnalysis.LanguageServer";
|
||||
razorDesignTimePath = "${pluginRoot}/.razorExtension/Targets/Microsoft.NET.Sdk.Razor.DesignTime.targets";
|
||||
razorExtension = "${pluginRoot}/.razorExtension/Microsoft.VisualStudioCode.RazorExtension.dll";
|
||||
in {
|
||||
cmd = mkLuaInline ''
|
||||
{
|
||||
"dotnet",
|
||||
"${exe}.dll",
|
||||
"--stdio",
|
||||
"--logLevel=Information",
|
||||
"--extensionLogDirectory=" .. vim.fs.dirname(vim.lsp.get_log_path()),
|
||||
"--razorSourceGenerator=${razorSourceGenerator}",
|
||||
"--razorDesignTimePath=${razorDesignTimePath}",
|
||||
"--extension=${razorExtension}",
|
||||
}
|
||||
'';
|
||||
|
||||
filetypes = ["cs" "razor"];
|
||||
root_dir = mkLuaInline ''
|
||||
function(bufnr, on_dir)
|
||||
local function find_root_pattern(fname, lua_pattern)
|
||||
return vim.fs.root(0, function(name, path)
|
||||
return name:match(lua_pattern)
|
||||
end)
|
||||
end
|
||||
|
||||
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||
on_dir(find_root_pattern(fname, "%.sln$") or find_root_pattern(fname, "%.csproj$"))
|
||||
end
|
||||
'';
|
||||
init_options = {};
|
||||
};
|
||||
};
|
||||
|
||||
extraServerPlugins = {
|
||||
omnisharp = ["omnisharp-extended-lsp-nvim"];
|
||||
csharp_ls = ["csharpls-extended-lsp-nvim"];
|
||||
roslyn_ls = [];
|
||||
roslyn = ["roslyn-nvim"];
|
||||
};
|
||||
|
||||
cfg = config.vim.languages.csharp;
|
||||
in {
|
||||
options = {
|
||||
vim.languages.csharp = {
|
||||
enable = mkEnableOption "C# language support";
|
||||
enable = mkEnableOption ''
|
||||
C# language support.
|
||||
|
||||
::: {.note}
|
||||
This feature will not work if the .NET SDK is not installed.
|
||||
Both `roslyn` (with `roslyn-nvim`) and `csharp_ls` require the .NET SDK to function properly with Razor.
|
||||
Ensure that the .NET SDK is installed.
|
||||
|
||||
Check for version compatibility for optimal performance.
|
||||
:::
|
||||
|
||||
::: {.warning}
|
||||
At the moment, only `roslyn`(with roslyn-nvim) provides full Razor support.
|
||||
`csharp_ls` is limited to `.cshtml` files.
|
||||
:::
|
||||
'';
|
||||
|
||||
extensions = {
|
||||
roslyn-nvim = {
|
||||
enable = mkEnableOption ''
|
||||
Roslyn LSP plugin for neovim
|
||||
|
||||
::: {.note}
|
||||
This feature only works for `roslyn` (not `roslyn_ls`).
|
||||
:::
|
||||
'';
|
||||
setupOpts = mkPluginSetupOption "roslyn-nvim" {};
|
||||
};
|
||||
};
|
||||
|
||||
treesitter = {
|
||||
enable =
|
||||
|
|
@ -183,7 +246,8 @@ in {
|
|||
default = config.vim.languages.enableTreesitter;
|
||||
defaultText = literalExpression "config.vim.languages.enableTreesitter";
|
||||
};
|
||||
package = mkGrammarOption pkgs "c_sharp";
|
||||
csPackage = mkGrammarOption pkgs "c_sharp";
|
||||
razorPackage = mkGrammarOption pkgs "razor";
|
||||
};
|
||||
|
||||
lsp = {
|
||||
|
|
@ -205,17 +269,39 @@ in {
|
|||
config = mkIf cfg.enable (mkMerge [
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
vim.treesitter.grammars = [cfg.treesitter.package];
|
||||
vim.treesitter.grammars = with cfg.treesitter; [csPackage razorPackage];
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.enable {
|
||||
vim.startPlugins = concatMap (server: extraServerPlugins.${server}) cfg.lsp.servers;
|
||||
vim.lsp.servers =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = servers.${name};
|
||||
})
|
||||
cfg.lsp.servers;
|
||||
vim = {
|
||||
startPlugins = concatMap (server: extraServerPlugins.${server}) cfg.lsp.servers;
|
||||
luaConfigRC.razorFileTypes =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''
|
||||
-- Set unknown file types!
|
||||
vim.filetype.add {
|
||||
extension = {
|
||||
razor = "razor",
|
||||
cshtml = "razor",
|
||||
},
|
||||
}
|
||||
'';
|
||||
lsp.servers =
|
||||
mapListToAttrs (name: {
|
||||
inherit name;
|
||||
value = servers.${name};
|
||||
})
|
||||
cfg.lsp.servers;
|
||||
};
|
||||
})
|
||||
(mkIf cfg.extensions.roslyn-nvim.enable {
|
||||
vim = mkMerge [
|
||||
{
|
||||
startPlugins = ["roslyn-nvim"];
|
||||
}
|
||||
];
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2490,6 +2490,19 @@
|
|||
"url": "https://github.com/rose-pine/neovim/archive/cf2a288696b03d0934da713d66c6d71557b5c997.tar.gz",
|
||||
"hash": "sha256-rwCsGLt2XwGvHN7DMgt3j9yKPNc2LVUfHYPECHx5xG8="
|
||||
},
|
||||
"roslyn-nvim": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
"type": "GitHub",
|
||||
"owner": "seblyng",
|
||||
"repo": "roslyn.nvim"
|
||||
},
|
||||
"branch": "main",
|
||||
"submodules": false,
|
||||
"revision": "24f7c91ee5e09c63104deaab68f932620f25c24a",
|
||||
"url": "https://github.com/seblyng/roslyn.nvim/archive/24f7c91ee5e09c63104deaab68f932620f25c24a.tar.gz",
|
||||
"hash": "sha256-a/Slmkrz/4P/rfRhPa1W5kGV7joQNTN0Un7bbncCnk0="
|
||||
},
|
||||
"rtp-nvim": {
|
||||
"type": "Git",
|
||||
"repository": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue