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
sathya narayana is currently offline sathya narayanaFriend
Messages: 4
Registered: October 2021
Junior Member
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
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

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

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
sathya narayana is currently offline sathya narayanaFriend
Messages: 4
Registered: October 2021
Junior Member
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
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
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?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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
sathya narayana is currently offline sathya narayanaFriend
Messages: 4
Registered: October 2021
Junior Member
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
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
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


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

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

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
sathya narayana is currently offline sathya narayanaFriend
Messages: 4
Registered: October 2021
Junior Member
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
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Can you be more specific what your grammar looks like and what you are typing when the changed stays false

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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 Apr 20 02:43:27 GMT 2024

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

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

Back to the top