Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request - include statements working with .cql files in a different directory #11

Open
Benjamin-Kuzava opened this issue May 2, 2024 · 2 comments

Comments

@Benjamin-Kuzava
Copy link

Was wondering how feasible it might be to allow a cql library to include another library a directory up. For example, in our project, we have a large amount of helper libraries we'd like to keep separate for organizational purposes, and although our rules would compile and run, the syntax highlighting gives an error that the include library cannot be found, and therefore we would miss out on a lot of the functionality of the plugin. Here's an example:

cql
  |- helperlibraries
  | |- SomeHelperLibrary-0.0.1.cql
  |- MainLibrary-0.0.1.cql

We'd like MainLibrary-0.0.1.cql to be able to include SomeHelperLibrary-0.0.1.cql and use its functions.

@vitorpamplona
Copy link
Contributor

Yeah, I didn't know how to proceed with that. The question is should the plugin import every single .cql file in all directories to make it all available? Because CQL does not have an import structure where the user can specify directories. The environment must load everything. However, I have a feeling that loading everything might be quite heavy on some machines.

So, in the end, we ended up just loading what's in each directory. :(

But I am open to any ideas there.

@TsilenT
Copy link

TsilenT commented May 6, 2024

What if it just loaded current directory + subdirectories? Without any structure from CQL itself, it feels like the two ways to get the plugin to behave would be either to load the world (which I agree feels expensive), or specify some sort of "library/PATH" directories to the plugin. Barring those, loading subdirectories only feels like a fairly safe compromise to "load the world", and could even have a configuration toggle if we want to be on the safer side.

It'd have the minor side product of mildly forcing convention on the users (since there would be no upwards visibility), but in reality it would be no different than the way the plugin behaves today for upwards visibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants