|
|
|
|
|
|
Re: Exclude generated JAR files from indexing [message #1774923 is a reply to message #1774886] |
Sat, 21 October 2017 07:42 |
|
sorry i still cant follow you.
what exactly do you want to prevent? the jar from being looked at, the jar from beeing on the classpath, the jar from beeing on the index?
why not implement
e.g.
class CustomResourceUIServiceProvider extends DefaultResourceUIServiceProvider {
@Inject
new(IResourceServiceProvider delegate) {
super(delegate)
}
override canHandle(URI uri, IStorage storage) {
println(uri)
if (uri.isArchive) {
return false
}
super.canHandle(uri, storage)
}
}
(you know you need to remove and readd the jar to get rid of them in the index?)
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
[Updated on: Sat, 21 October 2017 08:17] Report message to a moderator
|
|
|
|
Re: Exclude generated JAR files from indexing [message #1775127 is a reply to message #1775123] |
Wed, 25 October 2017 05:26 |
|
of course you can do that but it has implications since the mapper is used by all dsls in your target eclipse/rcp
thus i wonder if you can do the same by different means like eclipse resource filters https://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Fconcepts%2Fresourcefilters.htm
(you have to test that)
here is the hacky solution
<extension
point="org.eclipse.xtext.ui.shared.overridingGuiceModule">
<module
class="org.xtext.example.mydsl5.ui.MyDslOverridingModule">
</module>
</extension>
package org.xtext.example.mydsl5.ui;
import org.eclipse.xtext.ui.shared.contribution.ISharedStateContributionRegistry;
import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Scopes;
public class MyDslOverridingModule implements Module{
@Override
public void configure(Binder binder) {
binder.bind(ISharedStateContributionRegistry.class)
.to(MyDslSharedStateContributionRegistryImpl.class)
.in(Scopes.SINGLETON);
}
}
package org.xtext.example.mydsl5.ui;
import org.eclipse.xtext.ui.shared.internal.SharedContributionWithJDT;
import org.eclipse.xtext.ui.shared.internal.SharedStateContributionRegistryImpl;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Module;
import com.google.inject.util.Modules;
@SuppressWarnings("restriction")
public class MyDslSharedStateContributionRegistryImpl extends SharedStateContributionRegistryImpl {
@Inject
public MyDslSharedStateContributionRegistryImpl(Injector injector) {
super(injector);
}
@Override
protected Module getWrappedModule(Module childModule) {
if (childModule instanceof SharedContributionWithJDT) {
return super.getWrappedModule(
Modules.override(childModule).with(new CustomSharedContributionWithJDTModule()));
}
return super.getWrappedModule(childModule);
}
}
package org.xtext.example.mydsl5.ui;
import org.eclipse.xtext.ui.resource.IStorage2UriMapperContribution;
import org.eclipse.xtext.ui.resource.IStorage2UriMapperJdtExtensions;
import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Scopes;
public class CustomSharedContributionWithJDTModule implements Module {
@Override
public void configure(Binder binder) {
binder.install(new Module() {
@Override
public void configure(Binder binder) {
binder.bind(IStorage2UriMapperJdtExtensions.class).to(MyDslStorage2UriMapperJavaImpl.class);
binder.bind(IStorage2UriMapperContribution.class).to(MyDslStorage2UriMapperJavaImpl.class);
binder.bind(Storage2UriMapperJavaImpl.class).to(MyDslStorage2UriMapperJavaImpl.class); binder.bind(MyDslStorage2UriMapperJavaImpl.class).in(Scopes.SINGLETON);
}
});
}
}
package org.xtext.example.mydsl5.ui;
import org.eclipse.core.resources.IFolder;
import org.eclipse.xtext.ui.resource.Storage2UriMapperJavaImpl;
public class MyDslStorage2UriMapperJavaImpl extends Storage2UriMapperJavaImpl {
@Override
public boolean isRejected(IFolder folder) {
System.err.println("folder: " + folder);
return super.isRejected(folder);
}
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
[Updated on: Sat, 28 October 2017 01:24] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05332 seconds