-
-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugins/cmp-tabnine: move to by-name
- Loading branch information
1 parent
79a637d
commit 7aed1c4
Showing
4 changed files
with
116 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ lib, ... }: | ||
let | ||
inherit (lib) types; | ||
inherit (lib.nixvim) defaultNullOpts; | ||
in | ||
lib.nixvim.neovim-plugin.mkNeovimPlugin { | ||
name = "cmp-tabnine"; | ||
|
||
maintainers = [ lib.maintainers.GaetanLepage ]; | ||
|
||
imports = [ | ||
{ cmpSourcePlugins.cmp_tabnine = "cmp-tabnine"; } | ||
]; | ||
|
||
deprecateExtraOptions = true; | ||
|
||
moduleName = "cmp_tabnine.config"; | ||
setup = ":setup"; | ||
|
||
settingsOptions = { | ||
max_lines = defaultNullOpts.mkUnsignedInt 1000 '' | ||
How many lines of buffer context to pass to TabNine. | ||
''; | ||
|
||
max_num_results = defaultNullOpts.mkUnsignedInt 20 '' | ||
How many results to return. | ||
''; | ||
|
||
sort = defaultNullOpts.mkBool true '' | ||
Sort results by returned priority. | ||
''; | ||
|
||
run_on_every_keystroke = defaultNullOpts.mkBool true '' | ||
Generate new completion items on every keystroke. | ||
For more info, check out [#18](https://github.com/tzachar/cmp-tabnine/issues/18). | ||
''; | ||
|
||
snippet_placeholder = defaultNullOpts.mkStr ".." '' | ||
Indicates where the cursor will be placed in case a completion item is asnippet. | ||
Any string is accepted. | ||
For this to work properly, you need to setup snippet support for `nvim-cmp`. | ||
''; | ||
|
||
ignored_file_types = defaultNullOpts.mkAttrsOf' { | ||
type = types.bool; | ||
pluginDefault = { }; | ||
example = { | ||
lua = true; | ||
}; | ||
description = '' | ||
Which file types to ignore. | ||
''; | ||
}; | ||
|
||
min_percent = defaultNullOpts.mkNullable (types.numbers.between 0 100) 0 '' | ||
Eliminate items with a percentage less than `min_percent`. | ||
''; | ||
}; | ||
|
||
settingsExample = { | ||
max_lines = 600; | ||
max_num_results = 10; | ||
sort = false; | ||
}; | ||
} |
This file was deleted.
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
49 changes: 49 additions & 0 deletions
49
tests/test-sources/plugins/by-name/cmp-tabnine/default.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,49 @@ | ||
{ lib, pkgs, ... }: | ||
let | ||
platform = pkgs.stdenv.hostPlatform; | ||
|
||
# tabnine is not available on aarch64-linux. | ||
doRun = !(platform.isLinux && platform.isAarch64); | ||
in | ||
lib.optionalAttrs doRun { | ||
empty = { | ||
plugins = { | ||
cmp.enable = true; | ||
cmp-tabnine.enable = true; | ||
}; | ||
}; | ||
|
||
defaults = { | ||
plugins = { | ||
cmp.enable = true; | ||
cmp-tabnine = { | ||
enable = true; | ||
|
||
settings = { | ||
max_lines = 1000; | ||
max_num_results = 20; | ||
sort = true; | ||
run_on_every_keystroke = true; | ||
snippet_placeholder = ".."; | ||
ignored_file_types = { }; | ||
min_percent = 0; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
example = { | ||
plugins = { | ||
cmp.enable = true; | ||
cmp-tabnine = { | ||
enable = true; | ||
|
||
settings = { | ||
max_lines = 600; | ||
max_num_results = 10; | ||
sort = false; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |