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.
CI | Status |
---|---|
Travis CI (with IdeaC) | |
AppVeyor (on Windows) | |
CircleCI (with tests) | |
CodeShip (branch master) |
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
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.
Contributors¶
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¶
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.
Setup Julia in IntelliJ or see other docs¶
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:
You can see call stackframes at the left of panel and local variables at right.
Functions¶
- 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)
Thanks to¶
Features¶
Features¶
Julia language support.
- Chinese video instructions: av20155813
- English video instructions: Click to visit
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
- UI Designer (built-in, just make sure you've enabled it)
- Plugin DevKit (built-in, just make sure you've enabled it)
- Kotlin
For debugging purpose, it's recommended to install a plugin called PsiViewer in the plugin sandbox .
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¶
- Put all natural language strings into the resource bundle
- Use as much
@NotNull
and@Nullable
as you can in Java codes except local variables
You must not¶
- Break the code style -- use tab indents with spaces aligns (see .editorconfig)
- Open pull requests just to fix code style, or use some syntax sugar (julia-intellij is not SharpLang!)
- Add any kind of generated file into the git repo (including the parser!)
- Violate the open source license
You should¶
- Use Kotlin except UI, but if you only know Java, never mind, we can help you convert
- Name your files like
julia-xxx.kt
- Put all highly related classes into a single file
- Use English, but we also read Chinese so if you only know Chinese just use it
- Write commit message starts with
[ issue id or refactor type ]
You'd better¶
- Read http://www.jetbrains.org/display/IJOS/IntelliJ+Coding+Guidelines
You don't have to¶
- Write comments, except you're using magics. Tell us if you do
- Write tests, because we'll review your codes carefully