Giter VIP home page Giter VIP logo

Comments (17)

cursive-ide avatar cursive-ide commented on September 26, 2024 1

@ashald Sure, that would be great, thanks! I've added support for this to the following run config types:

  1. Local Clojure REPL
  2. Clojure Application
  3. 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.

ashald avatar ashald commented on September 26, 2024 1

@cursive-ide done! And thank you one more time for taking care of this!

from envfile.

ashald avatar ashald commented on September 26, 2024

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.

ashald avatar ashald commented on September 26, 2024

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:

  1. Plugin/product that provides run configuration must define RunConfigurationExtensionBase-based extension point(s)
  2. 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.

olslash avatar olslash commented on September 26, 2024

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.

cursive-ide avatar cursive-ide commented on September 26, 2024

Thanks, I'll take a look at this and see what needs doing.

from envfile.

cursive-ide avatar cursive-ide commented on September 26, 2024

@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.

waltermblair avatar waltermblair commented on September 26, 2024

@cursive-ide did this feature request get any traction? I'd appreciate it as well!

from envfile.

ashald avatar ashald commented on September 26, 2024

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.

cursive-ide avatar cursive-ide commented on September 26, 2024

@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.

ashald avatar ashald commented on September 26, 2024

@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.

cursive-ide avatar cursive-ide commented on September 26, 2024

@ashald Yes, Cursive is closed source. I'm happy to make the changes, I just need to know what's required.

from envfile.

cursive-ide avatar cursive-ide commented on September 26, 2024

@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:
    1. Call extendCreatedConfiguration when using a RunConfigurationProducer.
    2. Call readExternal and writeExternal when serializing/deserializing the run config.
    3. Call appendEditors when creating my config editor.
    4. Call validateConfiguration in my checkConfiguration method.

Does that look correct? Anything I'm missing?

from envfile.

cursive-ide avatar cursive-ide commented on September 26, 2024

Ok, having fiddled around with this some more, I think I now have this working. In addition to the above, I also added:

  1. A call to updateJavaParameters, which is the critical one for EnvFile to work.
  2. 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.

ashald avatar ashald commented on September 26, 2024

@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.

cursive-ide avatar cursive-ide commented on September 26, 2024

@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.

ashald avatar ashald commented on September 26, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.