miqh / atom-language-rust Goto Github PK
View Code? Open in Web Editor NEWRust language grammar support for Atom.
License: MIT License
Rust language grammar support for Atom.
License: MIT License
When using a triple slash ///
, the fold is set incorrectly. Try
/// Comment -| fold start
/// over -|
/// multiple -|
/// lines -|
pub fn new() -> Foo { -| fold end
1 + 1;
Foo {}
}
The actual function body is not inclued into the fold. This has other implications for other packages as well. See t9md/atom-vim-mode-plus/issues/819 for an example.
The rusty-dark-syntax theme has the following in its README:
There is a new package atom-language-rust (not to be mistaken with language-rust) that changes styles defined by language-rust and even forces specific colors for these styles, preventing theme authors from creating themes for Rust.
Basically it is not possible to use rusty-dark-syntax with atom-language-rust and get the correct colors shown. Perhaps something can be done to fix this?
Styling tensorflow-sys/build.rs
from the tensorflow/rust repository (commit cb891b9349006a86742c0d017f1ca380c225c8be) fails at line 36, making the remaining of the file as if it was a string.
See the screenshot:
Using atom-language-rust 0.12.0 on Atom 1.14.3 with default theme.
Thank you for your work!
It is good that that this package defines new styles to differentiate between function arguments. However, it should leave the choice of colors to the theme chosen by package users.
As it stands now, the default color chosen for arguments (blue) is completely out-of-place in my rusty-dark-syntax
theme. I was able to work around this by defining very specific style overrides with !important
css rule. However, this is bad for both of us:
There is additional issue of atom-language-rust
having different styles than language-rust
, however it is not as bad as this situation of broken themes.
When I use the «Toggle comments» function of Atom while having atom-language-rust actived, code is being put between //|/\*
and */
. It should use either //
like language-rust, or /*
and */
like when neither is activated.
Oftentimes, when I have a long where
clause in an impl
block, I like to put the where
on the next line after the impl
. While the Rust style guide's line wrapping section doesn't specifically mention where
clauses, this is in line with the wrapping style for things like functions, and occurs pretty frequently in the standard library code, so I consider it good style when appropriate.
However, the atom-language-rust
grammar doesn't recognise where
clauses beginning on the next line after an impl
or fn
. This throws off syntax highlighting for the where
clause, and also usually for the next line after it, as well.
Here are two screenshots demonstrating the difference:
I would have fixed this myself and submitted a pull request, but I'm not terribly familiar with how Atom grammars work. I'd be happy to work on fixing this issue if someone would be willing to give me some guidance.
Just upgraded to 0.4.0 from 0.3.x.
Atom Version: 1.5.3
System: "Fedora release
Thrown From: atom-language-rust package, v0.4.0
Failed to activate the atom-language-rust package
At Cannot read property 'add' of null
TypeError: Cannot read property 'add' of null
at Rust.activate (/home/andrey/.atom/packages/atom-language-rust/lib/rust.js:70:4)
at Package.module.exports.Package.activateNow (/usr/share/atom/resources/app.asar/src/package.js:181:20)
at /usr/share/atom/resources/app.asar/src/package.js:155:32
at Package.module.exports.Package.measure (/usr/share/atom/resources/app.asar/src/package.js:92:15)
at /usr/share/atom/resources/app.asar/src/package.js:148:26
at Package.module.exports.Package.activate (/usr/share/atom/resources/app.asar/src/package.js:145:34)
at PackageManager.module.exports.PackageManager.activatePackage (/usr/share/atom/resources/app.asar/src/package-manager.js:526:21)
at /usr/share/atom/resources/app.asar/node_modules/settings-view/lib/package-manager.js:385:60
at exit (/usr/share/atom/resources/app.asar/node_modules/settings-view/lib/package-manager.js:73:16)
at triggerExitCallback (/usr/share/atom/resources/app.asar/src/buffered-process.js:213:47)
at /usr/share/atom/resources/app.asar/src/buffered-process.js:227:18
at Socket.<anonymous> (/usr/share/atom/resources/app.asar/src/buffered-process.js:98:18)
at emitOne (events.js:82:20)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:469:12)
32x -0:34.2.0 core:move-down (atom-text-editor.editor.is-focused)
12x -0:27.9.0 core:move-up (atom-text-editor.editor.is-focused)
34x -0:26.3.0 core:move-down (atom-text-editor.editor.is-focused)
-0:14.2.0 settings-view:check-for-package-updates (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
{
"core": {},
"atom-language-rust": {
"colors": {}
}
}
# User
atom-language-rust, v0.4.0
# Dev
No dev packages
Hi, atom v1.13.0 have removed shadow dom and deprecated the use of ::shadow
and :host
.
Starting from Atom v1.13.0, the contents of atom-text-editor elements are no longer encapsulated within a shadow DOM boundary. This means you should stop using :host and ::shadow pseudo-selectors, and prepend all your syntax selectors with syntax--. To prevent breakage with existing style sheets, Atom will automatically upgrade the following selectors:
atom-text-editor::shadow .source.rust => atom-text-editor.editor .syntax--source.syntax--rust
atom-text-editor::shadow .source.rust .attribute => atom-text-editor.editor .syntax--source.syntax--rust .syntax--attribute
atom-text-editor::shadow .source.rust .attribute .string => atom-text-editor.editor .syntax--source.syntax--rust .syntax--attribute .syntax--string
atom-text-editor::shadow .source.rust .documentation => atom-text-editor.editor .syntax--source.syntax--rust .syntax--documentation
atom-text-editor::shadow .source.rust .lifetime => atom-text-editor.editor .syntax--source.syntax--rust .syntax--lifetime
atom-text-editor::shadow .source.rust .macro => atom-text-editor.editor .syntax--source.syntax--rust .syntax--macro
atom-text-editor::shadow .source.rust .markup => atom-text-editor.editor .syntax--source.syntax--rust .syntax--markup
atom-text-editor::shadow .source.rust .markup.bold => atom-text-editor.editor .syntax--source.syntax--rust .syntax--markup.syntax--bold
atom-text-editor::shadow .source.rust .markup.definition => atom-text-editor.editor .syntax--source.syntax--rust .syntax--markup.syntax--definition
atom-text-editor::shadow .source.rust .markup.heading => atom-text-editor.editor .syntax--source.syntax--rust .syntax--markup.syntax--heading
atom-text-editor::shadow .source.rust .markup.italic => atom-text-editor.editor .syntax--source.syntax--rust .syntax--markup.syntax--italic
atom-text-editor::shadow .source.rust .markup.link-text => atom-text-editor.editor .syntax--source.syntax--rust .syntax--markup.syntax--link-text
atom-text-editor::shadow .source.rust .markup.link-url => atom-text-editor.editor .syntax--source.syntax--rust .syntax--markup.syntax--link-url
atom-text-editor::shadow .source.rust .markup.quote => atom-text-editor.editor .syntax--source.syntax--rust .syntax--markup.syntax--quote
atom-text-editor::shadow .source.rust .markup.strikethrough => atom-text-editor.editor .syntax--source.syntax--rust .syntax--markup.syntax--strikethrough
atom-text-editor::shadow .source.rust .markup.raw => atom-text-editor.editor .syntax--source.syntax--rust .syntax--markup.syntax--raw
atom-text-editor::shadow .source.rust .markup.symbol => atom-text-editor.editor .syntax--source.syntax--rust .syntax--markup.syntax--symbol
atom-text-editor::shadow .source.rust .parameter => atom-text-editor.editor .syntax--source.syntax--rust .syntax--parameter
atom-text-editor::shadow .source.rust .operator, atom-text-editor::shadow .source.rust .symbol, atom-text-editor::shadow .source.rust .token => atom-text-editor.editor .syntax--source.syntax--rust .syntax--operator, atom-text-editor.editor .syntax--source.syntax--rust .syntax--symbol, atom-text-editor.editor .syntax--source.syntax--rust .syntax--token
Automatic translation of selectors will be removed in a few release cycles to minimize startup time. Please, make sure to upgrade the above selectors as soon as possible.
atom-language-rust
package.Restarting Atom and reinstalling the package (as suggested the conversation for #1) brought no effect. The bug remains.
Atom Version: 1.9.8
System: linux 4.7.0-1-ARCH
Thrown From: atom-language-rust package, v0.8.1
Atom was installed via pacman
from the community
repository.
The atom-language-rust
package was installed using the Settings → Install menu.
Failed to activate the atom-language-rust package
Path must be a string. Received null
TypeError: Path must be a string. Received null
at assertPath (path.js:7:11)
at extname (path.js:1433:5)
at LessCache.module.exports.LessCache.getCachePath (/usr/lib/atom/node_modules/less-cache/lib/less-cache.js:178:44)
at LessCache.module.exports.LessCache.putCachedCss (/usr/lib/atom/node_modules/less-cache/lib/less-cache.js:238:27)
at LessCache.module.exports.LessCache.cssForFile (/usr/lib/atom/node_modules/less-cache/lib/less-cache.js:287:12)
at LessCompileCache.module.exports.LessCompileCache.cssForFile (/usr/lib/atom/src/less-compile-cache.js:40:25)
at Rust.readDefaultColors (/home/edubenetskiy/.atom/packages/atom-language-rust/lib/rust.js:132:29)
at Rust.activate (/home/edubenetskiy/.atom/packages/atom-language-rust/lib/rust.js:79:10)
at Package.module.exports.Package.activateNow (/usr/lib/atom/src/package.js:183:20)
at /usr/lib/atom/src/package.js:156:32
at Package.module.exports.Package.measure (/usr/lib/atom/src/package.js:92:15)
at /usr/lib/atom/src/package.js:149:26
at Package.module.exports.Package.activate (/usr/lib/atom/src/package.js:146:34)
at PackageManager.module.exports.PackageManager.activatePackage (/usr/lib/atom/src/package-manager.js:530:21)
at /usr/lib/atom/src/package-manager.js:334:19
at /usr/lib/atom/src/config.js:631:20
at Function.module.exports.Emitter.simpleDispatch (/usr/lib/atom/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/usr/lib/atom/node_modules/event-kit/lib/emitter.js:125:28)
at Config.module.exports.Config.emitChangeEvent (/usr/lib/atom/src/config.js:816:29)
at Config.module.exports.Config.setRawValue (/usr/lib/atom/src/config.js:608:19)
at Config.module.exports.Config.set (/usr/lib/atom/src/config.js:227:14)
at Config.module.exports.Config.removeAtKeyPath (/usr/lib/atom/src/config.js:377:12)
at Package.module.exports.Package.enable (/usr/lib/atom/src/package.js:77:26)
at PackageManager.module.exports.PackageManager.enablePackage (/usr/lib/atom/src/package-manager.js:161:14)
at HTMLButtonElement.<anonymous> (/usr/lib/atom/node_modules/settings-view/lib/package-card.js:324:27)
at HTMLButtonElement.dispatch (/usr/lib/atom/node_modules/jquery/dist/jquery.js:4435:9)
at HTMLButtonElement.elemData.handle (/usr/lib/atom/node_modules/jquery/dist/jquery.js:4121:28)
-1:23 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
-1:23 core:cancel (atom-text-editor.editor.mini.is-focused)
-1:21.9.0 symbols-view:go-to-declaration (atom-text-editor.editor.is-focused)
-1:19.9.0 command-palette:toggle (atom-text-editor.editor.is-focused)
-1:15.8.0 core:confirm (atom-text-editor.editor.mini.is-focused)
-1:15.8.0 symbols-view:go-to-declaration (atom-text-editor.editor)
-1:15.1.0 core:move-right (atom-text-editor.editor.is-focused)
-1:14 command-palette:toggle (atom-text-editor.editor.is-focused)
-1:12.2.0 core:backspace (atom-text-editor.editor.mini.is-focused)
11x -1:10.2.0 core:move-down (atom-text-editor.editor.mini.is-focused)
-1:07.3.0 core:select-all (atom-text-editor.editor.mini.is-focused)
-1:05.0 core:confirm (atom-text-editor.editor.mini.is-focused)
-1:05.0 rustfmt:format (atom-text-editor.editor)
-1:03.1.0 command-palette:toggle (atom-text-editor.editor.is-focused)
-1:01.4.0 core:confirm (atom-text-editor.editor.mini.is-focused)
-1:01.4.0 racer:find-definition (atom-text-editor.editor)
{
"core": {},
"atom-language-rust": {
"colors": {}
}
}
# User
atom-language-rust, v0.8.1 (inactive)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.51.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.43.0 (inactive)
base16-tomorrow-dark-theme, v1.1.0 (inactive)
base16-tomorrow-light-theme, v1.1.1 (inactive)
one-dark-ui, v1.3.2 (active)
one-light-ui, v1.3.2 (inactive)
one-dark-syntax, v1.2.0 (active)
one-light-syntax, v1.2.0 (inactive)
solarized-dark-syntax, v1.0.2 (inactive)
solarized-light-syntax, v1.0.2 (inactive)
about, v1.5.2 (active)
archive-view, v0.61.1 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.11.1 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.31.0 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (active)
background-tips, v0.26.0 (active)
bookmarks, v0.41.0 (active)
bracket-matcher, v0.82.1 (active)
command-palette, v0.38.0 (active)
deprecation-cop, v0.54.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.39.0 (active)
fuzzy-finder, v1.3.0 (active)
git-diff, v1.1.0 (active)
find-and-replace, v0.198.0 (active)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.1 (active)
image-view, v0.58.0 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.0 (active)
link, v0.31.1 (inactive)
markdown-preview, v0.158.0 (active)
metrics, v0.53.1 (active)
notifications, v0.64.1 (active)
open-on-github, v1.2.0 (inactive)
package-generator, v1.0.0 (inactive)
settings-view, v0.238.2 (active)
snippets, v1.0.2 (active)
spell-check, v0.67.1 (active)
status-bar, v1.4.1 (active)
styleguide, v0.46.0 (active)
symbols-view, v0.113.0 (active)
tabs, v0.98.1 (active)
timecop, v0.33.1 (active)
tree-view, v0.208.0 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.34.0 (active)
whitespace, v0.32.2 (active)
wrap-guide, v0.38.1 (active)
language-c, v0.52.1 (active)
language-clojure, v0.21.0 (active)
language-coffee-script, v0.47.0 (active)
language-csharp, v0.12.1 (active)
language-css, v0.36.2 (active)
language-gfm, v0.86.0 (active)
language-git, v0.13.0 (active)
language-go, v0.42.0 (active)
language-html, v0.44.1 (active)
language-hyperlink, v0.16.0 (active)
language-java, v0.22.0 (active)
language-javascript, v0.119.0 (active)
language-json, v0.18.0 (active)
language-less, v0.29.3 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.35.0 (active)
language-php, v0.37.0 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.0 (active)
language-ruby, v0.68.5 (active)
language-ruby-on-rails, v0.25.0 (active)
language-sass, v0.52.0 (active)
language-shellscript, v0.22.3 (active)
language-source, v0.9.0 (active)
language-sql, v0.21.1 (active)
language-text, v0.7.1 (active)
language-todo, v0.28.0 (active)
language-toml, v0.18.0 (active)
language-xml, v0.34.8 (active)
language-yaml, v0.26.0 (active)
# Dev
No dev packages
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.