Giter Club home page Giter Club logo

atom-language-rust-1's Introduction

atom-language-rust

apm ci

An Atom package that provides Rust language grammar to facilitate semantic syntax highlighting for a better code writing experience.

Usage

With Atom open, this package can be easily installed by opening up Settings View, clicking on the Install tab that appears, searching for this package name (i.e. atom-language-rust) and clicking the Install button in the corresponding package result.

If you prefer installation via console, enter the following command:

apm install atom-language-rust

Remember to stay updated with the latest version, which might contain fixes or even new shinier features.

Package Settings

Once this package is installed, use the Settings button to access its configuration options.

Use the Additional Styles option to enable or disable the styles provided by this package. If you wish to override the default colours provided for any of the Rust language constructs listed, simply provide a colour value. It is worthwhile noting that colour values can be in CSS format.

Motivation

Development of this package started due to lack of updates and fixes being contributed to another package I was originally using to write Rust code in Atom. As Rust is still a flourishing language, I endeavour to keep this package updated with any notable changes to the language.

Features

  • Custom Syntax Highlighting: There are many additional language constructs in Rust that are not semantically covered by standard grammar scopes for styling various pieces of syntax. Consequently, a limited colour palette makes it difficult for easily distinguishing between language constructs. This package adds a whole bunch of custom grammar scopes, which provides the option of assigning custom colours to functionally similar groups of language constructs. The best part is that colour configurations should be reflected immediately and do not require Atom to be restarted!
  • Markdown: Since Rust documentation blocks are written in Markdown, this package also includes custom grammar scopes, based loosely off GitHub flavoured Markdown, to style Markdown constructs. This is an attempt to make documentation appearing alongside code more pleasant to read.

See CHANGELOG for more information.

Contributing

See CONTRIBUTING.

Q&A

Why is ... not given a grammar scope for styling?

If the item in question is being highlighted in one pattern of code and not in another then it is likely a bug. I would very much appreciate these being reported so that they can be fixed up.

For those not familiar with how most language grammar packages work in Atom, they leverage the first-mate package in order to provide grammar scopes for syntax themes to use. In a nutshell, this package simply takes a whole bunch of grammar match rules (i.e. regular expressions) and applies it to a source file. I must stress that this is not the same as a native language parser. As such, there are some things that are extremely difficult (or quite plainly impossible in my opinion) to write match rules for. An example of this would be highlighting the names of all user-defined traits, wherever they occur. Without a Rust language parser module, such a task would be madness.

Why are the styles set through this package not taking effect?

This package is at the mercy of any other package in the Atom ecosystem that decides to hijack grammar styles. I surmise the majority of these offenders would be syntax theme packages.

At present, there is not any option to force precedence of the styles contained in this package, but I may have a work around which might be rolled into a future release.

Why does this grammar package even offer styling?

In short, convenience.

As far as I am aware, Atom offers no guidance on scope names that grammar packages are allowed to define. Consequently, this makes the lives of syntax theme package creators difficult. The onus is on them to ensure their package styles cover all custom scope names defined by a particular language grammar.

By providing styles along with this package, syntax theme packages that do not explicitly style all provided scope names will still have syntax highlighting for Rust language constructs not covered. This is the aforementioned convenience. I do not expect every syntax theme package out there to account for the Rust language.

Styles included in this package are enabled by default. If your syntax theme package of choice covers the grammar of this package, you can opt out of the included styles by disabling them via package settings.

atom-language-rust-1's People

Contributors

miqh avatar moritzkn avatar

Watchers

 avatar  avatar

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.