mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-06 02:49:33 +00:00
Merge pull request #1478 from snoweuph/feat/scad
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Treewide Checks / Validate flake (push) Waiting to run
Treewide Checks / Check formatting (push) Waiting to run
Treewide Checks / Check source tree for typos (push) Waiting to run
Treewide Checks / Validate documentation builds (push) Waiting to run
Treewide Checks / Validate documentation builds-1 (push) Waiting to run
Treewide Checks / Validate documentation builds-2 (push) Waiting to run
Treewide Checks / Validate documentation builds-3 (push) Waiting to run
Treewide Checks / Validate hyperlinks in documentation sources (push) Waiting to run
Treewide Checks / Validate Editorconfig conformance (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Treewide Checks / Validate flake (push) Waiting to run
Treewide Checks / Check formatting (push) Waiting to run
Treewide Checks / Check source tree for typos (push) Waiting to run
Treewide Checks / Validate documentation builds (push) Waiting to run
Treewide Checks / Validate documentation builds-1 (push) Waiting to run
Treewide Checks / Validate documentation builds-2 (push) Waiting to run
Treewide Checks / Validate documentation builds-3 (push) Waiting to run
Treewide Checks / Validate hyperlinks in documentation sources (push) Waiting to run
Treewide Checks / Validate Editorconfig conformance (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions
languages/openscad: init
This commit is contained in:
commit
84fbbc801f
4 changed files with 69 additions and 0 deletions
|
|
@ -77,6 +77,7 @@ isMaximal: {
|
||||||
tex.enable = isMaximal;
|
tex.enable = isMaximal;
|
||||||
|
|
||||||
# Language modules that are not as common.
|
# Language modules that are not as common.
|
||||||
|
openscad.enable = false;
|
||||||
arduino.enable = false;
|
arduino.enable = false;
|
||||||
assembly.enable = false;
|
assembly.enable = false;
|
||||||
astro.enable = false;
|
astro.enable = false;
|
||||||
|
|
|
||||||
|
|
@ -259,6 +259,11 @@
|
||||||
- Add `languages.fluent` using the official plugin. This only provides
|
- Add `languages.fluent` using the official plugin. This only provides
|
||||||
highlighting.
|
highlighting.
|
||||||
|
|
||||||
|
- Add `languages.openscad` using
|
||||||
|
[`openscad-lsp`](https://github.com/Leathong/openscad-LSP). This currently
|
||||||
|
relies on neovim builtin syntax for highlighting, and the lsp for formatting
|
||||||
|
and diagnostics.
|
||||||
|
|
||||||
- Added Debugging support to `languages.php`.
|
- Added Debugging support to `languages.php`.
|
||||||
|
|
||||||
- Added Formatting support to `languages.php` via
|
- Added Formatting support to `languages.php` via
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ in {
|
||||||
./make.nix
|
./make.nix
|
||||||
./xml.nix
|
./xml.nix
|
||||||
./fluent.nix
|
./fluent.nix
|
||||||
|
./openscad.nix
|
||||||
|
|
||||||
# This is now a hard deprecation.
|
# This is now a hard deprecation.
|
||||||
(mkRenamedOptionModule ["vim" "languages" "enableLSP"] ["vim" "lsp" "enable"])
|
(mkRenamedOptionModule ["vim" "languages" "enableLSP"] ["vim" "lsp" "enable"])
|
||||||
|
|
|
||||||
62
modules/plugins/languages/openscad.nix
Normal file
62
modules/plugins/languages/openscad.nix
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (builtins) attrNames;
|
||||||
|
inherit (lib.options) mkEnableOption mkOption literalExpression;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.types) enum listOf;
|
||||||
|
inherit (lib.meta) getExe;
|
||||||
|
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.openscad;
|
||||||
|
/*
|
||||||
|
There is no Treesitter module for OpenSCAD yet.
|
||||||
|
Luckily vim already ships with a builtin syntax that is used by default.
|
||||||
|
|
||||||
|
The LSP already ships with diagnostics, but there is also an experimental analyzer called sca2d
|
||||||
|
<https://search.nixos.org/packages?channel=unstable&query=sca2d>
|
||||||
|
But it isn't packaged for nvim-lint and would need extra work.
|
||||||
|
*/
|
||||||
|
|
||||||
|
defaultServers = ["openscad-lsp"];
|
||||||
|
servers = {
|
||||||
|
openscad-lsp = {
|
||||||
|
enable = true;
|
||||||
|
cmd = [(getExe pkgs.openscad-lsp) "--stdio"];
|
||||||
|
filetypes = ["openscad"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
options.vim.languages.openscad = {
|
||||||
|
enable = mkEnableOption "OpenSCAD language support";
|
||||||
|
|
||||||
|
lsp = {
|
||||||
|
enable =
|
||||||
|
mkEnableOption "OpenSCAD LSP support"
|
||||||
|
// {
|
||||||
|
default = config.vim.lsp.enable;
|
||||||
|
defaultText = literalExpression "config.vim.lsp.enable";
|
||||||
|
};
|
||||||
|
|
||||||
|
servers = mkOption {
|
||||||
|
type = listOf (enum (attrNames servers));
|
||||||
|
default = defaultServers;
|
||||||
|
description = "OpenSCAD LSP server to use";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.lsp.enable {
|
||||||
|
vim.lsp.servers =
|
||||||
|
mapListToAttrs (n: {
|
||||||
|
name = n;
|
||||||
|
value = servers.${n};
|
||||||
|
})
|
||||||
|
cfg.lsp.servers;
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue