mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugins/lsp: set a defaultText
for cmd
This commit is contained in:
parent
88652ce69a
commit
796ace65f7
1 changed files with 21 additions and 1 deletions
|
@ -10,7 +10,8 @@
|
||||||
serverName ? name,
|
serverName ? name,
|
||||||
package ? null,
|
package ? null,
|
||||||
url ? null,
|
url ? null,
|
||||||
cmd ? (cfg: null),
|
cmd ? null,
|
||||||
|
cmdText ? throw "cmdText is required when cmd is a function",
|
||||||
settings ? (cfg: cfg),
|
settings ? (cfg: cfg),
|
||||||
settingsOptions ? { },
|
settingsOptions ? { },
|
||||||
extraConfig ? cfg: { },
|
extraConfig ? cfg: { },
|
||||||
|
@ -78,6 +79,25 @@ in
|
||||||
cmd cfg
|
cmd cfg
|
||||||
else
|
else
|
||||||
cmd;
|
cmd;
|
||||||
|
defaultText = lib.literalMD ''
|
||||||
|
null when `package` is null, otherwise ${
|
||||||
|
if args ? cmdText || builtins.isFunction cmd then
|
||||||
|
let
|
||||||
|
literal = lib.options.renderOptionValue cmdText;
|
||||||
|
inherit (literal) text;
|
||||||
|
in
|
||||||
|
if literal._type == "literalMD" then
|
||||||
|
text
|
||||||
|
else if lib.hasInfix "\n" text || lib.hasInfix "``" text then
|
||||||
|
"\n\n```\n${text}\n```"
|
||||||
|
else
|
||||||
|
"`` ${text} ``"
|
||||||
|
else if cmd == null then
|
||||||
|
"null"
|
||||||
|
else
|
||||||
|
"`[ ${lib.concatMapStringsSep " " builtins.toJSON cmd} ]`"
|
||||||
|
}
|
||||||
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
A list where each entry corresponds to the blankspace delimited part of the command that
|
A list where each entry corresponds to the blankspace delimited part of the command that
|
||||||
launches the server.
|
launches the server.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue