Merge pull request #57 from github/joshmgross/use-def-allowed-context

Use the allowed context from the definition info
This commit is contained in:
Josh Gross
2022-12-15 10:31:34 -05:00
committed by GitHub
3 changed files with 2 additions and 21 deletions
+1 -2
View File
@@ -14,7 +14,6 @@ import {ContextProviderConfig} from "./context-providers/config";
import {getContext, Mode} from "./context-providers/default";
import {getWorkflowContext, WorkflowContext} from "./context/workflow-context";
import {nullTrace} from "./nulltrace";
import {getAllowedContext} from "./utils/allowed-context";
import {findToken} from "./utils/find-token";
import {mapRange} from "./utils/range";
import {transform} from "./utils/transform";
@@ -85,7 +84,7 @@ export async function complete(
const expressionInput = (getExpressionInput(currentInput, relCharPos) || "").trim();
const allowedContext = getAllowedContext(token, parent);
const allowedContext = token.definitionInfo?.allowedContext || [];
const context = await getContext(allowedContext, contextProviderConfig, workflowContext, Mode.Completion);
return completeExpression(expressionInput, context, []);