|
|
Re: Library in VS Code extension [message #1859811 is a reply to message #1859799] |
Wed, 28 June 2023 14:39 |
Cyril Vrousos Messages: 5 Registered: June 2023 |
Junior Member |
|
|
Hi,
I followed what you suggested here about the ProjectManager: https://github.com/eclipse/xtext/issues/2566
public class CustomProjectManager extends ProjectManager {
IProjectConfig projectConfig;
@Override
public void initialize(ProjectDescription description, IProjectConfig projectConfig,
Procedure2<? super URI, ? super Iterable<Issue>> acceptor,
IExternalContentProvider openedDocumentsContentProvider,
Provider<Map<String, ResourceDescriptionsData>> indexProvider, CancelIndicator cancelIndicator) {
super.initialize(description, projectConfig, acceptor, openedDocumentsContentProvider, indexProvider, cancelIndicator);
this.projectConfig = projectConfig;
}
@Override
public Result doInitialBuild(CancelIndicator cancelIndicator) {
List<URI> allUris = new ArrayList<>();
for (ISourceFolder srcFolder : super.getProjectConfig().getSourceFolders()) {
allUris.addAll(srcFolder.getAllResources(fileSystemScanner));
}
var url = getClass().getResource("/org/eclipse/mydsl/lib/catalogue.mydsl");
allUris.add(URI.createURI(url.toString()));
return super.doBuild(allUris, Collections.emptyList(), Collections.emptyList(), cancelIndicator);
}
}
I also created a CustomServerModule and a CustomServerLauncher, but it doesn't work.
I tested the access to the resource was valid and I verified that the creation of the URI is done (in a junit test).
Any idea what I might have forgotten?
Thank you.
[Updated on: Wed, 28 June 2023 14:45] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.05821 seconds