CLion Plugin: Register file extension with existing language - intellij-plugin

I'm developing a plugin for CLion to add new extensions to be recognized as C++ source. I've looked in StdLanguage but C++ is not there even though both CLion and IDEA have built-in support for C++ syntax.
How do I register the extensions with C++? I don't want to add any new features or define a new language, just register these extensions as C++ source.
I know it's possible to do it via the GUI but this is for a plugin.

To get the file type for C++ files, use FileTypeManager.getFileTypeByExtension("cpp"). Once you have that, you can call FileTypeManager.associateExtension() to associate an additional extension with it.

Related

Can I build a windows executable from kotlin source code?

As far as I know, kotlin native allows you to compile kotlin source code to platform specific nativ code, that runs without any virtual machine.
But I don't seem to find any example on how to build a windows executable (.exe) from kotlin source code.
Why is that?
Can you do it or not?
https://kotlinlang.org/docs/native-get-started.html shows you how to set up a basic Kotlin Native project, and compile it. The only note is that kotlin native will generate a .kexe, which is just a renamed .exe.

Retrieve Nuget Package Manager file in my java program (IntelliJ)

I got a dll file with an extension .nupkg from my .Net developer team mate which I need to use in my java program. How do I go about it? I use intellij.
A nupkg is just a zip file so you should be able to unzip it and see what it contains.
You can also take a look at the JNI (Java Native Interface, google or Wikipedia can tell you more), which lets you call out from Java to other languages. This isn't trivial though.

Libraries, projects, modules and packages in Intellij Idea

I'm a beginner programmer and I'm learning how to work with Intellij IDEA. A project in IntelliJ IDEA has some different structures like libraries, modules and packages.
Can someone explain what the difference is between those structures and when to use a particular structure? e.g. I can't choose my package name (of a class) arbitrarily when it's already part of a module. What is the connection between those? I'm primarily having difficulties understanding the difference between a package and a module. (characters)
A project in intellij consists of modules. Modules can be java modules, or android modules or whatever. Modules contain your java code and all that stuff. A Module can reference a library which can be a project library or a global library. Global libraries have to be defined only once. Project library in every project you need them.
Packages are a java concept and are IDE independent.
Lets say I wanna do a little game. I would create a intellij Project called "mySuperGame". Then I would create two java modules from intellij, called "logic" and "ui". In the module settings of "ui" I would specify a project library to use opengl and a dep. to "logic". The package name of my logic classes would be "com.mysupergame.logic.XXX".
See http://confluence.jetbrains.com/display/IDEADEV/Structure+of+IntelliJ+IDEA+Project for more information.
IntelliJ IDEA supports everything eclipse has. But vise versa might not be true. Please check this table for the differences. IntelliJ support intelligent perspective and has many windows.
Read the documentation from IntelliJ idea.
Below comparison between Visual Studio (.NET) and IntelliJ (Java), which might be helpful for .NET developers migrating to Java:

Using KDevelop during development of a shared library

I'm trying to use KDevelop as an IDE for development of a C++ shared library. An earlier posts here indicate that I need to edit a CMake makefile for doing that. This is quite painful and very time consuming as it means converting our custom gmake-oriented build system into something of CMake.
Is there any other way for doing that?
KDevelop doesn't force you to use a specific buildsystem like many other IDEs do. CMake is just the default as it's very well integrated and many if not all KDE projects use cmake.
You can use a different build system by choosing "Custom Buildsystem" or "Custom Makefile Project Manager".
Custom Makefile Project Manager simply calls "make" - your current build system should work this that.

Web module from custom scratch in IntellijIDEA 11.1.3

When I create new project in the aforementioned IDE, I can select Web Module and then Web Module Type (HTML5 Boilerplate, Twitter Bootstrap, Node.js).
I want to write custom IntellijIDEA Plugin to add custom Web Module Type.
I expect following user action sequence:
User clicks File - New project
Then selects option Create project from scratch
Creates new Web Module
Chooses Custom Scratch web module type
Specifies some preferences (as on picture above)
Clicks Finish
Let say, that I have java class, which receives few arguments and generates all necessary files in new project folder.
How can I create an interface for passing some arguments to my java class, which will make all the rest? As it is made for Node.js Express App.
The documentation for tying into certain pieces of IntelliJ are in the format of "the code is the documentation". This is a bit difficult when you want to interface with commercial plugins only available in the Ultimate Edition.
For open-source integration, you should be able to download the source for the Community Edition and navigate to your heart's content.
For commercial plugin integration, you'll need to find the jar file for that plugin and take a look at the class/method structure to get a guage on what you'll need to call. As far as defining your components in the plugin.xml file, you'll need to look for extension points in the plugin's plugin.xml file and implement those interfaces. There is documentation on the IntelliJ site explaining how to define extension points and define implementations of extension points for other plugins.
I used both of these approaches when I wrote a plugin for configuring an internal framework where I work.