Welcome to julia-Intellij’s documentation!

Readme

Julia plugin for the IntelliJ Platform

This is a work in progress, some features are implemented partially, there may be performance and stability problems.

JetBrains plugins JetBrains plugins Documentation Status Join the chat at https://gitter.im/julia-intellij/Lobby

CI Status
Travis CI (with IdeaC) Travis CI Build status
AppVeyor (on Windows) AppVeyor Build status
CircleCI (with tests) CircleCI Build status
CodeShip (branch master) CodeShip Build status

Installation & Usage

Install IntelliJ IDEA (or other JetBrains IDEs), open Settings | Plugins | Browse repositories, install Julia plugin, and create a Julia project.

For detailed use instruction, visit: https://julia-intellij.readthedocs.io/en/latest/
To download a nightly build (buggy!), visit https://ci.appveyor.com/project/ice1000/julia-intellij/build/artifacts/ .
To learn about the test summery, visit https://circleci.com/build-insights/gh/ice1000/julia-intellij/master .

Video Instructions
  • English video instruction on YouTube: https://www.youtube.com/watch?v=gjRhvPBiasU
  • Chinese video instruction on Bilibili: https://www.bilibili.com/video/av20155813

Screenshots

Plots

VarInfo (Workspace)

Debugger (nightly-build)
based on DebuggerFramework and ASTInterpreter2

Compatible IDEs

The plugin is compatible with any IntelliJ based IDE starting from 2016.1. If you don't have any yet, try IntelliJ IDEA Community Edition, it's free.

Alternatives

If you don't like JetBrains IDE, turn right and search JuliaPro or Juno.

