Importing module from a different folder

I have two folders one for daml and another for triggers. And within daml folder, there are two subfolders Group1 containing Claims.daml and Group2 containing Token.daml

daml
    - Group2
           -Claims.daml

    - Group1
           - Token.daml

    - main.daml


triggers
    - daml
           - sync.daml

when i try to import the module Token inside sync.daml I am getting an error stating that it cant find Group1.Token and its not a module in the current program. How do i make the daml code under triggers folder be aware of modules in other subfolders.

I am using the following code for importing the module

import Group1.Token as Token1

How can i fix this?

Hi @Ashok_Raj,

By default a Daml project specifies where to find its code in the daml.yaml file. Before we can help you we’ll need a bit more information about your “project”-level setup: how many daml.yaml files do you have, and would you be willing to share their contents?

To set that up, I’d recommend this structure:

daml
- daml.yaml
- Group2/Claims.daml
- Group1/Token.daml
- Main.daml
triggers
- daml.yaml
- Sync.daml

You then build your model by running daml build in the first directory.
The triggers directory references the model DAR in data-dependencies.

The eg in the question is hypothetical. I am using an existing demo and updating it. No new changes were done to the daml.yaml files. But the file structure is like @cocreature mentioned in his comment.

The issue is solved now by doing a reload of developer window in vs code.