Rust language support in Atom - LOOKING FOR MAINTAINER, see #144

Related tags

IDEs atom rust
Overview

Rust language support in Atom

Adds syntax highlighting and snippets to Rust files in Atom.

Install

Install the package language-rust in Atom (Preferences->Packages) or Atom's package manager from a shell:

$ apm install language-rust

Bugs

Grammar rules were written from scratch. They seem to work for most cases. However there are most certainly still a few cases that result in wrong syntax highlighting. Feel free to fix it and send a pull request, or open an issue to report it.

Links

  • Rust -- a safe, concurrent, practical language
  • Atom -- a hackable text editor for the 21st Century
Comments
  • made all rust operators tokenize as unit

    made all rust operators tokenize as unit

    this allows fonts like Fira Code and Monoid to render all rust operators with a ligature.

    “=>” is an operator used in matching, so it makes sense to include it

    enhancement 
    opened by flying-sheep 14
  • Add dyn keyword support

    Add dyn keyword support

    In rust 1.27 a new "dyn" keyword was introduced: https://blog.rust-lang.org/2018/06/21/Rust-1.27.html#dyn-trait This keyword is used in similar places as the mut keyword.

    enhancement 
    opened by Boereck 7
  • Need to improve the syntax highlighting in Rust

    Need to improve the syntax highlighting in Rust

    From @D101101 on January 20, 2016 17:1

    Syntax highlighting for Rust works well, but in some places it is clearly not completed yet. _2016-01-20_19-25-56 _2016-01-20_20-00-12

    Copied from original issue: Microsoft/vscode#2130

    question 
    opened by aeschli 5
  • Fixed an error when a comment is in an attribute.

    Fixed an error when a comment is in an attribute.

    Maintainers of Visual Studio Code asked me to open this PR. The PR in Visual Studio Code's repository: https://github.com/Microsoft/vscode/pull/19574

    It fixes the case:

    #[
    //
    /* */
    derive(Debug)]
    struct D {}
    
    bug 
    opened by KalitaAlexey 4
  • Support new integer type shorthand

    Support new integer type shorthand

    Rust has recently changed the integer type shorthand e.g 10i => 10is 10u => 10us

    See https://github.com/rust-lang/rfcs/pull/544#issuecomment-68760871

    enhancement 
    opened by gingermusketeer 4
  • Include backup files to language grammar

    Include backup files to language grammar

    Currently running rustfmt on a project produces a number of back up files *.rs.bk, which are your old rust files - rustfmt saves a cleaned up version to where the files were previously. I think it's a good idea to include rs.bk files into this grammar because it is still rust code.

    Is that possible to do in the grammar file itself?

    enhancement wontfix 
    opened by cbcoutinho 3
  • Avoid using the ambiguous \h shorthand character

    Avoid using the ambiguous \h shorthand character

    Depending on the regular expression engine used, \h does not always mean the same. With a PCRE engine, it matches white spaces, whereas, with a Oniguruma engine, it matches hexademical digit characters. Atom uses an Oniguruma engine, but github.com relies on a PCRE engine.

    opened by pchaigno 3
  • Use explicit count modifiers

    Use explicit count modifiers

    The construction {,n} in regular expressions is only supported by Oniguruma (which is used by TextMate). This TextMate bundle is used to highlight Rust code on github.com. However, github.com is using a PCRE-based engine for regexes.

    This pull request fixes that by using explicit count modifiers.

    opened by pchaigno 3
  • apm install language-rust fails

    apm install language-rust fails

    The following error message is returned: Unable to download https://www.atom.io/api/packages/language-rust/versions/0.4.7/tarball: 404

    I tried to install the package from the terminal and atom itself. Both fail.

    bug 
    opened by philippschladitz 3
  • Rust new error format

    Rust new error format

    I'm not sure if this has any impact on this plugin, but just in case - we're currently discussing making the switch to the new error format. If you're parsing the errors for the user, this may impact you.

    This change will also enable a json mode, if you want something more structured to parse.

    invalid 
    opened by jntrnr 3
  • please publish to npm

    please publish to npm

    Could you please publish the rust module to npm? We are using the same highlighting engine as Atom now, and would love to add your grammar:

    https://www.npmjs.com/package/polyglot-readme

    enhancement 
    opened by bcoe 3
  • Reference to char breaks highlighting

    Reference to char breaks highlighting

    image

    It appears that the contents of the char literal are incorrectly interpreted as a lifetime specifier with a spurious single quote on the end rather than a reference to a char.

    opened by lf- 0
  • Rust syntax highlighting breaks with raw strings in attributes

    Rust syntax highlighting breaks with raw strings in attributes

    From @ExoticMatter in https://github.com/microsoft/vscode/issues/95782

    VSCode Version: 1.44.2

    When raw string literals that use ##s appear in attributes in a Rust file, syntax highlighting breaks.

    Steps to Reproduce:

    1. Copy the following code into a Rust source file:
    #[cfg(feature = r#"""#)]
    const _: () = ();
    

    You will get something similar to the following:

    Screenshot_20200421_121815

    Does this issue occur when all extensions are disabled?: Yes

    opened by alexr00 1
  • update reserved keywords

    update reserved keywords

    Updates reserved keywords. Most are removals. For instance, proc was removed here

    List: https://doc.rust-lang.org/reference/keywords.html#reserved-keywords

    Proof: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=16ceeadb190d1804eab3cf5e8439c1bc (keywords are outdated at the playground as well, but the point is it compiles)

    opened by TyPR124 0
  • Support attributes in function definitions (parameter attributes)

    Support attributes in function definitions (parameter attributes)

    Now that Rust 1.39.0 supports attributes on parameters, the grammar should be updated to allow attributes when parsing function definitions.

    Example:

    #[attr(foo = "bar")]
    fn foo(#[attr(foo = "bar")] p: u32) {
        println!("hi");
    }
    

    Notice that "bar" is not highlighted as a string, which is an included pattern in the attribute grammar.

    Additionally, parsing breaks when the attribute string has characters that are interpreted as Rust tokens:

    #[attr(foo = "bar")]
    fn foo(#[attr(foo = "{")] p: u32) {
      println!("hi");
    }
    

    Note that here { is being matched as the opening bracket of the function, causing the closing " to be matched as the start of a string (the remainder of the function is considered to be in the string).

    opened by peterhuene 0
  • Rust's syntax highlighting breaks after `r#impl`

    Rust's syntax highlighting breaks after `r#impl`

    From @rustka in https://github.com/microsoft/vscode/issues/81085

    Rust's syntax highlighting breaks after using impl keyword as a raw identifier.


    • VSCode version: 1.38.1
    • OS version: Linux x64

    Steps to reproduce:

    1. Open the editor;
    2. Set language mode to Rust;
    3. Paste the following code:
    use r#impl;
    fn main() {}
    
    1. Comment the first line by prefixing it with //; 4.1. This failure could also be prevented by replacing r#impl with r#impl {}, but this is not the real solution for that case.
    2. The syntax highlighting works properly back again.

    P.S.: I did test it on Atom editor (v1.40.1) and it seemed to work correctly.

    opened by alexr00 1
Owner
Andreas Neuhaus
Software engineer (Rust, Ruby, JS, C), technology enthusiast, Mac user, self-employed, hobby photographer
Andreas Neuhaus
Experimental treesiter based language server, let's see how far this goes 😆.

tsls Tree-sitter based language server for general languages. Warning: It's in active development right now, and bug is expected. Features Go To Defin

Keyv Chan 16 Sep 11, 2022
Language Server Protocol (LSP) support for vim and neovim.

For legacy python implementation, see branch master. LanguageClient-neovim Language Server Protocol support for vim and neovim. More recordings at Upd

Junfeng Li 3.5k Dec 29, 2022
Fennel language server protocol (LSP) support.

fennel-language-server Fennel language server protocol (LSP) support. fennel-language-server is currently in a very early stage and unreliable. Use it

null 68 Dec 27, 2022
Better Rust/Cargo support for Flycheck

flycheck-rust — Flycheck for Rust This Flycheck extension configures Flycheck automatically for the current Cargo project. Setup Install from MELPA or

Flycheck 112 Sep 21, 2022
Rust extension for Visual Studio 2017 with RLS support

Rust support for Visual Studio 2017 Preview Adds language support for Rust to Visual Studio 2017. Supports: code completion goto definition find all r

Zoey Riordan 111 Aug 4, 2022
Racer support for Emacs

Racer for Emacs This is the official Emacs package for Racer. Table of Contents Racer for Emacs Completion Find Definitions Describe Functions and Typ

null 398 Nov 30, 2022
Racer support for Vim

Vim Racer Plugin This plugin allows vim to use Racer for Rust code completion and navigation. Installation Build / Install Racer Install using Pathoge

null 624 Dec 7, 2022
rust-analyzer is a modular compiler frontend for the Rust language

rust-analyzer is a modular compiler frontend for the Rust language. It is a part of a larger rls-2.0 effort to create excellent IDE support for Rust.

null 11.2k Jan 8, 2023
RustDT is an Eclipse based IDE for the Rust programming language:

Project website: http://rustdt.github.io/ As of 2017, RustDT is no longer actively maintained, see this blog post for more information. If you are int

null 351 Aug 20, 2022
The official Sublime Text 3 package for the Rust Programming Language

Rust Enhanced About This is a Sublime Text 3 package which supports Rust starting with version 1.0, it makes no attempt at supporting earlier incompat

The Rust Programming Language 704 Jan 7, 2023
Repository for the Rust Language Server (aka RLS)

Rust Language Server (RLS) The RLS provides a server that runs in the background, providing IDEs, editors, and other tools with information about Rust

The Rust Programming Language 3.6k Dec 30, 2022
Kakoune Language Server Protocol Client

Kakoune Language Server Protocol Client kak-lsp is a Language Server Protocol client for Kakoune implemented in Rust. Installation Note kak-lsp.toml d

null 495 Dec 17, 2022
An experimental proofreading and linting language server for markdown files ✍️

prosemd is an experimental proofreading and linting language server for markdown files. It aims to provide helpful and smart diagnostics when writing

Phil Pluckthun 132 Dec 14, 2022
AIDL Language Server Protocol (LSP) server

AIDL Language Server Protocol (LSP) server Experimental AIDL LSP server based on rust-aidl-parser. Features: diagnostics workspace symbols (Ctrl+T in

Benoit Walter 0 Jan 9, 2022
A LSP (Language Server Protocol) server for OpenSCAD.

openscad-LSP A LSP (Language Server Protocol) server for OpenSCAD. inspired by dzhu/openscad-language-server Tested with VSCode on Mac and Windows. Te

Leathong 20 Dec 15, 2022
impl LSP (Language Server Protocol) Server for librime

rime-ls 为 rime 输入法核心库 librime (的部分功能) 实现 LSP 协议, 从而通过编辑器的代码补全功能输入汉字. 项目还处在早期阶段, 各方面都非常不成熟. 目标是提供 rime + LSP 的通用解决方案, 在不同编辑器内实现与其他 rime 前端类似的输入体验. Feat

zilch40 55 Jan 22, 2023
A brand-new language server for Typst, plus a VS Code extension

Typst LSP A brand-new language server for Typst. Features Syntax highlighting, error reporting, code completion, and function signature help Compiles

Nathan Varner 414 Apr 17, 2023
WIP: Asynchronous Language Server Protocol framework

async-lsp Asynchronous Language Server Protocol (LSP) framework based on tower. ⚠️ This project serves as a proof-of-concept for LSP with middlewares

null 9 Apr 11, 2023
IDE tools for writing pest grammars, using the Language Server Protocol for Visual Studio Code, Vim and other editors

Pest IDE Tools IDE support for Pest, via the LSP. This repository contains an implementation of the Language Server Protocol in Rust, for the Pest par

pest 20 Apr 8, 2023