Git Product home page Git Product logo

language-matlab-octave's Introduction

Atom.io Package for MATLAB and Octave Language Support

Version 1.0.0+ Major Update

Breaking change: as of v1 release August 2019, migrated MATLAB grammar source from TextMate to official MATLAB support mathworks/MATLAB-Language-grammar. This fixed many reported issues and improved MATLAB highlighting to match official github/linguist used on Github.com.

Octave grammar source remains unchanged.

Octave language support (v0.2.0+)

Octave grammar is converted from TextMate Bundle and remains unchanged from v0 to v1. Last update was v0.2. See: https://github.com/textmate/matlab.tmbundle

MATLAB language Support (v1.0.0+)

The syntax highlighting comes from the MathWorks TextMate grammar: https://github.com/mathworks/MATLAB-Language-grammar

Commit Hash: MATLAB-Language-grammar used for current grammar version

https://github.com/mathworks/MATLAB-Language-grammar/tree/40d9a0cd3b628f80cdcf948bbe1747a527ed5dd5

Screenshot Example: preview of included file highlighting-test.m_

language-matlab-octave-highlighting

Process for Updating MATLAB Grammar

Converting the MathWorks TextMate Grammar

  1. Clone, convert, and update the grammar:

    git clone [email protected]:mathworks/MATLAB-Language-grammar.git
    apm init --package language-matlab-temp --convert MATLAB-Language-grammar/Matlab.tmbundle/
    cp language-matlab-temp/grammars/matlab.cson language-matlab-octave/grammars/m.cson
  2. Apply an Atom-specific patch to the file language-matlab-octave/grammars/m.cson:

    • Change name: "meta.class.matlab" to name: "". This prevents atom from improperly coloring all class contents.
  3. Re-add function highlighting into updated language-matlab-octave/grammars/m.cson:

    • MATLAB-Language-grammar does not highlight MATLAB functions exactly like the TextMate grammar. If you view the diff of the newly generated language-matlab-octave/grammars/m.cson, you'll see the functions to add back.
    • For convenience, these are included as reference in language-matlab-octave/grammars/functions-reference.cson. Use this file to update patterns: and repository: sections of the new m.cson.

Testing/Verifying Grammar Changes

See the MATLAB file highlighting-test.m for MATLAB code snippets to test syntax highlighting changes. Supposing you've updated grammars/m.cson you can test your changes by doing the following:

cd your-repo-clone
apm remove language-matlab-octave
apm link .
atom .

Open highlighting-test.m and ensure that the syntax highlighting is as desired. If you fix something specific, consider adding a code snippet to that file locking down your change for future testing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.