Use similar definition info to validation for hover
This commit is contained in:
@@ -43,17 +43,17 @@ export async function hover(document: TextDocument, position: Position, config?:
|
||||
}
|
||||
|
||||
const tokenResult = findToken(position, result.value);
|
||||
const token = tokenResult.token;
|
||||
const {token, keyToken, parent} = tokenResult;
|
||||
|
||||
if (config?.contextProviderConfig && token && tokenResult.keyToken?.definition) {
|
||||
const hoverToken = keyToken || parent || token;
|
||||
if (config?.contextProviderConfig && token && hoverToken?.definition) {
|
||||
const isStringExpressionToken = isStringExpression(token);
|
||||
const isBasicExpressionToken = isBasicExpression(token);
|
||||
|
||||
if (isStringExpressionToken || isBasicExpressionToken) {
|
||||
info(`Calculating expression hover for token with definition ${tokenResult.keyToken.definition.key}`);
|
||||
info(`Calculating expression hover for token with definition ${hoverToken.definition.key}`);
|
||||
|
||||
const allowedContext =
|
||||
token.definitionInfo?.allowedContext || tokenResult.keyToken?.definitionInfo?.allowedContext || [];
|
||||
const allowedContext = hoverToken.definitionInfo?.allowedContext || [];
|
||||
const {namedContexts, functions} = splitAllowedContext(allowedContext);
|
||||
|
||||
const template = convertWorkflowTemplate(result.context, result.value, ErrorPolicy.TryConversion);
|
||||
|
||||
Reference in New Issue
Block a user