Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Large Files and Excluding Directories
Large Files and Excluding Directories [message #918001] Thu, 20 September 2012 16:33 Go to next message
Andrew Gacek is currently offline Andrew GacekFriend
Messages: 32
Registered: October 2011
Member
I've created an Xtext project for a subset of the Lustre language (file extension .lus). I have a related project which is producing very large .lus files which I rarely need to open. My problem is that these really slow down Eclipse as it recognizes when these files are created and tries to parse them. Is there a way to exclude certain directories from automatically being parsed?

Ideally, I'd also like a way to still open the Lustre editor on these files if there is a particular one I'm interested in.

Thanks,
Andrew
Re: Large Files and Excluding Directories [message #918044 is a reply to message #918001] Thu, 20 September 2012 17:33 Go to previous messageGo to next message
Andrew Gacek is currently offline Andrew GacekFriend
Messages: 32
Registered: October 2011
Member
I've been able to mostly solve the issue by overriding IResourceServiceProvider.canHandle() as shown at the end of this post. With this in place, the files underneath ignored-directory-name are not automatically parsed by Eclipse. I can still open those files and they will be syntax highlighted, but they will not be validated unless I right-click and select 'validate' or if I make an edit to the file. I don't know how to clear the validation results after I close the file. That is, I don't know to make Eclipse go back to ignoring that file. Even still, this solution is very close to what I want. Any comments or suggestions?

Thanks,
Andrew



public class LustreUiModule extends AbstractLustreUiModule {
	...

	public Class<? extends IResourceServiceProvider> bindIResourceServiceProvider() {
		return LustreResourceServiceProvider.class;
	}
}



public class LustreResourceServiceProvider extends DefaultResourceServiceProvider {
	@Override
	public boolean canHandle(URI uri) {
		for (String segment : uri.segmentsList()) {
			if (segment.equals("ignored-directory-name")) {
				return false;
			}
		}
		return super.canHandle(uri);
	}
}
Re: Large Files and Excluding Directories [message #918251 is a reply to message #918044] Thu, 20 September 2012 22:05 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
One idea would be to have another builder that deals with the large
resources. It would check if the resource is open in an editor and if
not, simply clear all of the markers for it.

or somesuch...

Regards
- henrik

On 2012-20-09 19:33, Andrew Gacek wrote:
> I've been able to mostly solve the issue by overriding
> IResourceServiceProvider.canHandle() as shown at the end of this post.
> With this in place, the files underneath ignored-directory-name are not
> automatically parsed by Eclipse. I can still open those files and they
> will be syntax highlighted, but they will not be validated unless I
> right-click and select 'validate' or if I make an edit to the file. I
> don't know how to clear the validation results after I close the file.
> That is, I don't know to make Eclipse go back to ignoring that file.
> Even still, this solution is very close to what I want. Any comments or
> suggestions?
>
> Thanks,
> Andrew
>
>
>
>
> public class LustreUiModule extends AbstractLustreUiModule {
> ...
>
> public Class<? extends IResourceServiceProvider>
> bindIResourceServiceProvider() {
> return LustreResourceServiceProvider.class;
> }
> }
>
>
>
>
> public class LustreResourceServiceProvider extends
> DefaultResourceServiceProvider {
> @Override
> public boolean canHandle(URI uri) {
> for (String segment : uri.segmentsList()) {
> if (segment.equals("ignored-directory-name")) {
> return false;
> }
> }
> return super.canHandle(uri);
> }
> }
>
Re: Large Files and Excluding Directories [message #918694 is a reply to message #918251] Fri, 21 September 2012 08:59 Go to previous messageGo to next message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
You can select validation results in the Problems View and then delete them (press the Delete key or use the context menu). Eclipse will then forget about them until some builder or validator adds them again.
Re: Large Files and Excluding Directories [message #918695 is a reply to message #918251] Fri, 21 September 2012 08:59 Go to previous message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
You can select validation results in the Problems View and then delete them (press the Delete key or use the context menu). Eclipse will then forget about them until some builder or validator adds them again.
Previous Topic:Modify text in XtextEditor
Next Topic:@Inject usage in Xtend files
Goto Forum:
  


Current Time: Mon Apr 19 10:38:52 GMT 2021

Powered by FUDForum. Page generated in 0.01537 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top