Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8681627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:33:35+00:00 2026-06-12T21:33:35+00:00

I have developed a DSL with xText and recently add somme enhanced completion. In

  • 0

I have developed a DSL with xText and recently add somme enhanced completion.
In a xText-generated editor when calling completion by Ctrl-Space, the completion handler has to perform a folder scanning to look for symbols in another text file of the same DSL.
The entry point is :

public class TypesProposalProvider extends AbstractTypesProposalProvider
{
   public void completeQualifiedName_Path(
      EObject                     model,
      Assignment                  assignment,
      ContentAssistContext        context,
      ICompletionProposalAcceptor acceptor )
   {
      super.completeQualifiedName_Path( model, assignment, context, acceptor );

I use:

      Model root = (Model) context.getRootModel();
      Resource rootRc = root.eResource();

to obtain the emf.ecore container of the model.

And now, how can I look for sibling resources, the other files in the same folder, in term of ecore resource?

With the another resources, I’ll call Resource.load() to populate the underlaying emf.ecore model of the siblings.

I hope you understand my approximative English (I’m French)…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:33:36+00:00Added an answer on June 12, 2026 at 9:33 pm

    Here is the final version, compact as usual 😉 :

    Resource   rootRc = root.eResource();
    String     rcPath = rootRc.getURI().toPlatformString( true );
    IFile      file   = (IFile)ResourcesPlugin.getWorkspace().getRoot().findMember( rcPath );
    IContainer parent = file.getParent();
    for( IResource member : parent.members())
    {
       String ext = member.getFileExtension();
       if( ext != null && ext.equals( "types" ))
       {
          String prefix     = member.getName();
          String path       = member.getLocation().toString();
          URI    uriSibling = URI.createFileURI( path );
          prefix = prefix.substring( 0, prefix.length() - ".types".length());
          if( ! rcPath.endsWith( '/' + prefix + ".types" )
             && ( context.getPrefix().isEmpty() || prefix.startsWith( cntxtPrefix )))
          {
             Resource types  = rs.createResource( uriSibling );
             types.load( null );
             for( EObject rc : types.getContents())
             {
                ...
             }
          }
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a small administration page for game servers which you can add/remove/edit
I have developed an app for ios 5 recently but when I was telling
I have developed a simple DSL for tasks on a UniVerse database in jruby.
I have developed an excel add-in using Visual studio 2010 with target framework as
I'm developing a DSL using Eclipse's Xtext framework. For the content assist/code completion, I
I have developed sample api as jar file. This jar file contains the code
I have developed a web site that requires user registration and authentication for some
I have developed a website using Razor (Microsoft WebMatrix) and now I want to
I have developed a Java server using Eclipse that accepts TCP socket connection from
i have developed an app which executes sql jobs. When I click on execute

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.