Skip to main content



      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 07:10 Go to next message
Eclipse UserFriend
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 07:13 Go to previous messageGo to next message
Eclipse UserFriend
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

[Updated on: Mon, 24 July 2023 07:14] by Moderator

Re: Restricting scope to files that are currently open [message #1860225 is a reply to message #1860222] Mon, 24 July 2023 08:06 Go to previous messageGo to next message
Eclipse UserFriend
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 08:15 Go to previous message
Eclipse UserFriend
i fear you need to do a lot of debugging and customization then.

[Updated on: Mon, 24 July 2023 08:16] by 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 May 19 17:06:48 EDT 2025

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

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

Back to the top