Comments (17)
@ashald Sure, that would be great, thanks! I've added support for this to the following run config types:
- Local Clojure REPL
- Clojure Application
- Leiningen
I haven't actually released this yet, so could you add a note that these are available as of Cursive 1.8.2?
from envfile.
@cursive-ide done! And thank you one more time for taking care of this!
from envfile.
Meh, I just dropped contribution guide from the readme since there were 0 people willing to contribute so far. %) I'll check that plugin to see what integration options do we have and will comment here later this week.
from envfile.
After doing a quick research (and reverse engineering - more about it below), it looks like it's not possible to implement this feature, at least right now.
EnvFile
relies on JetBrains plugin platform in general and on RunConfigurationExtension
extension points in particular. This means that in order to integrate EnvFile
with any given run configuration 2 conditions must hold:
- Plugin/product that provides run configuration must define
RunConfigurationExtensionBase
-based extension point(s) - Plugin/product must respect properly call extensions in all methods in its run configurations.
Both of those things are quite easy to implement and I'd have contributed them to cursive
plugin... if it was open source. Looks like it's not (my apologies to developers for reverse engineering in order to conduct this research). So the only way around that I have in mind right now is to create an issue in their issue tracker requesting run configuration extension points support. Once that done we implementing support in EnvFile would be matter of 15 minutes.
from envfile.
Awesome, thanks for taking the time! I sent a quick message to one of the developers on Slack, linking this issue-- hopefully he can help us get the changes you need into Cursive.
from envfile.
Thanks, I'll take a look at this and see what needs doing.
from envfile.
@ashald I've looked into this. I can see what's required for the second item in your list - it looks like extending RunConfigurationExtensionsManager
and calling its methods is the way to go. I don't think this is complicated.
I'm not sure what to do for the first though. Is just doing what PythonRunConfigurationExtension
does sufficient, i.e. just providing an extension point? Is that step required? I don't see Java or Kotlin doing that, for example.
from envfile.
@cursive-ide did this feature request get any traction? I'd appreciate it as well!
from envfile.
I just checked again and it doesn't seem that anything changed in Cursive IDE in that regards.
@cursive-ide do you think we can figure this out somehow?
As you mentioned, IDEA has this such sort of extension implemented in a bit different way compared to PyCharm, RubyMine and GoLand. If your implementation of RunConfiguration is closer to IDEA - I can try to figure how exactly their implementation works.
from envfile.
@ashald Sure, I'd like to fix this. I'm not in front of the code right now but yes, Cursive only works in IntelliJ IDEA so its run configs work in that way. Any pointers you can provide about how to implement this would be very useful, and steps to test to make sure it's working.
from envfile.
@cursive-ide is your IDE-plugin closed source? I could've submitted a pull-request if I had access to the code. Otherwise I the best thing I can do is to point you to examples in OSS IDEA repo.
from envfile.
@ashald Yes, Cursive is closed source. I'm happy to make the changes, I just need to know what's required.
from envfile.
@ashald Another user has just asked about this, so I'd like to take another shot at fixing it. I've taken another look at the EnvFile code, let me know if this is what I need to do:
- It looks like the
RunConfigurationExtensionBase
for IntelliJ-based products is provided with EnvFile,IdeaRunConfigurationExtension
, so I don't have to do anything here. - It seems I should call the various functions in
JavaRunConfigurationExtensionManager
at various points in my run config life cycle:- Call
extendCreatedConfiguration
when using a RunConfigurationProducer. - Call
readExternal
andwriteExternal
when serializing/deserializing the run config. - Call
appendEditors
when creating my config editor. - Call
validateConfiguration
in mycheckConfiguration
method.
- Call
Does that look correct? Anything I'm missing?
from envfile.
Ok, having fiddled around with this some more, I think I now have this working. In addition to the above, I also added:
- A call to
updateJavaParameters
, which is the critical one for EnvFile to work. - A call to
attachExtensionsToProcess
when creating my ProcessHandler. I don't know what this does, but I see a few plugins doing it. @ashald, if you have any insight into whether this is required, or what it does, I'd appreciate it.
I've only done fairly rudimentary testing, but I think this can be closed, and I'll finish up the work over in cursive-ide/cursive#2160.
from envfile.
@cursive-ide I'm so sorry for dropping the ball on it even though I promised you some help.
What you posted above sounds like a great analysis and I don't think I could've done a better job.
It does sound accurate in everything you just said.
Unfortunately I do not know what's the purpose of attachExtensionsToProcess
. Although, if you're integrating with run configuration extensions it might bee a good idea to follow example of others and make use of all the methods. Unless you're eager to figure out what exactly would break without it. 😆
Please let me know if I can help you in any other way at this point.
from envfile.
@ashald No problem! Having read more code, I think attachExtensionsToProcess
is used by things like profilers and coverage tools to attach to the process once it's running. I've emulated the calls I've seen in my plugin, but I don't have a good way to test it unfortunately.
This seems to be working on my side and will be in the next Cursive EAP drop, so feel free to close this issue.
from envfile.
@cursive-ide thank you very much!
How do you like an idea of os listing support for Cursive in the EnvFile readme as seen in https://github.com/ashald/EnvFile#supported-platforms? If you like it I'd need the list of run configuration types I should include. If you could share it I'd highly appreciate it or I can request a "Non-Commercial licence" to try to figure it out on my own. Just let me know please!
from envfile.
Related Issues (20)
- EnvFile 3.4.1 crash HOT 4
- Error response from daemon: invalid environment variable: =::=::\ HOT 2
- Issues when using with IntelliJ 2023.1 HOT 19
- Allow Kubernetes yaml style
- Read access is allowed from inside read-action (or EDT) only HOT 3
- Does not work with custom defined files.
- New Release 3.4.2
- Causes ModuleNotFoundError error in PyCharm HOT 1
- Missing EnvFile tab in 2023.2.2 HOT 6
- $PROJECT_DIR$ is not working HOT 1
- Crash when starting a springboot application with a YAML env file
- Security vulnerability in apache commons-text v1.9 HOT 2
- When executable is ticked, please add an option to run it from the working dir configured in the run config
- command line to set envfile extension
- env file not loaded for Gradle run/debug configurations HOT 3
- Support for all Macros
- Support for react native configurations HOT 1
- EnvFile not working in Kotlin Configurations
- With "Ignore missing files" option off no visible error is shown if the file is missing, all gradle commands fail silently HOT 1
- EnvFile configuration resets on restart for ScalaTest setups HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from envfile.