Skip to content

Commit

Permalink
Use constants for language IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Jan 26, 2024
1 parent 15c6e56 commit 3521fbc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion server/gx-workflow-ls-format2/src/languageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import { GxFormat2SchemaValidationService, WorkflowValidationService } from "./s
import { inject, injectable } from "inversify";
import { TYPES as YAML_TYPES } from "@gxwf/yaml-language-service/src/inversify.config";

const LANGUAGE_ID = "gxformat2";

export interface GxFormat2WorkflowLanguageService extends LanguageService<GxFormat2WorkflowDocument> {}

/**
Expand All @@ -38,7 +40,7 @@ export class GxFormat2WorkflowLanguageServiceImpl
private _validationServices: WorkflowValidator[];

constructor(@inject(YAML_TYPES.YAMLLanguageService) yamlLanguageService: YAMLLanguageService) {
super("gxformat2");
super(LANGUAGE_ID);
this._schemaLoader = new GalaxyWorkflowFormat2SchemaLoader();
this._yamlLanguageService = yamlLanguageService;
this._hoverService = new GxFormat2HoverService(this._schemaLoader.nodeResolver);
Expand Down
4 changes: 3 additions & 1 deletion server/gx-workflow-ls-native/src/languageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import NativeWorkflowSchema from "../../../workflow-languages/schemas/native.sch
import { NativeWorkflowDocument } from "./nativeWorkflowDocument";
import { injectable } from "inversify";

const LANGUAGE_ID = "galaxyworkflow";

export interface NativeWorkflowLanguageService extends LanguageService<NativeWorkflowDocument> {}

/**
Expand All @@ -38,7 +40,7 @@ export class NativeWorkflowLanguageServiceImpl
private _documentSettings: DocumentLanguageSettings = { schemaValidation: "error" };

constructor() {
super("galaxyworkflow");
super(LANGUAGE_ID);
const params: LanguageServiceParams = {};
const settings = this.getLanguageSettings();
this._jsonLanguageService = getLanguageService(params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@ import { WorkflowTestsHoverService } from "./services/hover";
import { TYPES } from "./types";
import { WorkflowTestsValidationService } from "./services/validation";

const LANGUAGE_ID = "gxwftests";

/**
* A custom implementation of the YAML Language Service to support language features
* for Galaxy workflow test files.
*/
@injectable()
export class GxWorkflowTestsLanguageServiceImpl extends LanguageServiceBase<WorkflowTestsDocument> {
constructor(
@inject(YAML_TYPES.YAMLLanguageService) protected yamlLanguageService: YAMLLanguageService,
@inject(TYPES.WorkflowTestsHoverService) protected hoverService: WorkflowTestsHoverService,
@inject(TYPES.WorkflowTestsValidationService) protected validationService: WorkflowTestsValidationService
) {
super("gxwftests");
super(LANGUAGE_ID);
}

public override parseDocument(document: TextDocument): GxWorkflowTestsDocument {
Expand Down

0 comments on commit 3521fbc

Please sign in to comment.