Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular dependency with ISelectionListener and IEditModeListener #1225

Closed
martin-fleck-at opened this issue Jan 31, 2024 · 0 comments · Fixed by eclipse-glsp/glsp-client#330
Assignees
Labels
bug Something isn't working

Comments

@martin-fleck-at
Copy link
Contributor

When binding some classes that also use the action dispatcher via the module, e.g., bindAsService({ bind }, TYPES.ISelectionListener, MyClass), I get the following error:

Error: It looks like there is a circular dependency in one of the 'toDynamicValue' bindings. Please investigate bindings with service identifier 'Symbol(ISelectionListener)'.

Interestingly, I didn't bind the listener using toDynamicValue. The same seems to happen when binding for TYPES.IEditModeListener with a class that uses the action dispatcher. At least that is my assumption that the cause is the action dispatcher, might be something else.

@martin-fleck-at martin-fleck-at added the bug Something isn't working label Jan 31, 2024
tortmayr added a commit to eclipse-glsp/glsp-client that referenced this issue Mar 22, 2024
- Introduce `IServiceProvider` and `IContributionProvider` that allow deferred retrival of services
 or contributions (i.e. multi-bound services) form the container
- Migrate `IGModelListener` API from commandstack to the `EditorContextService`. This serves two purposes: 
  - The `EditorContextService` becomes the central component for managing model related context information
  -  The `Commandstack` is removed from the dependency chain for editor context listeners. This should  
     avoid circular dependency issues related to injecting the action provider. 

Note that base sprotty still uses multi inject for some services (ViewRegistration, ModelElementRegistrations, IVnode post processors etc.)
Currently, these bindings don't seem to cause any dependency issues. If we encounter additional issues in the future we might consider fully replacing all sprotty multiinjections with contribution providers

Also
- Add `inversify` peerDependency to client and glsp-sprotty package. Adding this dependency explicitly allows the TS-LSP to properly resolve inversify for auto-importing and quick fixing of imports.
- Add option for advanced inversify logs to standalone example. If the example is opened with
`?inversifyLog=true` extensive infos about the inversify resolution tree will be logged
- Fix visibilty of projection bars on hidden div

Fixes eclipse-glsp/glsp#1225
tortmayr added a commit to eclipse-glsp/glsp-client that referenced this issue Mar 22, 2024
- Introduce `IServiceProvider` and `IContributionProvider` that allow deferred retrival of services
 or contributions (i.e. multi-bound services) form the container
- Migrate `IGModelListener` API from commandstack to the `EditorContextService`. This serves two purposes: 
  - The `EditorContextService` becomes the central component for managing model related context information
  -  The `Commandstack` is removed from the dependency chain for editor context listeners. This should  
     avoid circular dependency issues related to injecting the action provider. 

Note that base sprotty still uses multi inject for some services (ViewRegistration, ModelElementRegistrations, IVnode post processors etc.)
Currently, these bindings don't seem to cause any dependency issues. If we encounter additional issues in the future we might consider fully replacing all sprotty multiinjections with contribution providers

Also
- Add `inversify` peerDependency to client and glsp-sprotty package. Adding this dependency explicitly allows the TS-LSP to properly resolve inversify for auto-importing and quick fixing of imports.
- Add option for advanced inversify logs to standalone example. If the example is opened with
`?inversifyLog=true` extensive infos about the inversify resolution tree will be logged
- Fix visibilty of projection bars on hidden div

Fixes eclipse-glsp/glsp#1225
tortmayr added a commit to eclipse-glsp/glsp-client that referenced this issue Mar 22, 2024
- Introduce `IServiceProvider` and `IContributionProvider` that allow deferred retrival of services
 or contributions (i.e. multi-bound services) form the container
- Migrate `IGModelListener` API from commandstack to the `EditorContextService`. This serves two purposes: 
  - The `EditorContextService` becomes the central component for managing model related context information
  -  The `Commandstack` is removed from the dependency chain for editor context listeners. This should  
     avoid circular dependency issues related to injecting the action provider. 

Note that base sprotty still uses multi inject for some services (ViewRegistration, ModelElementRegistrations, IVnode post processors etc.)
Currently, these bindings don't seem to cause any dependency issues. If we encounter additional issues in the future we might consider fully replacing all sprotty multiinjections with contribution providers

Also
- Add `inversify` peerDependency to client and glsp-sprotty package. Adding this dependency explicitly allows the TS-LSP to properly resolve inversify for auto-importing and quick fixing of imports.
- Add option for advanced inversify logs to standalone example. If the example is opened with
`?inversifyLog=true` extensive infos about the inversify resolution tree will be logged
- Fix visibilty of projection bars on hidden div

