-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* r: implementing lsp * r: version bump to context fixes treesitter bug * r: changing treesitter package definition to mkGrammarOption * added changelog entry * created otter file * created otter file * update * update * otter: fixing fixing input * committing flake.lock * fixed typo * configuration: disabling ccc and enabling otter * added assertion to make sure ccc and otter aren't enabled at the same time * configuration: otter set for isMaximal * otter: changelog * otter: better changelog * otter-nvim: renamed from otter to otter-nvim * otter: added setupopts --------- Co-authored-by: raf <[email protected]>
- Loading branch information
Showing
9 changed files
with
137 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
./trouble | ||
./lsp-signature | ||
./lightbulb | ||
./otter | ||
./lspkind | ||
./lsplines | ||
./nvim-docs-view | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
config, | ||
lib, | ||
... | ||
}: let | ||
inherit (lib.modules) mkIf mkMerge; | ||
inherit (lib.nvim.dag) entryAnywhere; | ||
inherit (lib.nvim.lua) toLuaObject; | ||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding; | ||
|
||
cfg = config.vim.lsp; | ||
|
||
self = import ./otter.nix {inherit lib;}; | ||
mappingDefinitions = self.options.vim.lsp.otter-nvim.mappings; | ||
mappings = addDescriptionsToMappings cfg.otter-nvim.mappings mappingDefinitions; | ||
in { | ||
config = mkIf (cfg.enable && cfg.otter-nvim.enable) { | ||
assertions = [ | ||
{ | ||
assertion = !config.vim.utility.ccc.enable; | ||
message = '' | ||
ccc and otter have a breaking conflict. It's been reported upstream. Until it's fixed, disable one of them | ||
''; | ||
} | ||
]; | ||
vim = { | ||
startPlugins = ["otter-nvim"]; | ||
|
||
maps.normal = mkMerge [ | ||
(mkSetBinding mappings.toggle "<cmd>lua require'otter'.activate()<CR>") | ||
]; | ||
|
||
pluginRC.otter-nvim = entryAnywhere '' | ||
-- Enable otter diagnostics viewer | ||
require("otter").setup({${toLuaObject cfg.otter-nvim.setupOpts}}) | ||
''; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
imports = [ | ||
./otter.nix | ||
./config.nix | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{lib, ...}: let | ||
inherit (lib.options) mkOption mkEnableOption; | ||
inherit (lib.nvim.binds) mkMappingOption; | ||
inherit (lib.types) bool str listOf; | ||
inherit (lib.nvim.types) mkPluginSetupOption; | ||
in { | ||
options.vim.lsp = { | ||
otter-nvim = { | ||
enable = mkEnableOption '' | ||
lsp features and a code completion source for code embedded in other documents [otter-nvim] | ||
''; | ||
mappings = { | ||
toggle = mkMappingOption "Activate LSP on Cursor Position [otter-nvim]" "<leader>lo"; | ||
}; | ||
setupOpts = mkPluginSetupOption "otter.nvim" { | ||
lsp = { | ||
diagnostic_update_event = mkOption { | ||
type = listOf str; | ||
default = ["BufWritePost"]; | ||
description = '' | ||
`:h events` that cause the diagnostic to update. | ||
Set to: {"BufWritePost", "InsertLeave", "TextChanged" } | ||
for less performant but more instant diagnostic updates | ||
''; | ||
}; | ||
}; | ||
buffers = { | ||
set_filetype = mkOption { | ||
type = bool; | ||
default = false; | ||
description = '' | ||
if set to true, the filetype of the otterbuffers will be set. Other wide only | ||
the autocommand of lspconfig that attaches the language server will be | ||
executed without stting the filetype | ||
''; | ||
}; | ||
write_to_disk = mkOption { | ||
type = bool; | ||
default = false; | ||
description = '' | ||
write <path>.otter.<embedded language extension> files to disk on save of main buffer. | ||
Useful for some linters that require actual files. | ||
Otter files are deleted on quit or main buffer close | ||
''; | ||
}; | ||
}; | ||
strip_wrapping_quote_characters = mkOption { | ||
type = listOf str; | ||
default = ["'" ''"'' "`"]; | ||
description = '' | ||
''; | ||
}; | ||
handle_leading_whitespace = mkOption { | ||
type = bool; | ||
default = false; | ||
description = '' | ||
otter may not work the way you expect when entire code blocks are indented | ||
(eg. in Org files) When true, otter handles these cases fully. | ||
''; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |