Skip to content

Commit

Permalink
feat(programs/helix): add superhtml lsp & vscode-langservers-extracte…
Browse files Browse the repository at this point in the history
…d, remove deno config

Deno config to be added back, need to figure out a better solution.
  • Loading branch information
uncenter committed Sep 19, 2024
1 parent e516edc commit 78f8ce0
Showing 1 changed file with 77 additions and 86 deletions.
163 changes: 77 additions & 86 deletions users/uncenter/programs/helix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,97 +15,64 @@
};

languages = {
language =
let
lang-to-ext = {
javascript = "js";
json = "json";
markdown = "md";
typescript = "ts";
jsx = "jsx";
tsx = "tsx";
language = [
{
name = "nix";
formatter = {
command = lib.getExe pkgs.nixfmt-rfc-style;
};
in
[
{
name = "nix";
formatter = {
command = lib.getExe pkgs.nixfmt-rfc-style;
};
auto-format = true;
}
{
name = "python";
formatter = {
command = "ruff";
args = [
"format"
"-"
];
};
auto-format = true;
}
{
name = "fish";
formatter = {
command = "fish_indent";
};
auto-format = true;
}
{
name = "swift";
formatter = {
command = "swift-format";
args = [ "format" ];
};
auto-format = true;
}
{
name = "toml";
formatter = {
command = "taplo";
args = [
"format"
"-"
];
};
auto-format = true;
}
]
++ (lib.attrsets.mapAttrsToList (lang: ext: {
auto-format = true;
name = lang;
roots = [
"deno.json"
"deno.jsonc"
];
}
{
name = "python";
formatter = {
command = "ruff";
args = [
"fmt"
"format"
"-"
"--ext"
ext
];
command = "deno";
};
}) lang-to-ext)
++ (lib.attrsets.mapAttrsToList (lang: ext: {
name = lang;
shebangs = [
"deno"
];
roots = [
"deno.json"
"deno.jsonc"
];
file-types = [
ext
];
auto-format = true;
}
{
name = "fish";
formatter = {
command = "fish_indent";
};
auto-format = true;
}
{
name = "swift";
formatter = {
command = "swift-format";
args = [ "format" ];
};
auto-format = true;
}
{
name = "toml";
formatter = {
command = "taplo";
args = [
"format"
"-"
];
};
auto-format = true;
}
{
name = "html";
scope = "source.html";
roots = [ ];
file-types = [ "html" ];
language-servers = [
"deno-lsp"
{
name = "superhtml-lsp";
except-features = [ "format" ];
}
];
auto-format = true;
}) lang-to-ext);
}
];

language-server = {
deno-lsp = {
Expand All @@ -125,12 +92,36 @@
};
};
};
};
rust-analyzer = {
config.check.command = "clippy";
rust-analyzer = {
config.check.command = "clippy";
};
vscode-json-language-server = {
config.json.schemas = [
{
fileMatch = [
"tsconfig.json"
"tsconfig.*.json"
];
url = "https://json.schemastore.org/tsconfig.json";
}
{
fileMatch = [
"package.json"
];
url = "https://json.schemastore.org/package.json";
}
];
};
superhtml-lsp = {
command = "superhtml";
args = [ "lsp" ];
};
};
};

extraPackages = with pkgs; [ nodePackages.typescript-language-server ];
extraPackages = with pkgs; [
nodePackages.typescript-language-server
nodePackages.vscode-langservers-extracted
];
};
}

0 comments on commit 78f8ce0

Please sign in to comment.