Welcome to julia-Intellij's documentation!

Readme

Julia plugin for the IntelliJ Platform 中文文档

目前还在开发中,很多特性有待实现,可能会有一些小问题。

JetBrains plugins JetBrains plugins 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

安装与使用

安装有IntelliJ IDEA (或其他JetBrains的IDE比如PyCharm/CLionGoLand等), 打开设置 Settings | Plugins | Browse repositories, 安装 Julia 插件, 然后创建工程

想要提前获取新的版本,请访问:https://ci.appveyor.com/project/ice1000/julia-intellij/build/artifacts/ 想要了解 test 运行的情况,请访问 https://circleci.com/build-insights/gh/ice1000/julia-intellij/master .

视频介绍

截图

绘图

数据 (工作区)

调试器
基于 DebuggerFramework 和 ASTInterpreter2

IDE 适用版本

本插件适用范围为基于IntelliJ平台的 IDE (PyCharm/CLion/PhpStorm等。版本号大于2016.1) 如果还没有相关 IDE ,请下载IntelliJ IDEA 社区版, 这玩意免费哒!

备选方案

如果你不喜欢 JetBrains 家的 IDE, 出门右拐搜索 JuliaPro 或者 Juno.

或者:
在GitHub上搜索"Julia IntelliJ" (截止到2018/1/28), 有4个相关的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 (超级多的 功能特性, can't list here)

知道该选什么了吧 😉

Contributing

如果你已经找遍了issues里面的内容还是缺少你想要的功能的话, 欢迎翻阅CONTRIBUTING.md的内容,里面有如何建立工程和开发指南。

Debugger

Julia Debugger

这是 julia-intellij 插件的调试器的文档。 我们的调试器基于 Keno FischerDebuggerFrameworkASTInterpreter2 项目。

首先我们得向 Keno 大神致敬!

预览

gif

下载安装

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.

在 IntelliJ 中配置 Julia

依赖项

  • ASTInterpreter2#master
  • DebuggerFramework#master
  • JSON
  • Julia 0.7+
(一定要有master)
添加包
(v1.0) pkg> add DebuggerFramework#master
(v1.0) pkg> add ASTInterpreter2#master
(v1.0) pkg> add JSON

在添加完插件后创建 Julia project after adding the plugin, 然后写下一段简单的样例代码:

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

@enter func()

在函数调用的前面使用 @enter 宏,和 ASTInterpreter2 包的用法一样。 然后在任意一行 设置一个断点 (没啥用但是必须要有一个断点), 真正起作用的是 @enter 宏, 而不是 IDE 中的断点。

你会发现右上角的绿色虫子的 Debug 按钮可以使用了。 按下!

注意!!!

如果你在 Windows 下使用这个debugger,第一次运行的时候会让你的IDE卡住差不多 2 分钟, 不过之后就正常了。 所以我们强烈建议不要在 Windows 下用这个功能

Debug 模式

通过拖拽将调试的面板设置成这个样子:

relayout 你可以看到左边是堆栈信息,右边是局部变量。

功能介绍

step over

  • Step over : 运行当前文件的下一个调用。对应 DebuggerFramework 的 nc 命令.
  • Step into : 运行到更深一层。对应 DebuggerFramework 的 sg 命令。
  • Force Step into : (好像没啥用 useless). 对应 s 命令。
  • Step out : 跳出当前堆栈。finish 命令.
  • Run to cursor(暂不支持). 运行至光标处。
  • Rerun: 重新运行 Julia 程序和 debug。
  • Resume ▌▶: 在整个程序会话未终止的时候重新运行 debug。(注意 只有在按下红色方形Stop 才会终止程序。)

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

如何构建

使用 gradle

$ chmod a+x gradlew
$ ./gradlew buildPlugin

不过不是很推荐使用 gradle 因为这可能会出现一些无关紧要的依赖项而且很慢。

使用 Idea 构建

Prerequirements

首先在 IntelliJ IDEA 安装插件:

  • Grammar-Kit JetBrains Plugins
  • UI Designer (内置,确保已启用)
  • Plugin DevKit (内置,确保已启用)
  • Kotlin JetBrains Plugins

I've compiled a Grammar-Kit which supports completing Java codes in the jflex code fragment which can be found here.

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

构建

Clone 这个仓库:

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

从克隆的代码中创建仓库,使用 Grammar-Kit 来生成 Parser 和 Lexer.

Then, click File | Settings | Build, Execution, Deployment | Compiler | Kotlin Compiler, 确保 "Target Kotlin version" 是 "1.8".

Then, click Build | Prepare Plugin Module 'julia-intellij' for deployment, and you'll see a jar appears at the project root.

For more information, see the official doc.

Contributing guidelines

You must

  1. Put all Nls 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 (this 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 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