Home

Awesome

Modelica language support in Atom

Adds syntax highlighting and snippets to Modelica files in Atom.

The grammar was partially created using an automatic conversion from the Modelica grammar for Sublime Text by Boris Chumichev.

Snippets

Current code shortcuts (type given keyword + tab):

keyworddescription
/*for block comments
blockfor block
classfor class block
forfor a for loop block
functionfor function block
iffor a conditional block
modelfor model block
packagefor package block
recordfor record block
whenfor a when event block
whilefor a while loop block

Toggling annotations

Two commands are available to toggle folding of individual annotations or all annotations:

Documentation view

The HTML documentation in a file can be shown with the toggledocview command.

Example

Here is an example showing syntax highlighting, toggling annotations, and documentation view.

language-modelica in action

Key mappings

There are no default keymappings included. Here is one suggestion:

'atom-text-editor[data-grammar="source modelica"]:not([mini])':
  'tab':          'language-modelica:toggleannotations'
  'shift-tab':    'language-modelica:toggleallannotations'
  'ctrl-shift-j': 'language-modelica:toggledocview'

toggleannotations is a "DWIM" function, meaning if the cursor is not on the first line of an annotation, the keypress passes through to the next key mapping assigned. So, when assigned to TAB as above, TAB will still normally work right for indentation and for completion of snippets and other uses.