Remove unused code and address feedback

This commit is contained in:
Jacob Wallraff
2023-03-06 11:33:28 -08:00
parent bde26c84ea
commit 6aaeefb9c2
7 changed files with 6 additions and 9 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ export async function complete(
return [];
}
const template = await fetchOrConvertWorkflowTemplate(file, parsedWorkflow, textDocument.uri, config, {
const template = await fetchOrConvertWorkflowTemplate(parsedWorkflow, textDocument.uri, config, {
fetchReusableWorkflowDepth: config?.fileProvider ? 1 : 0,
errorPolicy: ErrorPolicy.TryConversion
});
+1 -1
View File
@@ -18,7 +18,7 @@ export async function documentLinks(document: TextDocument): Promise<DocumentLin
return [];
}
const template = await fetchOrConvertWorkflowTemplate(file, parsedWorkflow, document.uri, undefined, {
const template = await fetchOrConvertWorkflowTemplate(parsedWorkflow, document.uri, undefined, {
errorPolicy: ErrorPolicy.TryConversion
});
+1 -1
View File
@@ -48,7 +48,7 @@ export async function hover(document: TextDocument, position: Position, config?:
return null;
}
const template = await fetchOrConvertWorkflowTemplate(file, parsedWorkflow, document.uri, config, {
const template = await fetchOrConvertWorkflowTemplate(parsedWorkflow, document.uri, config, {
errorPolicy: ErrorPolicy.TryConversion,
fetchReusableWorkflowDepth: config?.fileProvider ? 1 : 0
});
+1 -2
View File
@@ -27,7 +27,7 @@ export function clearWorkflowTemplateCache() {
export function fetchOrParseWorkflow(file: File, uri: string): ParseWorkflowResult | undefined {
let result = parsedWorkflowCache.get(uri);
if (!result || !result.value) {
if (!result?.value) {
result = parseWorkflow(file, nullTrace);
if (!result.value) {
return undefined;
@@ -38,7 +38,6 @@ export function fetchOrParseWorkflow(file: File, uri: string): ParseWorkflowResu
}
export async function fetchOrConvertWorkflowTemplate(
file: File,
parsedWorkflow: ParseWorkflowResult,
uri: string,
config?: CompletionConfig,
+1 -1
View File
@@ -53,7 +53,7 @@ export async function validate(textDocument: TextDocument, config?: ValidationCo
if (parsedWorkflow.value) {
// Errors will be updated in the context. Attempt to do the conversion anyway in order to give the user more information
const template = await fetchOrConvertWorkflowTemplate(file, parsedWorkflow, textDocument.uri, config, {
const template = await fetchOrConvertWorkflowTemplate(parsedWorkflow, textDocument.uri, config, {
fetchReusableWorkflowDepth: config?.fileProvider ? 1 : 0,
errorPolicy: ErrorPolicy.TryConversion
});