Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Restricting scope to files that are currently open
Restricting scope to files that are currently open [message #1860220] Mon, 24 July 2023 11:10 Go to next message
Atul Krishnan is currently offline Atul KrishnanFriend
Messages: 8
Registered: July 2023
Junior Member
Hello,

I was wanting to know whether there was a way to restrict scope to files that are currently open in the editor, irrespective of whether they are present in the project or else where.

I tried using the PlatformUI class to obtain the paths of the files that are currently open, and then created a new Xtext resource for each file path. I then load the contents and add the required reference objects to a list that I pass to the scope.

But loading the contents to the resource is taking too much time and affecting the performance. Is there any better way?

Thank you,
Atul
Re: Restricting scope to files that are currently open [message #1860222 is a reply to message #1860220] Mon, 24 July 2023 11:13 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14735
Registered: July 2009
Senior Member
assume you have to build this yourself.
org.eclipse.xtext.builder.impl.DirtyStateAwareResourceDescriptions
might be a starting point

maybe you can elaborate your usecase a bit more


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com

[Updated on: Mon, 24 July 2023 11:14]

Report message to a moderator

Re: Restricting scope to files that are currently open [message #1860225 is a reply to message #1860222] Mon, 24 July 2023 12:06 Go to previous messageGo to next message
Atul Krishnan is currently offline Atul KrishnanFriend
Messages: 8
Registered: July 2023
Junior Member
Hello,

I'm designing a DSL where references can only be made to other .mydsl files that are currently opened in the editor. Once a file is closed, the references from that file must be removed from the scope. And if a file is opened, the references from that file must be added to the scope. The scope of the references will be in the hands of the user, instead of providing all the references.
Re: Restricting scope to files that are currently open [message #1860226 is a reply to message #1860225] Mon, 24 July 2023 12:15 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14735
Registered: July 2009
Senior Member
i fear you need to do a lot of debugging and customization then.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com

[Updated on: Mon, 24 July 2023 12:16]

Report message to a moderator

Previous Topic:LSP Support: Binding for custom ResourceSet is not considered during runtime
Next Topic:Vscode plugin issue (OutPutStream issue)
Goto Forum:
  


Current Time: Mon Dec 09 00:35:47 GMT 2024

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

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

Back to the top