Replies: 3 comments
-
| 
         Hey there! This is something I've given some thought to. It's worth noting that the  You can read more about how I approached implementing external readers in SPICE-0009. One of the future directions mentioned was support for specifying external readers via the user's ~/.pkl/settings.pkl file. We didn't have a strong motivating use case for this today and there are some unanswered security questions around it, but it's certainly technically feasible. I do think it would be good for pkl-lsp and pkl-intellij to provide better support for this kind of usage! It may be reasonable for these tools to support invoking external readers for module resolution and import autocompletion to make working with custom URI schemes a better experience. Even simpler, I think it would be good to support configuring these tools with a way to re-map URIs with custom schemes to a different (natively supported) URIs like   | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Thanks! External readers indeed make sense, and I was thinking of either support for specifying external readers in the  IDE support would be great, and a simple mapping would suffice. I thought of something else that may be useful regarding this; since my current rewriting is quite simple, it could also be implemented as a Pkl function. It may be helpful to have Pkl functions defined to provide the mapping functionality, which can also help avoid any security issues.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Rather than using a custom scheme, can you publish your DSL as a package? This is something natively understood by pkl-intellij and pkl-lsp. For package imports, take a look at https://pkl-lang.org/main/current/language-reference/index.html#package-asset-uri  | 
  
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using the Pkl Java bindings in a runtime system, where Pkl is the basis for a DSL.
For my DSL, I have a standard library, for which it is convenient to add a module like
dsl:Something.The Java bindings support this neatly: internally, the
dsl:scheme gets translated to a classpath resource shipped with the runtime build. However, current support within IDEs and the CLI does not enable ergonomic handling of user-defined modules.It would be very convenient if there were a way to define (globally, for instance, in Pkl settings) the handler for such schemes (for example, pointing to a URL where the same module can be fetched).
As far as I can tell from the documentation, this is currently possible at a project level, but that may not always be desirable; sometimes you want a global setting without needing to create a project.
Currently, the handling of schemes in the IDE plugins and CLI appears to be fairly static.
Full support throughout the toolchain would make user-defined module support more useful.
Proposed solution
This would make user-defined modules a first-class feature in the Pkl ecosystem, improving ergonomics for DSLs and other custom uses of Pkl.
Beta Was this translation helpful? Give feedback.
All reactions