📜 ⬆️ ⬇️

Is IntelliJ based .NET support a reality?

Let's talk about .NET support on the IntelliJ platform. After reading, you decide: Is it a reality?

Let's do the usual Hello World . What do we need to check?
1. Download Consulo build (my fork IntelliJ IDEA, why fork is a different topic).

2. Run bin \ consulo.exe (win 32), bin \ consulo64.exe (win 64), Consulo.app (mac), bin / consulo.sh (linux). I recommend testing on Windows, although I checked Linux and Mac builds, but they are less stable, and there are a couple of problems (for example, with Mac + Mono). If everything went smoothly - we have:

image
')
3. Click on Actions -> Configure -> Plugins . We see there is an empty list. Click browse repositories .... A dialog will appear, after 10 seconds a list of available plug-ins will appear (delay is a poor implementation of the plugin repository). We are looking for Microsoft .NET or Mono .NET and install it. As a result, we should have:

image

4. Actions -> Create Project -> OK . We have an empty project. Go to the project settings. We are looking for our module and select the Extensions tab. There we select Microsoft .NET -> C # (or Mono .NET -> C # ). Structurable extensions provide an opportunity to customize a project similar to Java (with Source + Test folders, with support for packages like Java):

image

5. After clicking OK , there will be a delay and indexing will take place. I do not exclude that during indexing Exception will crash, if it does, send it to me through the interface .
To check if everything is normal, do Ctrl + N -> Console . If you go to the System.Console class, then everything is fine, and you can continue, if not, please unsubscribe in the comments.

6. Create a class. In the project tree, do New -> C # Class -> `Program` -> OK and write the usual Hello World:

using System; public class Program { public static void Main(String[] arg) { Console.WriteLine("Hello World"); } } 


7. Now we need to run this code. Go to Edit Configurations -> Add -> .NET Application . Nothing else needs to be changed.

"Image"

Save and click Run :

"Image"

On this our test is over.

I would like to clarify that this is only the initial implementation, which I do in solo mode (almost 500 commits).
She supports:
• Macros;
• Decompiling .NET libraries;
• Profiles (the ability to change KFOR, variables, etc.);
• Basic search for methods, classes, variables, other;
• Highlighting, partial filling, folding;
• Virtually the entire syntax of C #.

But at the same time, there are bugs:
• Binary operations return the wrong type;
• #if macros have a habit of breaking in large files;
• Inner methods and enums do not participate in the search;
• Decompiling is not perfect.

What are my plans?
• Correct bugs;
• Debugging;
• NUnit, Unity, NAnt, Vistual Studio Importer, IronRuby, IronPython, and ....

I'm not going to throw, there is still time to develop. All links can be found on my github profile.

Source: https://habr.com/ru/post/215203/


All Articles