Skip to content

Commit

Permalink
Add getMatchingSchemas to WorkflowTestsSchemaService
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Feb 19, 2024
1 parent 9c762b2 commit f09c702
Showing 1 changed file with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import { WorkflowTestsSchemaProvider } from "./provider";
export interface WorkflowTestsSchemaService {
schema: ResolvedSchema;
validate(documentContext: DocumentContext, severity?: DiagnosticSeverity): Diagnostic[] | undefined;
getMatchingSchemas(documentContext: DocumentContext, nodeOffset?: number | undefined): IApplicableSchema[];
getMatchingSchemas(
documentContext: DocumentContext,
nodeOffset?: number | undefined,
didCallFromAutoComplete?: boolean
): IApplicableSchema[];
}

@injectable()
Expand All @@ -28,8 +32,18 @@ export class WorkflowTestsSchemaServiceImpl implements WorkflowTestsSchemaServic
return this.jsonSchemaService.validate(documentContext, resolvedSchema.schema, severity);
}

getMatchingSchemas(documentContext: DocumentContext, nodeOffset?: number | undefined): IApplicableSchema[] {
getMatchingSchemas(
documentContext: DocumentContext,
nodeOffset?: number | undefined,
didCallFromAutoComplete?: boolean
): IApplicableSchema[] {
const resolvedSchema = this.schemaProvider.getResolvedSchema();
return this.jsonSchemaService.getMatchingSchemas(documentContext, resolvedSchema.schema, nodeOffset);
return this.jsonSchemaService.getMatchingSchemas(
documentContext,
resolvedSchema.schema,
nodeOffset,
null,
didCallFromAutoComplete
);
}
}

0 comments on commit f09c702

Please sign in to comment.