New Elixir project in Intellij - intellij-idea

I've recently started using Elixir and I'd like to keep my code files in quite decent order. So I installed Elixir plugin for Intellij: https://github.com/KronicDeth/intellij-elixir, but stuck with trying to start an Elixir project. Could you give me some tips how to make new Elixir project?

I'm the maintainer of intellij-elixir. Please file support question as Issues on github: https://github.com/KronicDeth/intellij-elixir/issues. In fact, someone already asked a similar question (https://github.com/KronicDeth/intellij-elixir/issues/77). In summary, right now you can't create "Elixir Project". There isn't yet an "Elixir Project" feature/action although you're welcome to open an issue to make that a feature request. (It's nice if you open it instead of me opening it for you as you'll be subscribed to updates then.) With the feature set as is, you can create any type of project you like because all that matters is that the file extension is .ex for the Syntax Highlighting, Grammar parsing, Inspections and Quick Fixes to work. I just create the default Java project when testing intellij-elixir in Intellij or an empty directory or project layout created by mix new in Rubymine. Since two people at least have brought this up I'll add something to README after I'm finished with https://github.com/KronicDeth/intellij-elixir/issues/59.

Related

Debugging an app with computed environment variables in IntelliJ IDEA

Consider an app which, in 12-factor style, receives its config in the form of a JSON document provided as an environment variable. The config contains secrets, so it is never stored on disk; instead, it is computed on the fly before starting the app, using something like sops or nunjucks.
I am trying to debug such an app in IntelliJ. Is there any way to run some arbitrary script before launch and provide its output to the app as an environment variable?
I will accept answers for any run config type, but an approach that works with "npm" or "Application" would be most helpful for me.
EnvFile IntelliJ IDEA plug-in added this option some time ago.
I did a quick test and don't see this option available, at least on Windows.
EDIT: found it was only merged in the forked version and not available in the official plug-in. You will have to merge it manually and build the plug-in from sources.
IntelliJ IDEA doesn't have a built-in feature for that, feel free to vote for the corresponding request.

Getting set up with intelliJ IDEA

Really basic question here but this has always stopped me from using any JetBrains product, but here I am trying once again. I also have the same issues with CLion but that will be for another time and hopefully I can figure it out based on some feedback from this post.
I need to set up my environment in IntelliJ. Nothing special. No build tools. Currently I just run my school projects using
javac Main.java
java Main
This has gotten me so far but I really want to use IntelliJ tools to their full capacity.
I want to be able to set break points and step in and out of my code in their debugger and all the other nice tools that come with running my code through IntelliJ
Every get started tutorial that I have watched on YouTube or from JetBrains themselves already has a basic build configuration set up to run your basic "Hello World" application and that is what I think I need. Just compile my java files into classes and run/debug them.
This is what the run configuration icon in the IDE should look like
And this is what mine currently looks like
I have set many different JDKs to go along with my projects but none of them seem to get the tools I need set up in the IDE. I have even let IntelliJ download one for me and set it up itself to see if maybe I downloaded and installed it wrong and IntelliJ maybe wasn't recognizing it.
This picture below is showing the project structure for an application that I let IntelliJ download a JDK for and set it up itself
So if someone could help me that would be fantastic. Links to videos, blogs are welcome even though I know that isn't the convention on this forum but I think that would be sufficient for my situation. Thanks in advance!
---Update---
I have found that if I create a project in IntelliJ that I get all the default configurations that I need. The problem is when I need to get a project from VCS that I am not getting any of the configurations that I need to run/debug my program in IntelliJ.
The easiest solution here would be to click the green play button next to your main method, on the left where line numbers are displayed.
Intellij will configure a default java run configuration for you. It will be displayed in the menu for later use, like in the screenshot you posted, after your first run.
You can also create one using the to menu: Run > Edit run configuration to add some more options like arguments, environment variables (that only apply for the run config), etc.
A good starting point would be the Intellij help page on that topic. This help pages are always a good start and you find comprehensible instructions there on every topic.
Another good resource is the Intellij by JetBrains YouTube channel. This video about debugging shows both ways I described above. They have lots of quick tutorials about lot of features, like code generation or build tools. Check out the channel's playlists for specific topics.
Update
The problem with the already created project is that the default/ folder is not marked as source folder. You can do that by File > 'Project Structure...' and set the default/ folder as Sources:
The cause for intellij not recognizing this is because you didn't use a folder structure like the one of maven.
For source code:
src/main/java
src/main/resources
and for tests:
src/test/java
src/test/resources
If you set it up that way IntelliJ everything works as expected. I created a pull request to your repo. If you check out the branch, IntelliJ will setup everything correctly automatically.

How I can use the JavaFX framework?

firstly, I want let you know how useful this community is for me, I was stuck on an error
`Error: JavaFX runtime components are missing, and are required to run this application`
and thanks to this answer I actually solved: link
However I've a couple of questions. I noticed that IntelliJ doesn't change the configurations (Like set the VM option and pick the right library for the javaFX project), so each time I've to create a new JavaFX11 or 12 project I've to being throw all the manually settings again.
There's a way for set a "default behaviour" for the IDE ? It's really cumbersome.
The second question is, how I can use all the beautiful framework that the developer community offer for JavaFX? I've seen on openjFX a couple of interesting framework like TilesFX or CalendarFX but there's no information on how implement them on my IDE neither on GitHub nor here.
I have seen that most of them uses Gradle files, but honestly I don't have the faintest idea of what this kind of file does and how implement it on IntelliJ. Thank's to everybody.
Run the project with a more recent JDK like JDK11, for example.
If it does'nt work, you probably forgot to change the JDK of your builder in IntelliJ!
Open the settings and follow the path as bellow:
FOR MAVEN
FOR GRADLE

How to autocomplete/import Flutter classes in IntelliJ?

In IntelliJ, I have to manually import Flutter packages at the top of the file in order for auto-complete to work elsewhere in the file.
I was rather hoping I could start typing something (in a method) and IntelliJ would search my pubspec.yaml and locally within my project and suggest classes I might want. If I selected something that wasn't already imported, it should import it for me.
This basic functionality is available in many other languages and IDEs, so I'm wondering if I've got something misconfigured. I'm using IntelliJ 2018.2 with the latest Flutter and Dart plugins installed.
This is a known issue.
For performance reasons the DartAnalyzer was built to only load libraries that were imported anywhere in the projects code already.
The overall performance of DartAnalyzer was improved a lot since then and it would now allow to provide better suggestions, but it seems there weren't enough resources available yet to get it implemented.
Upvote and follow https://github.com/dart-lang/sdk/issues/25820

How to create an Eclipse plug-in for an SDK

I am trying to create an eclipse plug-in for an existing SDK. My main goal is to allow user to create a project that will automatically have the SDK jar file and will also load couple of examples. The main purpose is to free the user from the hassle of adding jar file and looking up the examples.
I am fairly new to this area of development. I have never created a plugin and was wondering if there are any specific tutorials or development guide for creating such a plugin.
Any help is appreciated!
It's a bit unclear what your requirements are, what the SDK are, what type of users you developing for. But the simplest solution would be to create a set of Eclipseprojects with a proper setup. Then your user would just import them and continue to build from them.
A more elaborate solution would be a new project wizard. So when the user goes to file -> new project, they will find a specific wizard this type of development. If this is what you are looking for, then this tutorial will offer a good starting point.