How do I set a root directory (or global namespace) for pkl to look through? #1380
-
|
Good evening! I'm having another frustrating problem that I'm trying to solve, and tried a few different solutions to no avail. .
βββ data
βΒ Β βββ actions
βΒ Β βΒ Β βββ zdebug
βΒ Β βββ damageTypes
βΒ Β βββ runes
βΒ Β βΒ Β βββ 1x1
βΒ Β βΒ Β βββ zdebug
βΒ Β βββ schemas
βΒ Β βββ effects
...Right now, I have a file in the Ultimately, what I'm seeking is if there's a way to set the Also, if it helps at all, I'm using Jetbrains Rider primarily. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hey there! The ProjectsOne approach might be to break your configurations up into different projects and have them depend on each other as local dependencies. With this method, only the PklProject in each project needs to know the relative path on disk of its dependencies and modules need to know the relative path to their imports within each project. In this this approach you might have a directory structure like this: Then, modules in any directory under This approach has great editor support and is pretty flexible and is especially appealing if your schemas may be maintained/published separately from the rest of your data in the future. Module pathIf you're familiar with Java's class path or You can configure the modulepath by marking the directory as a resource root in IntelliJ or other JetBrains-based editors. However, there currently no support for it in pkl-lsp. This is something we're interested in adding in the future! |
Beta Was this translation helpful? Give feedback.
Hey there! The
.../import method is one I've seen used with broad success in projects small and large (and very, very large). That said, there are a few other ways to go about this:Projects
One approach might be to break your configurations up into different projects and have them depend on each other as local dependencies. With this method, only the PklProject in each project needs to know the relative path on disk of its dependencies and modules need to know the relative path to their imports within each project.
In this this approach you might have a directory structure like this: