Giter VIP home page Giter VIP logo

m204-language-extension's Introduction

M204 Language Extension

This VS Code extension can be used to add syntax highlighting for M204 source code exported in .txt format for easier reading.

Features

Primarily includes highlighting for comments, variables, strings, and keywords.

Syntax Example

Requirements

  • VS Code installed
  • M204 procedures saved in .txt format

Install the extension

  • This extension is not yet published on the marketplace, so to start using the extension with Visual Studio Code: download this repo, copy it into your <user home>/.vscode/extensions folder and restart VS Code.
    • On a Mac, you may need to Command-shift-period to show hidden files to reveal your .vscode folder

Local Development

  1. Clone this repo
  2. Confirm you have npm installed
  3. In a terminal from the parent folder, run code M204-language-extension to open the extension code folder in VS Code
  4. In VS Code, open the Terminal and run npm install
  5. Hit F5 to debug the extension
  6. It opens a new VS Code window, with [Extension Development Host] in the header. Use this window to open your M204 .txt files and you should see the syntax highlighting

To make changes to the highlighting rules, you can edit the grammar defined in syntaxes/m204.tmLanguage.json. After saving your changes, if you are debugging, click the restart arrow (or Ctrl-Shift-F5) to see them reflected in your Dev Host window.

Release Notes

0.0.1

Initial release of the language extension

m204-language-extension's People

Contributors

erin-knight avatar erinknight242 avatar

Stargazers

Yogiraj Aradhye avatar

Watchers

Jimmy Bogard avatar Pedro Reys avatar Anne Epstein avatar  avatar Brandon Pugh avatar James Cloos avatar DS avatar Yogiraj Aradhye avatar  avatar

m204-language-extension's Issues

Comments are not highlighted if no leading whitespace

Comment lines starting with a '*' character are highlighted only when they have leading whitespace. If the asterisk is the first character on the line, the line is not highlighted.

The current regex detects zero or more leading whitespace characters, so I'm not sure why that part isn't working.

^\\s*\\*.*$

As a workaround, add a space at the start of a comment line if it isn't highlighting properly.

Variable name also highlights preceding parenthesis or comma

Variable names are defined to start with a %. For some reason though, even with the regex that should work to detect percent followed by one or more other valid characters:

(%[A-Za-z.\\d_]+)

It does not highlight them. To work around this, I included a preceding space, parenthesis, or comma in the match; but the result is that those characters get highlighted as part of the variable name if they exist.

Determine if the issue detecting the % symbol is a bug in the extension framework, or something we can work around. (it highlights properly with the simple regex above if the % is changed to a different special character, like a $, so that's why I think it might be a bug on Microsoft's end).

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.