Fixes eclipse-glsp/glsp#1225
tortmayr added a commit to eclipse-glsp/glsp-client that referenced this issue Mar 24, 2024
- Introduce `IServiceProvider` and `IContributionProvider` that allow deferred retrival of services
 or contributions (i.e. multi-bound services) form the container
- Migrate `IGModelListener` API from commandstack to the `EditorContextService`. This serves two purposes: 
  - The `EditorContextService` becomes the central component for managing model related context information
  -  The `Commandstack` is removed from the dependency chain for editor context listeners. This should  
     avoid circular dependency issues related to injecting the action provider. 

Note that base sprotty still uses multi inject for some services (ViewRegistration, ModelElementRegistrations, IVnode post processors etc.)
Currently, these bindings don't seem to cause any dependency issues. If we encounter additional issues in the future we might consider fully replacing all sprotty multiinjections with contribution providers

Also
- Add `inversify` peerDependency to client and glsp-sprotty package. Adding this dependency explicitly allows the TS-LSP to properly resolve inversify for auto-importing and quick fixing of imports.
- Add option for advanced inversify logs to standalone example. If the example is opened with
`?inversifyLog=true` extensive infos about the inversify resolution tree will be logged
- Fix visibilty of projection bars on hidden div

Fixes eclipse-glsp/glsp#1225
@tortmayr tortmayr assigned tortmayr and unassigned martin-fleck-at Mar 26, 2024
tortmayr added a commit to eclipse-glsp/glsp-client that referenced this issue Apr 10, 2024
- Introduce `LazyInjector` that allow deferred retrial of services
 from the container
- Introduce a new `preDiagramLoad` hook for `IDiagramStartup` this hook is calle directly after
 `DiagramLoader.load` is invoked.  This is the central entry point to initialize/activate lazily injected services
- Migrate retrieval of multiInjected services to use the `LazyInjector` instead
   - Defer registration/initialization of multiInjected services from ´postConstruct` to `preDiagramLoad` (where possible)
- Migrate `IGModelListener` API from commandstack to the `EditorContextService`. This serves two purposes: 
  - The `EditorContextService` becomes the central component for managing model related context information
  -  The `Commandstack` is removed from the dependency chain for editor context listeners. This should  
     avoid circular dependency issues related to injecting the action provider. 
- Restructure `di-util` of protocol package into `di` sub directory and add tests

Note that base sprotty still uses multi inject for some services (ViewRegistration, ModelElementRegistrations, IVnode post processors etc.)
Currently, these bindings don't seem to cause any dependency issues. If we encounter additional issues in the future we might consider fully replacing all sprotty multiinjections with contribution providers

Also
- Add `inversify` peerDependency to client and glsp-sprotty package. Adding this dependency explicitly allows the TS-LSP to properly resolve inversify for auto-importing and quick fixing of imports.
- Add option for advanced inversify logs to standalone example. If the example is opened with
`?inversifyLog=true` extensive infos about the inversify resolution tree will be logged
- Fix visibility of projection bars on hidden div
- Fix test launch configs

Fixes eclipse-glsp/glsp#1225
tortmayr added a commit to eclipse-glsp/glsp-client that referenced this issue Apr 15, 2024
- Introduce `LazyInjector` that allow deferred retrial of services
 from the container
- Introduce a new `preDiagramLoad` hook for `IDiagramStartup` this hook is calle directly after
 `DiagramLoader.load` is invoked.  This is the central entry point to initialize/activate lazily injected services
- Migrate retrieval of multiInjected services to use the `LazyInjector` instead
   - Defer registration/initialization of multiInjected services from ´postConstruct` to `preDiagramLoad` (where possible)
- Migrate `IGModelListener` API from commandstack to the `EditorContextService`. This serves two purposes: 
  - The `EditorContextService` becomes the central component for managing model related context information
  -  The `Commandstack` is removed from the dependency chain for editor context listeners. This should  
     avoid circular dependency issues related to injecting the action provider. 
- Restructure `di-util` of protocol package into `di` sub directory and add tests

Note that base sprotty still uses multi inject for some services (ViewRegistration, ModelElementRegistrations, IVnode post processors etc.)
Currently, these bindings don't seem to cause any dependency issues. If we encounter additional issues in the future we might consider fully replacing all sprotty multiinjections with contribution providers

Also
- Add `inversify` peerDependency to client and glsp-sprotty package. Adding this dependency explicitly allows the TS-LSP to properly resolve inversify for auto-importing and quick fixing of imports.
- Add option for advanced inversify logs to standalone example. If the example is opened with
`?inversifyLog=true` extensive infos about the inversify resolution tree will be logged
- Fix visibility of projection bars on hidden div
- Fix test launch configs

Fixes eclipse-glsp/glsp#1225
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants