jude

Julia Development Extensions

jamesdanged

4,638

2

0.2.9

MIT

GitHub

This package provides the following services:

Jude

JUlia Development Extensions

Jude statically parses your codebase in javascript to provide IDE like capabilities for Atom:

In the future, this may include tools to find usages of a function, limited static type checking, and some refactoring/renaming.

Jude demo gif

Getting started

julia should be on your PATH. You can customize the exact path to julia in the Jude package settings.

Autocomplete is triggered by typing. Only names available in the scope (eg try block, for loop, function scope) are shown. To get function signatures, press ctrl-space after the ...(. You can tab through the arg list.

Jump to defintion is also triggered by ctrl-space when the cursor is on any word. You can jump to function definitions, type defintions, or variable declarations for files in your workspace. You can even jump to some function declarations in files not in your workspace, such as in the base library. Your jump history is tracked, and you can go back/forward using ctrl-alt-left/ctrl-alt-right.

Syntax errors are highlighted as lint warnings. Jude shows these when it cannot parse your code or resolve a name. You can customize the linter to hide the error message panel that pops up at the bottom of the screen by going to the Linter package options and unselecting Show Error Panel.

How it works

Jude performs a full syntax parse of all the Julia files in your workspace in Javascript, and does scoping analysis statically to resolve names. Names are resolved specific to the scope where they are used, not using fuzzy matching over the entire project. Your project files are not loaded into Julia or executed to run the analysis.

Jude reparses some or all of your code as you type. This is done in <50 ms for small to medium sized codebases, especially if it is broken into modules. If you are editing a file that has no "module" declarations (maybe it is just included in another file that does), the reparse can be <5 ms.

This is a parser written in Javascript (actually Typescript) separate from the Julia compiler, so there are some gaps in its coverage. Currently, most Julia syntax should be parsed correctly, but this is a work in progress! Please help make it better by reporting any parsing problems or even submitting pull requests. The goal is not necessarily to be a full syntax checker for Julia, but just to be able to resolve names properly. Many errors are shown in the Chromium Dev Tools console, which can be opened with the command Window: Toggle Dev Tools.

For imported modules that are not in the workspace, Jude starts up a short lived child Julia process and queries it for the module contents. It will import type definitions, function signatures, macros, and variables at the module level. During the first run with Jude newly installed, it may take a minute to retrieve the Base library and any modules you have imported into your files. Afterwards, the results are cached. The path to Julia is configurable in the Jude options.

Limitations

Julia is a very flexible language, but for Jude to provide these capabilities, some restrictions are in place.

Parsing should be very fast, but if it starts to cause noticable slow down in the GUI, you can reduce the parsing intervals by changing the lint delay in the Linter package (Lint As You Type Interval, which defaults to 300 ms).

Julia is a dynamic language, so autocomplete currently only works for functions/types/variables, not for fields on types. This is because the type of the object often cannot be determined statically, so the fields are unknown. There is no fuzzy matching currently for fields. In the future, there may be some flow analysis that allows types to be inferred such as from function arg list signatures or type assertions. If Julia eventually allows return type declarations, these can be leveraged too.

Known issues

Roadmap