File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ class NixpkgsHoverProvider {
5656 // /
5757 // / FIXME: there are many markdown generation in language server.
5858 // / Maybe we can add structured generating first?
59- static std::string mkMarkdown (const PackageDescription &Package) {
59+ static std::string mkPackageMarkdown (const PackageDescription &Package) {
6060 std::ostringstream OS;
6161 // Make each field a new section
6262
@@ -87,6 +87,10 @@ class NixpkgsHoverProvider {
8787 return OS.str ();
8888 }
8989
90+ static std::string mkValueMarkdown (const ValueDescription &ValueDesc) {
91+ return ValueDesc.Doc ;
92+ }
93+
9094public:
9195 NixpkgsHoverProvider (AttrSetClient &NixpkgsClient)
9296 : NixpkgsClient(NixpkgsClient) {}
@@ -107,7 +111,11 @@ class NixpkgsHoverProvider {
107111 if (!Desc)
108112 return std::nullopt ;
109113
110- return mkMarkdown (Desc->PackageDesc );
114+ if (const auto ValueDesc = Desc->ValueDesc ) {
115+ return ValueDesc->Doc ;
116+ }
117+
118+ return mkPackageMarkdown (Desc->PackageDesc );
111119 }
112120};
113121
You can’t perform that action at this time.
0 commit comments