Skip to content

Commit

Permalink
shuffle some services around a bit, attempt to resolve domainmodel issue
Browse files Browse the repository at this point in the history
  • Loading branch information
montymxb committed Nov 24, 2023
1 parent 5950b8e commit 8609bcd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
* terms of the MIT License, which is available in the project root.
******************************************************************************/

import type { LangiumCoreServices, Module, PartialLangiumCoreServices, DefaultSharedModuleContext } from 'langium';
import { inject, createDefaultSharedModule, createDefaultModule } from 'langium';
import type { Module, PartialLangiumCoreServices, DefaultSharedModuleContext } from 'langium';
import { inject, createDefaultModule, createDefaultSharedModule } from 'langium';
import { DomainModelGeneratedModule, DomainModelGeneratedSharedModule } from './generated/module.js';
import { DomainModelValidator, registerValidationChecks } from './domain-model-validator.js';
import { DomainModelScopeComputation } from './domain-model-scope.js';
import { QualifiedNameProvider } from './domain-model-naming.js';
import { DomainModelFormatter } from './domain-model-formatter.js';
import { DomainModelRenameProvider } from './domain-model-rename-refactoring.js';
import { createSharedLSPModule, createLSPModule, type LangiumLSPServices, type PartialLangiumLSPServices, type LangiumSharedServices } from 'langium/lsp';
import type { PartialLangiumLSPServices, LangiumSharedServices, LangiumServices } from 'langium/lsp';
import { createSharedLSPModule, createLSPModule } from 'langium/lsp';

export type DomainModelAddedServices = {
references: {
Expand All @@ -23,7 +24,7 @@ export type DomainModelAddedServices = {
}
}

export type DomainModelServices = LangiumCoreServices & DomainModelAddedServices & LangiumLSPServices;
export type DomainModelServices = LangiumServices & DomainModelAddedServices;

export const DomainModelModule: Module<DomainModelServices, PartialLangiumCoreServices & PartialLangiumLSPServices & DomainModelAddedServices> = {
references: {
Expand Down
2 changes: 1 addition & 1 deletion examples/domainmodel/test/domainmodel-cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Test the domainmodel CLI', () => {
}

test('Test action without CLI', async () => {
await generateAction(rawfileName, { destination, quiet: true });
await generateAction(rawfileName, { destination, quiet: false });
commonExpectations();
});

Expand Down
3 changes: 2 additions & 1 deletion packages/langium-sprotty/src/diagram-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
* terms of the MIT License, which is available in the project root.
******************************************************************************/

import type { AstNode, LangiumDocument, LangiumDocuments, LangiumServices } from 'langium';
import type { AstNode, LangiumDocument, LangiumDocuments } from 'langium';
import { URI } from 'langium';
import type { LangiumServices } from 'langium/lsp';
import type { GeneratorArguments, IDiagramGenerator, SModelRoot } from 'sprotty-protocol';
import { CancellationToken } from 'vscode-languageserver';

Expand Down
4 changes: 2 additions & 2 deletions packages/langium-sprotty/src/diagram-server-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import type { CancellationToken, Connection } from 'vscode-languageserver';
import type { ActionMessage, DiagramOptions, DiagramServer, RequestModelAction } from 'sprotty-protocol';
import type { LangiumDocument, ServiceRegistry, URI } from 'langium';
import type { LangiumDocument, CoreServiceRegistryI, URI } from 'langium';
import type { LangiumSprottyServices, LangiumSprottySharedServices } from './sprotty-services.js';
import type { LangiumDiagramGeneratorArguments } from './diagram-generator.js';
import { isRequestAction, RejectAction } from 'sprotty-protocol';
Expand Down Expand Up @@ -34,7 +34,7 @@ export interface DiagramServerManager {
export class DefaultDiagramServerManager implements DiagramServerManager {

protected readonly connection?: Connection;
protected readonly serviceRegistry: ServiceRegistry;
protected readonly serviceRegistry: CoreServiceRegistryI;
protected readonly diagramServerFactory: (clientId: string, options?: DiagramOptions) => DiagramServer;
protected readonly diagramServerMap: Map<string, DiagramServer> = new Map();

Expand Down
8 changes: 4 additions & 4 deletions packages/langium-sprotty/src/sprotty-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* terms of the MIT License, which is available in the project root.
******************************************************************************/

import type { LangiumServices } from 'langium';
import type { LangiumSharedServicesWithLSP } from 'langium/lsp';
import type { LangiumCoreServices } from 'langium';
import type { LangiumSharedServices } from 'langium/lsp';
import type { DiagramOptions, DiagramServer, DiagramServices } from 'sprotty-protocol';
import type { DiagramServerManager } from './diagram-server-manager.js';

Expand All @@ -19,7 +19,7 @@ export type SprottyDiagramServices = {
/**
* Extension of the `LangiumServices` with the diagram-related services.
*/
export type LangiumSprottyServices = LangiumServices & SprottyDiagramServices
export type LangiumSprottyServices = LangiumCoreServices & SprottyDiagramServices

/**
* Services provided by the `SprottySharedModule` for the integration of Langium and Sprotty.
Expand All @@ -34,4 +34,4 @@ export type SprottySharedServices = {
/**
* Extension of the `LangiumSharedServices` with the diagram-related shared services.
*/
export type LangiumSprottySharedServices = LangiumSharedServicesWithLSP & SprottySharedServices
export type LangiumSprottySharedServices = LangiumSharedServices & SprottySharedServices

0 comments on commit 8609bcd

Please sign in to comment.