vscode: nixify, fix rust-analyzer

This commit is contained in:
mehbark 2023-11-24 20:35:37 -05:00
parent 152ac1afd0
commit b864d7ce0e
2 changed files with 347 additions and 612 deletions

View file

@ -47,7 +47,6 @@ in
cargo cargo
clippy clippy
rustc rustc
rust-analyzer
rustfmt rustfmt
idris2 idris2
@ -102,7 +101,7 @@ in
enableUpdateCheck = false; enableUpdateCheck = false;
# i prefer to let vscode manage stuff # i prefer to let vscode manage stuff
mutableExtensionsDir = true; mutableExtensionsDir = true;
userSettings = import ./vscode-settings.nix; userSettings = (import ./vscode-settings.nix) { rust-analyzer = pkgs.rust-analyzer; };
}; };
programs.neovim = { programs.neovim = {

View file

@ -1,613 +1,349 @@
builtins.fromJSON { rust-analyzer }:
''
{ {
"workbench.editor.enablePreviewFromQuickOpen": false, "C_Cpp.clang_format_fallbackStyle" = "WebKit";
"rust-analyzer.checkOnSave.command": "clippy", "[c]" = {
"workbench.editor.enablePreview": false, "editor.formatOnSave" = false;
"[rust]": { "editor.insertSpaces" = false;
"editor.semanticHighlighting.enabled": true, "editor.tabSize" = 8;
"editor.defaultFormatter": "rust-lang.rust-analyzer" "editor.useTabStops" = true;
}, };
"[latex]": { "[css]" = { "editor.defaultFormatter" = "esbenp.prettier-vscode"; };
"editor.defaultFormatter": "nickfode.latex-formatter" "[handlebars]" = { "editor.defaultFormatter" = "esbenp.prettier-vscode"; };
}, "[haskell]" = { "editor.defaultFormatter" = "haskell.haskell"; };
"[python]": { "[html]" = { "editor.defaultFormatter" = "esbenp.prettier-vscode"; };
"editor.formatOnType": true "[java]" = { "editor.suggest.snippetsPreventQuickSuggestions" = false; };
}, "[javascript]" = {
"[makefile]": { "editor.defaultFormatter" = null;
"editor.insertSpaces": false "editor.formatOnSave" = true;
}, };
"[c]": { "[javascriptreact]" = {
"editor.insertSpaces": false, "editor.defaultFormatter" = "esbenp.prettier-vscode";
"editor.tabSize": 8, };
"editor.useTabStops": true, "[json]" = { "editor.defaultFormatter" = "esbenp.prettier-vscode"; };
"editor.formatOnSave": false "[jsonc]" = { "editor.defaultFormatter" = "esbenp.prettier-vscode"; };
}, "[latex]" = { "editor.defaultFormatter" = "nickfode.latex-formatter"; };
"editor.renderWhitespace": "selection", "[makefile]" = { "editor.insertSpaces" = false; };
"[java]": { "[markdown]" = {
"editor.suggest.snippetsPreventQuickSuggestions": false "editor.defaultFormatter" = "esbenp.prettier-vscode";
}, "editor.formatOnSave" = false;
"editor.formatOnSave": true, };
"editor.acceptSuggestionOnCommitCharacter": false, "[python]" = { "editor.formatOnType" = true; };
"editor.linkedEditing": true, "[rust]" = {
"git.autofetch": true, "editor.defaultFormatter" = "rust-lang.rust-analyzer";
"files.eol": "\n", "editor.semanticHighlighting.enabled" = true;
"vim.handleKeys": { };
"<C-t>": false "[typescript]" = {
}, "editor.defaultFormatter" = "denoland.vscode-deno";
"vim.leader": ";", "editor.formatOnSave" = true;
"vim.normalModeKeyBindings": [ };
{ "[typescriptreact]" = {
"before": [ "editor.defaultFormatter" = "esbenp.prettier-vscode";
"j" };
], "calva.highlight.matchedBracketStyle" = { };
"after": [ "calva.paredit.defaultKeyMap" = "original";
"g", "calva.prettyPrintingOptions" = {
"j" enabled = true;
] maxLength = 50;
}, printEngine = "pprint";
{ width = 120;
"before": [ };
"k" "dafny.verificationTimeLimit" = 3600;
], "dafny.verificationVirtualCores" = 0;
"after": [ "debug.internalConsoleOptions" = "neverOpen";
"g", "docker.commands.attach" =
"k" "$${config:docker.dockerPath} exec -it $${containerId} $${shellCommand}";
] "editor.acceptSuggestionOnCommitCharacter" = false;
}, "editor.autoIndent" = "advanced";
{ "editor.bracketPairColorization.enabled" = true;
"before": [ "editor.cursorBlinking" = "solid";
"0" "editor.cursorSmoothCaretAnimation" = "on";
], "editor.cursorStyle" = "line";
"after": [ "editor.defaultFormatter" = "denoland.vscode-deno";
"^" "editor.fontFamily" = "JetBrainsMono Nerd Font";
] "editor.fontLigatures" = true;
}, "editor.fontSize" = 16;
{ "editor.formatOnSave" = true;
"before": [ "editor.inlayHints.enabled" = "offUnlessPressed";
"t", "editor.inlineSuggest.enabled" = true;
"j" "editor.insertSpaces" = true;
], "editor.lineNumbers" = "on";
"commands": [ "editor.linkedEditing" = true;
"workbench.action.nextEditor" "editor.minimap.enabled" = false;
] "editor.minimap.showSlider" = "always";
}, "editor.quickSuggestions" = {
{ comments = "off";
"before": [ other = "on";
"t", strings = "on";
"k" };
], "editor.renderWhitespace" = "selection";
"commands": [ "editor.rulers" = [ 80 100 ];
"workbench.action.previousEditor" "editor.stickyScroll.enabled" = true;
] "editor.suggest.localityBonus" = true;
}, "editor.suggest.showStatusBar" = true;
{ "editor.tabSize" = 4;
"before": [ "editor.unicodeHighlight.invisibleCharacters" = false;
"t", "editor.wordSeparators" = ''/\()"':,;<>~!@#$$%^&*|+=[]{}`?-'';
"w" "editor.wordWrap" = "off";
], "errorLens.excludeBySource" = [ "eslint(eqeqeq)" "ts(2551)" ];
"commands": [ "files.associations" = {
"workbench.action.closeActiveEditor" "*.h" = "c";
] "*.pl" = "prolog";
}, };
{ "files.eol" = "\n";
"before": [ "files.insertFinalNewline" = true;
"f", "files.watcherExclude" = {
"f" "**/.git/objects/**" = true;
], "**/.git/subtree-cache/**" = true;
"commands": [ "**/.hg/store/**" = true;
"workbench.action.quickOpen" "**/node_modules/*/**" = true;
] "/target/**" = true;
}, };
{ "git.autofetch" = true;
"before": [ "git.confirmSync" = false;
"f", "git.enableSmartCommit" = true;
"e" "github.copilot.enable" = {
], "*" = true;
"commands": [ markdown = false;
"workbench.action.showAllEditorsByMostRecentlyUsed" plaintext = false;
] yaml = true;
}, };
{ "go.useLanguageServer" = true;
"before": [ "gruvboxMaterial.italicComments" = false;
"f", "haskell.formattingProvider" = "stylish-haskell";
"s" "haskell.ghcupExecutablePath" = "/home/mbk/.ghcup/bin/ghcup";
], "haskell.manageHLS" = "GHCup";
"commands": [ "haskell.plugin.tactics.config.auto_gas" = 8;
"workbench.action.gotoSymbol" "idris.numbersOfContinuousTypechecking" = 50;
] "idris.warnPartial" = true;
}, "latex-workshop.view.pdf.viewer" = "tab";
{ "markdown.editor.pasteUrlAsFormattedLink.enabled" = "smart";
"before": [ "ocaml.server.extendedHover" = true;
"<leader>", "oneDarkPro.italic" = false;
"z" "prettier.arrowParens" = "avoid";
], "prettier.tabWidth" = 4;
"commands": [ "remote.extensionKind" = { "pub.name" = [ "ui" ]; };
"workbench.action.toggleZenMode" "ruby.codeCompletion" = "rcodetools";
] "ruby.format" = "prettier";
}, "ruby.intellisense" = "rubyLocate";
{ "rust-analyzer.server.path" = "${rust-analyzer}/bin/rust-analyzer";
"before": [ "rust-analyzer.checkOnSave.command" = "clippy";
"<leader>", "rust-analyzer.checkOnSave.extraArgs" = [ "--" "-W" "clippy::pedantic" ];
"w" "rust-analyzer.debug.openDebugPane" = true;
], "rust-analyzer.inlayHints.closureReturnTypeHints.enable" = "always";
"commands": [ "rust-analyzer.inlayHints.lifetimeElisionHints.enable" = "always";
":w" "rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames" = true;
] "rust-analyzer.inlayHints.maxLength" = null;
}, "rust-analyzer.inlayHints.reborrowHints.enable" = "always";
{ "rust-analyzer.lens.debug" = false;
"before": [ "rust-analyzer.lens.enable" = false;
"<leader>", "rust-analyzer.lens.implementations" = false;
"q" "rust-analyzer.lens.run" = false;
], "security.workspace.trust.untrustedFiles" = "open";
"commands": [ "settingsSync.ignoredExtensions" = [ ];
":q" "syntax.highlightLanguages" = [
]
},
{
"before": [
"<leader>",
"d"
],
"commands": [
"editor.action.showHover"
]
},
{
"before": [
"<leader>",
"f"
],
"commands": [
"editor.action.quickFix"
]
},
{
"before": [
"<leader>",
"t"
],
"commands": [
"editor.action.peekTypeDefinition"
]
},
{
"before": [
"<leader>",
"g"
],
"commands": [
"editor.action.revealDefinition"
]
},
{
"before": [
"<leader>",
"c" "c"
], "cpp"
"commands": [ "python"
"rust-analyzer.run" "typescript"
] "typescriptreact"
}, "javascript"
{ "go"
"before": [ "rust"
"<leader>", "php"
"r", "ruby"
"n" "shellscript"
], "ocaml"
"commands": [
"editor.action.rename"
]
},
{
"before": [
"<c-j>"
],
"commands": [
"editor.action.marker.nextInFiles"
]
},
{
"before": [
"<c-k>"
],
"commands": [
"editor.action.marker.prevInFiles"
]
},
{
"before": [
"<leader>",
"p",
"c"
],
"commands": [
"picat.run.document"
]
},
{
"before": [
"<leader>",
"s",
"h"
],
"commands": [
"paredit.slurpSexpBackward"
]
},
{
"before": [
"<leader>",
"s",
"l"
],
"commands": [
"paredit.slurpSexpForward"
]
},
{
"before": [
"<leader>",
"s",
"w",
"p"
],
"commands": [
"paredit.wrapAroundParens"
]
},
{
"before": [
"<leader>",
"s",
"w",
"b"
],
"commands": [
"paredit.wrapAroundSquare"
]
},
{
"before": [
"<leader>",
"s",
"w",
"c"
],
"commands": [
"paredit.wrapAroundCurly"
]
},
{
"before": [
"<leader>",
"s",
"w",
"p"
],
"commands": [
"paredit.wrapAroundParens"
]
},
{
"before": [
"<leader>",
"b",
"h"
],
"commands": [
"paredit.barfSexpBackward"
]
},
{
"before": [
"<leader>",
"b",
"l"
],
"commands": [
"paredit.barfSexpForward"
]
},
{
"before": [
"<leader>",
"s",
"t"
],
"commands": [
"paredit.transpose"
]
},
{
"before": [
"<leader>",
"s",
"t"
],
"commands": [
"paredit.transpose"
]
},
{
"before": [
"<leader>",
"s",
"e"
],
"commands": [
"calva.evaluateCurrentTopLevelForm"
]
},
{
"before": [
"<leader>",
"s",
"s"
],
"commands": [
"calva.evaluateSelection"
]
},
{
"before": [
"<leader>",
"s",
"f"
],
"commands": [
"calva.sendCurrentFormToOutputWindow"
]
},
{
"before": [
"<leader>",
"s",
"o"
],
"commands": [
"calva.showOutputWindow"
]
},
{
"before": [
"<leader>",
"i",
"l"
],
"commands": [
"idris.make-lemma"
]
},
{
"before": [
"<leader>",
"i",
"f",
"h"
],
"commands": [
"idris.proof-search"
]
},
{
"before": [
"<leader>",
"i",
"c",
"s"
],
"commands": [
"idris.case-split"
]
},
{
"before": [
"<leader>",
"i",
"t",
"c"
],
"commands": [
"idris.typecheck"
]
},
{
"before": [
"<leader>",
"i",
"m"
],
"commands": [
"idris.add-clause"
]
}
],
"vim.useSystemClipboard": true,
"vim.easymotion": true,
"vim.highlightedyank.enable": true,
"vim.smartRelativeLine": true,
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.fontFamily": "JetBrainsMono Nerd Font",
"editor.fontLigatures": true,
"git.confirmSync": false,
"terminal.integrated.scrollback": 100000,
"go.useLanguageServer": true,
"[javascript]": {
"editor.defaultFormatter": null,
"editor.formatOnSave": true
},
"terminal.integrated.commandsToSkipShell": [
"-workbench.action.quickOpen"
],
"[typescript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "denoland.vscode-deno"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.rulers": [
80,
100
],
"git.enableSmartCommit": true,
"typescript.updateImportsOnFileMove.enabled": "always",
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"terminal.integrated.tabs.enabled": true,
"terminal.integrated.defaultProfile.linux": "fish",
"editor.tabSize": 4,
"editor.cursorStyle": "line",
"editor.lineNumbers": "on",
"editor.wordSeparators": "/\\()\"':,;<>~!@#$$%^&*|+=[]{}`?-",
"editor.wordWrap": "off",
"window.restoreWindows": "none",
"editor.quickSuggestions": {
"other": "on",
"comments": "off",
"strings": "on"
},
"window.autoDetectColorScheme": true,
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"**/.hg/store/**": true,
"/target/**": true
},
"editor.inlineSuggest.enabled": true,
"github.copilot.enable": {
"*": true,
"yaml": true,
"plaintext": false,
"markdown": false
},
"editor.bracketPairColorization.enabled": true,
"security.workspace.trust.untrustedFiles": "open",
"editor.inlayHints.enabled": "offUnlessPressed",
"rust-analyzer.lens.run": false,
"rust-analyzer.lens.debug": false,
"rust-analyzer.lens.implementations": false,
"editor.cursorSmoothCaretAnimation": "on",
"editor.cursorBlinking": "solid",
"workbench.iconTheme": "gruvbox-material-icon-theme",
"window.titleBarStyle": "custom",
"workbench.layoutControl.enabled": true,
"workbench.layoutControl.type": "both",
"files.insertFinalNewline": true,
"editor.insertSpaces": true,
"oneDarkPro.italic": false,
"latex-workshop.view.pdf.viewer": "tab",
"[handlebars]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.fontSize": 16,
"settingsSync.ignoredExtensions": [],
"syntax.highlightLanguages": [
"c",
"cpp",
"python",
"typescript",
"typescriptreact",
"javascript",
"go",
"rust",
"php",
"ruby",
"shellscript",
"ocaml",
"lua" "lua"
], ];
"editor.suggest.localityBonus": true, "terminal.integrated.commandsToSkipShell" = [ "-workbench.action.quickOpen" ];
"[css]": { "terminal.integrated.defaultProfile.linux" = "fish";
"editor.defaultFormatter": "esbenp.prettier-vscode" "terminal.integrated.fontSize" = 15;
}, "terminal.integrated.scrollback" = 100000;
"[markdown]": { "terminal.integrated.tabs.enabled" = true;
"editor.defaultFormatter": "esbenp.prettier-vscode", "twind.debug" = true;
"editor.formatOnSave": false "typescript.updateImportsOnFileMove.enabled" = "always";
}, "vim.easymotion" = true;
"prettier.arrowParens": "avoid", "vim.handleKeys" = { "<C-t>" = false; };
"prettier.tabWidth": 4, "vim.highlightedyank.enable" = true;
"rust-analyzer.lens.enable": false, "vim.leader" = ";";
"workbench.startupEditor": "none", "vim.normalModeKeyBindings" = [
"workbench.editorAssociations": { {
"*.jpg": "imagePreview.previewEditor" after = [ "g" "j" ];
}, before = [ "j" ];
"gruvboxMaterial.italicComments": false, }
"rust-analyzer.inlayHints.maxLength": null, {
"rust-analyzer.debug.openDebugPane": true, after = [ "g" "k" ];
"rust-analyzer.inlayHints.closureReturnTypeHints.enable": "always", before = [ "k" ];
"rust-analyzer.inlayHints.lifetimeElisionHints.enable": "always", }
"rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames": true, {
"rust-analyzer.inlayHints.reborrowHints.enable": "always", after = [ "^" ];
"rust-analyzer.checkOnSave.extraArgs": [ before = [ "0" ];
"--", }
"-W", {
"clippy::pedantic" before = [ "t" "j" ];
], commands = [ "workbench.action.nextEditor" ];
"editor.unicodeHighlight.invisibleCharacters": false, }
"remote.extensionKind": { {
"pub.name": [ before = [ "t" "k" ];
"ui" commands = [ "workbench.action.previousEditor" ];
] }
}, {
"docker.commands.attach": "$${config:docker.dockerPath} exec -it $${containerId} $${shellCommand}", before = [ "t" "w" ];
"C_Cpp.clang_format_fallbackStyle": "WebKit", commands = [ "workbench.action.closeActiveEditor" ];
"editor.stickyScroll.enabled": true, }
"workbench.colorTheme": "One Dark Pro Darker", {
"files.associations": { before = [ "f" "f" ];
"*.h": "c", commands = [ "workbench.action.quickOpen" ];
"*.pl": "prolog" }
}, {
"editor.minimap.showSlider": "always", before = [ "f" "e" ];
"haskell.formattingProvider": "stylish-haskell", commands = [ "workbench.action.showAllEditorsByMostRecentlyUsed" ];
"editor.minimap.enabled": false, }
"[haskell]": { {
"editor.defaultFormatter": "haskell.haskell" before = [ "f" "s" ];
}, commands = [ "workbench.action.gotoSymbol" ];
"calva.highlight.matchedBracketStyle": {}, }
"calva.paredit.defaultKeyMap": "original", {
"editor.autoIndent": "advanced", before = [ "<leader>" "z" ];
"calva.prettyPrintingOptions": { commands = [ "workbench.action.toggleZenMode" ];
"printEngine": "pprint", }
"enabled": true, {
"width": 120, before = [ "<leader>" "w" ];
"maxLength": 50 commands = [ ":w" ];
}, }
"[javascriptreact]": { {
"editor.defaultFormatter": "esbenp.prettier-vscode" before = [ "<leader>" "q" ];
}, commands = [ ":q" ];
"errorLens.excludeBySource": [ }
"eslint(eqeqeq)", {
"ts(2551)" before = [ "<leader>" "d" ];
], commands = [ "editor.action.showHover" ];
"terminal.integrated.fontSize": 15, }
"dafny.verificationTimeLimit": 3600, {
"dafny.verificationVirtualCores": 0, before = [ "<leader>" "f" ];
"editor.defaultFormatter": "denoland.vscode-deno", commands = [ "editor.action.quickFix" ];
"haskell.manageHLS": "GHCup", }
"haskell.ghcupExecutablePath": "/home/mbk/.ghcup/bin/ghcup", {
"haskell.plugin.tactics.config.auto_gas": 8, before = [ "<leader>" "t" ];
"markdown.editor.pasteUrlAsFormattedLink.enabled": "smart", commands = [ "editor.action.peekTypeDefinition" ];
"ocaml.server.extendedHover": true, }
"idris.warnPartial": true, {
"idris.numbersOfContinuousTypechecking": 50, before = [ "<leader>" "g" ];
"zig.zigPath": "", commands = [ "editor.action.revealDefinition" ];
"debug.internalConsoleOptions": "neverOpen", }
"zig.zls.enabled": true, {
"zig.zls.path": "/home/mbk/.config/Code/User/globalStorage/ziglang.vscode-zig/zls_install/zls", before = [ "<leader>" "c" ];
"ruby.codeCompletion": "rcodetools", commands = [ "rust-analyzer.run" ];
"ruby.intellisense": "rubyLocate", }
"ruby.format": "prettier", {
"window.commandCenter": false, before = [ "<leader>" "r" "n" ];
"editor.suggest.showStatusBar": true, commands = [ "editor.action.rename" ];
"twind.debug": true }
{
before = [ "<c-j>" ];
commands = [ "editor.action.marker.nextInFiles" ];
}
{
before = [ "<c-k>" ];
commands = [ "editor.action.marker.prevInFiles" ];
}
{
before = [ "<leader>" "p" "c" ];
commands = [ "picat.run.document" ];
}
{
before = [ "<leader>" "s" "h" ];
commands = [ "paredit.slurpSexpBackward" ];
}
{
before = [ "<leader>" "s" "l" ];
commands = [ "paredit.slurpSexpForward" ];
}
{
before = [ "<leader>" "s" "w" "p" ];
commands = [ "paredit.wrapAroundParens" ];
}
{
before = [ "<leader>" "s" "w" "b" ];
commands = [ "paredit.wrapAroundSquare" ];
}
{
before = [ "<leader>" "s" "w" "c" ];
commands = [ "paredit.wrapAroundCurly" ];
}
{
before = [ "<leader>" "s" "w" "p" ];
commands = [ "paredit.wrapAroundParens" ];
}
{
before = [ "<leader>" "b" "h" ];
commands = [ "paredit.barfSexpBackward" ];
}
{
before = [ "<leader>" "b" "l" ];
commands = [ "paredit.barfSexpForward" ];
}
{
before = [ "<leader>" "s" "t" ];
commands = [ "paredit.transpose" ];
}
{
before = [ "<leader>" "s" "t" ];
commands = [ "paredit.transpose" ];
}
{
before = [ "<leader>" "s" "e" ];
commands = [ "calva.evaluateCurrentTopLevelForm" ];
}
{
before = [ "<leader>" "s" "s" ];
commands = [ "calva.evaluateSelection" ];
}
{
before = [ "<leader>" "s" "f" ];
commands = [ "calva.sendCurrentFormToOutputWindow" ];
}
{
before = [ "<leader>" "s" "o" ];
commands = [ "calva.showOutputWindow" ];
}
{
before = [ "<leader>" "i" "l" ];
commands = [ "idris.make-lemma" ];
}
{
before = [ "<leader>" "i" "f" "h" ];
commands = [ "idris.proof-search" ];
}
{
before = [ "<leader>" "i" "c" "s" ];
commands = [ "idris.case-split" ];
}
{
before = [ "<leader>" "i" "t" "c" ];
commands = [ "idris.typecheck" ];
}
{
before = [ "<leader>" "i" "m" ];
commands = [ "idris.add-clause" ];
}
];
"vim.smartRelativeLine" = true;
"vim.useSystemClipboard" = true;
"window.autoDetectColorScheme" = true;
"window.commandCenter" = false;
"window.restoreWindows" = "none";
"window.titleBarStyle" = "custom";
"workbench.colorTheme" = "One Dark Pro Darker";
"workbench.editor.enablePreview" = false;
"workbench.editor.enablePreviewFromQuickOpen" = false;
"workbench.editorAssociations" = { "*.jpg" = "imagePreview.previewEditor"; };
"workbench.iconTheme" = "gruvbox-material-icon-theme";
"workbench.layoutControl.enabled" = true;
"workbench.layoutControl.type" = "both";
"workbench.startupEditor" = "none";
"zig.zigPath" = "";
"zig.zls.enabled" = true;
"zig.zls.path" =
"/home/mbk/.config/Code/User/globalStorage/ziglang.vscode-zig/zls_install/zls";
} }
''