-
Notifications
You must be signed in to change notification settings - Fork 66
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
DefaultConfigurationProvider.getConfiguration
stalls in tests
#1397
Comments
This is working as expected, see here for the intended solution:
We cannot really identify in the |
Makes sense, thanks. I'm going to add the initialization of the configuration provider to our Would it make sense to alter the Yeoman template to include such a parameter? Something like export function create<%= LanguageName %>Services(context: DefaultSharedModuleContext, options?: ModuleOptions): {
shared: LangiumSharedServices,
<%= LanguageName %>: <%= LanguageName %>Services
} {
const shared = inject(
createDefaultSharedModule(context),
<%= LanguageName %>GeneratedSharedModule
);
const <%= LanguageName %> = inject(
createDefaultModule({ shared }),
<%= LanguageName %>GeneratedModule,
<%= LanguageName %>Module
);
shared.ServiceRegistry.register(<%= LanguageName %>);
registerValidationChecks(<%= LanguageName %>);
if (options?.initializeWithEmptyConfiguration) {
shared.workspace.ConfigurationProvider.initialized({});
}
return { shared, <%= LanguageName %> };
}
interface ModuleOptions {
initializeWithEmptyConfiguration?: boolean
} Or is this something that should be handled purely by adopters? |
We should be able to do something similar to this, yes: if (!context.connection) {
// We don't run inside of a language server
// Therefore, initialize the configuration provider instantly
shared.workspace.ConfigurationProvider.initialized({});
} @lars-reimann Do you want to contribute this? |
Sure, I'll get to it right away. |
After upgrading from langium 3.0.0-next.e78aeba to langium 3.0.0, many of the tests in Safe-DS time out. In particular, it's all tests that validate documents. This happens because some of our validation rules can be turned off using VS Code settings, so they contain code like
The
settingsProvider
is just a thin wrapper around theDefaultConfigurationProvider
and calls itsgetConfiguration
method.➡️ #1388 is likely related to this.
Langium version: 3.0.0
Package name: langium
Steps To Reproduce
Substitute
SafeDs
with some other language in the following code and run the tests withvitest
:Output:
Link to code example:
The current behavior
Tests time out because the service never readies up.
The expected behavior
Tests should pass.
The text was updated successfully, but these errors were encountered: