Ensure inherited context is shown on hover

This commit is contained in:
Josh Gross
2023-01-23 16:20:59 -05:00
parent 48c728771e
commit d8d4a3f46a
2 changed files with 28 additions and 5 deletions
+3 -4
View File
@@ -35,11 +35,10 @@ export async function hover(document: TextDocument, position: Position, config?:
let description = await getDescription(document, config, result, token, path);
if (token.definition.evaluatorContext.length > 0) {
const allowedContext = token.definitionInfo?.allowedContext;
if (allowedContext && allowedContext?.length > 0) {
// Only add padding if there is a description
description += `${description.length > 0 ? `\n\n` : ""}**Context:** ${token.definition.evaluatorContext.join(
", "
)}`;
description += `${description.length > 0 ? `\n\n` : ""}**Context:** ${allowedContext.join(", ")}`;
}
return {