Fix imports and format
This commit is contained in:
@@ -28,8 +28,12 @@ import {fetchActionMetadata} from "./utils/action-metadata";
|
||||
import {TTLCache} from "./utils/cache";
|
||||
import {timeOperation} from "./utils/timer";
|
||||
import {valueProviders} from "./value-providers";
|
||||
import {clearParsedCache, clearParsedCacheEntry} from "@github/actions-workflow-parser/workflows/workflow-parser";
|
||||
import {clearWorkflowTemplateCache, clearWorkflowTemplateCacheEntry} from "@github/actions-workflow-parser/model/convert";
|
||||
import {
|
||||
clearParsedCache,
|
||||
clearParsedCacheEntry,
|
||||
clearWorkflowTemplateCache,
|
||||
clearWorkflowTemplateCacheEntry
|
||||
} from "@github/actions-languageservice/utils/workflow-cache";
|
||||
|
||||
export function initConnection(connection: Connection) {
|
||||
const documents: TextDocuments<TextDocument> = new TextDocuments(TextDocument);
|
||||
@@ -100,7 +104,7 @@ export function initConnection(connection: Connection) {
|
||||
clearWorkflowTemplateCache();
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// The content of a text document has changed. This event is emitted
|
||||
// when the text document first opened or when its content has changed.
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import {complete as completeExpression, DescriptionDictionary} from "@github/actions-expressions";
|
||||
import {CompletionItem as ExpressionCompletionItem} from "@github/actions-expressions/completion";
|
||||
import {
|
||||
isBasicExpression,
|
||||
isSequence,
|
||||
isString
|
||||
} from "@github/actions-workflow-parser";
|
||||
import {isBasicExpression, isSequence, isString} from "@github/actions-workflow-parser";
|
||||
import {ErrorPolicy} from "@github/actions-workflow-parser/model/convert";
|
||||
import {OPEN_EXPRESSION} from "@github/actions-workflow-parser/templates/template-constants";
|
||||
import {TemplateToken} from "@github/actions-workflow-parser/templates/tokens/index";
|
||||
|
||||
@@ -4,7 +4,7 @@ import {File} from "@github/actions-workflow-parser/workflows/file";
|
||||
import {ParseWorkflowResult} from "@github/actions-workflow-parser";
|
||||
import {WorkflowTemplate} from "@github/actions-workflow-parser";
|
||||
import {nullTrace} from "../nulltrace";
|
||||
import { CompletionConfig } from "../complete";
|
||||
import {CompletionConfig} from "../complete";
|
||||
|
||||
const parsedWorkflowCache = new Map<string, ParseWorkflowResult>();
|
||||
const workflowTemplateCache = new Map<string, WorkflowTemplate>();
|
||||
@@ -37,11 +37,22 @@ export function fetchOrParseWorkflow(file: File, uri: string): ParseWorkflowResu
|
||||
return result;
|
||||
}
|
||||
|
||||
export async function fetchOrConvertWorkflowTemplate(file: File, parsedWorkflow: ParseWorkflowResult, uri: string, config?: CompletionConfig, options?: WorkflowTemplateConverterOptions): Promise<WorkflowTemplate> {
|
||||
export async function fetchOrConvertWorkflowTemplate(
|
||||
file: File,
|
||||
parsedWorkflow: ParseWorkflowResult,
|
||||
uri: string,
|
||||
config?: CompletionConfig,
|
||||
options?: WorkflowTemplateConverterOptions
|
||||
): Promise<WorkflowTemplate> {
|
||||
let template = workflowTemplateCache.get(uri);
|
||||
if (!template) {
|
||||
template = await convertWorkflowTemplate(file.name, parsedWorkflow.context, parsedWorkflow.value!, config?.fileProvider, options);
|
||||
template = await convertWorkflowTemplate(
|
||||
parsedWorkflow.context,
|
||||
parsedWorkflow.value!,
|
||||
config?.fileProvider,
|
||||
options
|
||||
);
|
||||
workflowTemplateCache.set(uri, template);
|
||||
}
|
||||
return template;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import {Evaluator, ExpressionEvaluationError, Lexer, Parser} from "@github/actions-expressions";
|
||||
import {Expr} from "@github/actions-expressions/ast";
|
||||
import {
|
||||
isBasicExpression,
|
||||
isString,
|
||||
WorkflowTemplate
|
||||
} from "@github/actions-workflow-parser";
|
||||
import {isBasicExpression, isString, WorkflowTemplate} from "@github/actions-workflow-parser";
|
||||
import {ErrorPolicy} from "@github/actions-workflow-parser/model/convert";
|
||||
import {splitAllowedContext} from "@github/actions-workflow-parser/templates/allowed-context";
|
||||
import {BasicExpressionToken} from "@github/actions-workflow-parser/templates/tokens/basic-expression-token";
|
||||
|
||||
@@ -31,7 +31,7 @@ export function parseWorkflow(entryFile: File, contextOrTrace: TraceWriter | Tem
|
||||
context,
|
||||
value: undefined
|
||||
};
|
||||
return result
|
||||
return result;
|
||||
}
|
||||
const templateToken = templateReader.readTemplate(context, WORKFLOW_ROOT, reader, fileId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user