Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Disable new resource creation for every character entry(Disable incremental build)
Disable new resource creation for every character entry [message #1847348] Sun, 24 October 2021 13:54 Go to next message
Eclipse UserFriend
I am using xtext language server along with vscode extension which supports xtext language .

For every character entry/deletion in the vscode text editor new resource is getting created.

org.eclipse.xtext.build.IncrementalBuilder.InternalStatefulIncrementalBuilder.URIBasedFileSystemAccessFactory class's unloadResource() method will called when I enter/delete any character in the vscode text editor.

How I can disable xtext's incremental build to avoid new resource creation?
Re: Disable new resource creation for every character entry [message #1847354 is a reply to message #1847348] Mon, 25 October 2021 04:33 Go to previous messageGo to next message
Eclipse UserFriend
i assume without the incremental build nothing will work ...
maybe you can customize
org.eclipse.xtext.ide.server.LanguageServerImpl.didChange(DidChangeTextDocumentParams)
maybe thats also something that can be configured in you client (vscode) to better batch the changes

[Updated on: Mon, 25 October 2021 04:57] by Moderator

Report message to a moderator

Re: Disable new resource creation for every character entry [message #1847382 is a reply to message #1847354] Mon, 25 October 2021 18:13 Go to previous messageGo to next message
Eclipse UserFriend
I have added build listener to language server which will be triggered for every character entry/deletion. We are getting list org.eclipse.xtext.resource.IResourceDescription.Delta objects when ever text changes. But we cannot extract which element added or deleted or renamed. Any ways to configure delta creation so that we can get details related to modification/deletion/addition of elements(org.eclipse.emf.ecore.EObject).

At vscode client side how we can handle text changes?

Any example where sync between diagram and text is implemented using vscode, xtext language server ?
Re: Disable new resource creation for every character entry [message #1847383 is a reply to message #1847382] Mon, 25 October 2021 18:30 Go to previous messageGo to next message
Eclipse UserFriend
If the named elements change then you should see that if you compare old and new on the delta can't you?
I have no idea if the delay is configurable in vscode

Did you check out the diverse Sprotten examples out there?
Re: Disable new resource creation for every character entry [message #1847412 is a reply to message #1847383] Tue, 26 October 2021 13:39 Go to previous messageGo to next message
Eclipse UserFriend
Please share link of diverse Sprotten examples.

For white space entry/deletion also I am getting deltas. How we can extract new element creation or element deletion details from deltas? Any where else we can extract these details?
Re: Disable new resource creation for every character entry [message #1847414 is a reply to message #1847412] Tue, 26 October 2021 15:26 Go to previous messageGo to next message
Eclipse UserFriend
you need to compare the EObject Descriptions in delta old/new
see also org.eclipse.xtext.resource.impl.DefaultResourceDescriptionDelta.haveEObjectDescriptionsChanged()

for sprotty+xtext

e.g. https://github.com/TypeFox/theia-xtext-sprotty-example
https://github.com/eclipse/sprotty-server

[Updated on: Tue, 26 October 2021 15:28] by Moderator

Report message to a moderator

Re: Disable new resource creation for every character entry [message #1847424 is a reply to message #1847414] Tue, 26 October 2021 19:22 Go to previous messageGo to next message
Eclipse UserFriend
Always org.eclipse.xtext.resource.impl.DefaultResourceDescriptionDelta.haveEObjectDescriptionsChanged() method will return false.
Re: Disable new resource creation for every character entry [message #1847433 is a reply to message #1847424] Wed, 27 October 2021 04:48 Go to previous message
Eclipse UserFriend
Can you be more specific what your grammar looks like and what you are typing when the changed stays false
Previous Topic:How to extend Xtext's trace API?
Next Topic:How could empty elements be allowed in a whitespace-aware DSL in xtext?
Goto Forum:
  


Current Time: Sat Feb 08 20:19:12 GMT 2025

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

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

Back to the top