vscode: Duplicated decoration ids
related to https://github.com/microsoft/vscode/issues/117769
We have places that create a service decorator, via createDecorator, for an identifier that has been used already. The problem with that is the the id is the actual identifier, not the object instance. This enables potential for service conflicts, esp. when different interfaces use the same name. Conflict I have found
-
themeServicedefined here and here, different interface is used -
configurationServicedefined here and here -
layoutServicedefined here and here -
nativeEnvironmentServicedefined here, here, and here -
environmentServicedefined here and here -
extensionManagementServicedefined here and here
@bpasero start with you because it seems to be a pattern that you have been using, e.g have XYZService which is redefined as IWorkbenchXYZService. This needs explanation but seems fishy, e.g the first service interface should already be exhaustive and not rely on an extension that comes from the side
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (15 by maintainers)
Commits related to this issue
- services - distinguish layout services (#117881) — committed to microsoft/vscode by bpasero 3 years ago
- services - distinguish environment services (#117881) — committed to microsoft/vscode by bpasero 3 years ago
- add refineServiceDecorator, https://github.com/microsoft/vscode/issues/117881 — committed to microsoft/vscode by jrieken 3 years ago
- fix IThemeService decoration ids. For #117881 — committed to microsoft/vscode by aeschli 3 years ago
- services - use refineServiceDecorator for layout service (#117881) — committed to microsoft/vscode by bpasero 3 years ago
- services - use refineServiceDecorator for environment (#117881) — committed to microsoft/vscode by bpasero 3 years ago
- Squashed 'lib/vscode/' changes from fd6f3bce670..ead2c2ab0f5 ead2c2ab0f5 Merge pull request #120858 from microsoft/alex/1-55-2 bfb2654224e Pick up new distro version and bump version 08a217c4d27 Merg... — committed to coder/code-server by deleted user 3 years ago
Yeah, I think it make sense. Latest is when you start using registerSingleton
Yes,
refineServiceIdentifiermakes sense, it’s like the createDecorator variant that I suggested