Attaching Wolfram Packages as Libraries

When your Wolfram Language package uses functions from a different package, the symbols from the external package will be displayed as unknown in the editor and marked with a warning. To give a concrete example, the IGraphM package of Szabolcs Horvát depends on his LTemplate package. After opening the IGraph package and setting up a module for it, you will find that function calls to symbols of the LTemplate package will be highlighted with a warning.

New File

This is because symbols like LFun or LClass are unknown as they are defined in the LTemplate package. You can attach the LTemplate package as an external library in the Dependencies tab under File | Project Structure… | Modules by pressing the + button on the right. Then you can select the directory of the LTemplate source-code and IDEA will index all Wolfram Language files it finds there.

New File

After that, IDEA will find the definitions of the LTemplate package and mark them as underlined to indicate that these functions belong to an external library. External functions will pop up for auto-completion, you can navigate to them by pressing Ctrl+B, and you can even lookup their usage message through the Quick Documentation shortcut.

New File

Currently, the Wolfram Language plugin indexes package files by searching for usage messages. Therefore, as long as your symbol has a sym::usage attached to it, the indexer will find it. From the semantic viewpoint of Mathematica contexts and package-private symbols, this is not correct. However, in practise it has proven to be a reliable and fast way to indicate a symbol should be exported.