Otherwise:
If you search GitHub with "Julia IntelliJ" (data collected at 2018/1/28 (YYYY/M/DD)), you'll find 4 related repositories:

  • snefru/juliafy (incomplete syntax highlight, SDK management, file recognizing, only support MacOS)
  • sysint64/intellij-julia (this only recognize your file as a Julia file, and do nothing else)
  • satamas/julia-plugin (ditto)
  • ice1000/julia-intellij (too many features, can't list here)

Now you know your choice 😉

Contributing

You're encouraged to contribute to the plugin in any form if you've found any issues or missing functionality that you'd want to see. Check out CONTRIBUTING.md to learn how to setup the project and contributing guidelines.

Debugger

Julia Debugger

This is an English version documentation for our Julia Debugger in Julia IntelliJ plugin. Our debugger is a wrapper based on Keno Fischer's DebuggerFramework and ASTInterpreter2.

First of all, pay our respects to Keno!

Overview

gif

Installation & Usage (from github repositoriy)

Install IntelliJ IDEA (or other JetBrains IntelliJ platform IDEs such as PyCharm / WebStorm / Goland / and even Android Studio:joy:), open Settings (Preferences for macOS) | Plugins | Browse repositories, install Julia plugin, and create a Julia project.

Dependencies

  • ASTInterpreter2#master
  • DebuggerFramework#master
  • JSON
  • Julia 0.7+
(the master is needed for debugger)
add packages
(v1.0) pkg> add DebuggerFramework#master
(v1.0) pkg> add ASTInterpreter2#master
(v1.0) pkg> add JSON

Create a Julia project after adding the plugin, and write simple sample codes:

function func()
    i = 10
    while i>0
        println(sin(i))
        i-=2
    end
end

@enter func()

use @enter macro before a function call expression as ASTInterpreter2 do. And put a breakpoint at any line (which is useless but necessary on account of JB's IDE), the functional is @enter macro, not breakpoints.

then you'll notice that the Debug button at upper right corner is avalible, which is shown as a green bug. Press it!

Note!!!

If you use this debugger in Windows, the first time you run the debugger may froze your IDE about 2 minutes tested in my PC, while it'll become normal at the second time. So we strongly recommend that you'd better not use this debugger in Windows.

Debug mode

Relayout your debug panel like this by dragging:

relayout You can see call stackframes at the left of panel and local variables at right.

Functions

step over

  • Step over : Run next call in current file. The nc command for DebuggerFramework.
  • Step into : Run the next call into a deeper stackframes. The sg command for DebuggerFramework.
  • Froce Step into : (maybe useless). s command.
  • Step out : Run out of current stackframes. finish command.
  • Run to cursor(unsupported currently). Do not try this button.
  • Rerun: Rerun the Julia program and debug.
  • Resume |▶: Rerun the debug when debug session is not terminated. (Note that debug session will not exit until you press the Red Stop Rectangle Button)

Features

Features


Julia language support.



You're encouraged to contribute to the plugin in any form if you've found any issues or missing functionality that you'd want to see. Check out CONTRIBUTING to learn how to setup the project and contributing guidelines.

All your issues/pull requests will be replied very quickly.

Functions provided:
  • SDK and module management
  • A GUI package manager
  • Documentation view
  • Syntax highlight
  • Language injection
  • Run configuration and code execution
  • Live templates
  • File templates
  • Completions
  • Jump to definition
  • Find usages
  • Renaming
  • Doc string generation
  • Try Evaluate
  • Bread crumbs
  • Regular expression injection
  • DocString markdown injection (works only when either Markdown or MarkdownNavigator is installed)
  • Special input for LaTeX style unicode character
  • Structure view
  • DocumentFormat.jl integration
  • Error reporter
  • Version number parsing
  • Parameter hint
  • In-IDE REPL
  • Sci-Mode

What you'll see in the future:

  • Formatter

Please don't downvote our plugin for not having one of the features above, because we're just working on it.

Maintainers:

  • ice1000
  • zxj5470
  • hoshinotented
  • hexadecimaaal

Contributing

How to build

Use gradle

$ chmod a+x gradlew
$ ./gradlew buildPlugin

It's now recommended to use gradle because it can be used under command line.

But anyway you're gonna edit this project code with IDEA.

Use Idea build

Prerequirements

First install required plugins in your IntelliJ IDEA:

  • Grammar-Kit JetBrains Plugins
  • UI Designer (built-in, just make sure you've enabled it)
  • Plugin DevKit (built-in, just make sure you've enabled it)
  • Kotlin JetBrains Plugins

For debugging purpose, it's recommended to install a plugin called PsiViewer in the plugin sandbox JetBrains Plugins.

Build

Clone this repo:

$ git clone https://github.com/ice1000/julia-intellij.git

Create a plugin project from your cloned source, and use gradle buildPlugin to do code generation.

To debug, run gradle runIde in the debugger. Break points works like a charm.

For more information, see the official doc.

Contributing guidelines

You must

  1. Put all natural language strings into the resource bundle
  2. Use as much @NotNull and @Nullable as you can in Java codes except local variables

You must not

  1. Break the code style -- use tab indents with spaces aligns (see .editorconfig)
  2. Open pull requests just to fix code style, or use some syntax sugar (julia-intellij is not SharpLang!)
  3. Add any kind of generated file into the git repo (including the parser!)
  4. Violate the open source license

You should

  1. Use Kotlin except UI, but if you only know Java, never mind, we can help you convert
  2. Name your files like julia-xxx.kt
  3. Put all highly related classes into a single file
  4. Use English, but we also read Chinese so if you only know Chinese just use it
  5. Write commit message starts with [ issue id or refactor type ]

You'd better

  1. Read http://www.jetbrains.org/display/IJOS/IntelliJ+Coding+Guidelines

You don't have to

  1. Write comments, except you're using magics. Tell us if you do
  2. Write tests, because we'll review your codes carefully

Developers from Windows

Encoding

The task genLexer and runIde(depends on former) need file encoding with UTF-8, so if you have trouble in running some gradle tasks, please run gradle with VM options -Dfile.encoding=UTF-8 or run with environment variable JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8