Description:
Differential equations, defined in Python strings, are at the core of Brian’s model descriptions. They use a language familiar to computational neuroscientists, and closely follow the way that languages are described in scientific articles. Defining these equations in strings has the advantage that these descriptions are very concise, and can be read as mathematical equations, and not as programming code. The fact that equations are “just strings” does have disadvantages as well, though: from the point of view of a code editor, they are simply text and do not benefit from helpful features such as syntax highlighting, autocompletion, or syntax checks.
The aim of this project is to improve this situation by writing a Brian-specific “Language Server extension” and syntax highlighting rules, that provides these features for Brian equations embedded in a Python script. The Language Server Protocol (LSP) has been created by Microsoft and is used to provide advanced editing features to editors such as Visual Studio Code, but it is now supported by a large number of editors.
The concrete goals of this projects (details also depending on whether selected as a 175h or 350h project):
- Syntax highlighting for equations via a custom TextMate grammar
- Implementation of an LSP plugin for Visual Studio Code, and an LSP server implementation, to provide features such as autocompletion, hover information, jump to definition, etc.
- The above plugin will first made to work on external files with a dedicated file extension, and then for strings within a Brian script (as an “embedded language”).
Note that the LSP client plugin has to be written as JavaScript/TypeScript code, whereas the server implementation can be written either using JavaScript/TypeScript as well, or in Python.
Skill level: intermediate
Required skills: JavaScript/TypeScript, JSON, asynchronous programming, basic knowledge of grammars/regular expressions.
Time commitment: Flexible, 175h or 350h depending on scope
Lead mentor: Marcel Stimberg (@mstimberg on neurostars), Ben Evans