xgdapg / atom-rustfmt Goto Github PK
View Code? Open in Web Editor NEWFormat rust source code with rustfmt
License: MIT License
Format rust source code with rustfmt
License: MIT License
[Enter steps to reproduce:]
Atom: 1.34.0 x64
Electron: 2.0.16
OS: Microsoft Windows 10 Pro
Thrown From: rustfmt package 0.1.3
Failed to activate the rustfmt package
At Arguments to CompositeDisposable.add must have a .dispose() method
TypeError: Arguments to CompositeDisposable.add must have a .dispose() method
at assertDisposable (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:1175864)
at CompositeDisposable.add (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:1176832)
at Object.activate (/packages/rustfmt/lib/rustfmt.js:22:28)
at Package.activateNow (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:3017814)
at measure (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:3017226)
at Package.measure (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:3014857)
at activationPromise.activationPromise.Promise (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:3017086)
at new Promise (<anonymous>)
at Package.activate (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:3017029)
at PackageManager.activatePackage (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:382643)
at ~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:899185
at r (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:11:893791)
at o (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:14:1032547)
at ChildProcess.n.process.on.e (~/AppData/Local/atom/app-1.34.0/resources/app/static/<embedded>:14:1032753)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
-2:05.7.0 command-palette:toggle (input.hidden-input)
-1:14.8.0 editor:consolidate-selections (input.hidden-input)
-1:14.8.0 core:cancel (input.hidden-input)
-1:14 editor:scroll-to-cursor (input.hidden-input)
2x -1:08.5.0 key-binding-resolver:toggle (input.hidden-input)
-1:06.8.0 settings-view:open (input.hidden-input)
-1:00.7.0 core:confirm (input.hidden-input)
atom-overtype-mode 0.4.0
autosave-onchange 1.5.1
block-comment 0.4.3
color-picker 2.3.0
column-select 1.0.1
css-declaration-sorter 1.2.3
ctrl-dir-scroll 0.2.5
file-templates 0.2.0
highlight-line 0.12.0
justright-latte-syntax 0.1.0
justright-latte-ui 0.1.0
language-batchfile 0.7.5
language-ini 1.20.0
language-rust 0.4.12
linter-rust 1.0.1
markdown-preview-plus 3.7.1
multi-cursor-plus 1.2.0
pigments 0.40.2
process-palette 0.17.0
project-manager 3.3.6
rustfmt 0.1.3
sort-lines 0.18.0
sync-settings 0.8.6
tree-view-auto-collapse 1.0.2
tree-view-sort 0.11.1
[Enter steps to reproduce:]
Atom: 1.18.0 x64
Electron: 1.3.15
OS: Ubuntu 16.04.2
Thrown From: rustfmt package 0.1.3
Uncaught Error: spawn ENOTDIR
At /usr/share/atom/resources/app/src/buffered-process.js:392
Error: spawn ENOTDIR
at exports._errnoException (util.js:1026:11)
at ChildProcess.spawn (internal/child_process.js:313:11)
at Object.exports.spawn (child_process.js:392:9)
at BufferedProcess.spawn (/usr/share/atom/resources/app/src/buffered-process.js:321:63)
at BufferedProcess.start (/usr/share/atom/resources/app/src/buffered-process.js:127:20)
at new BufferedProcess (/usr/share/atom/resources/app/src/buffered-process.js:112:18)
at Object.format (/packages/rustfmt/lib/rustfmt.js:45:9)
at /packages/rustfmt/lib/rustfmt.js:26:22
at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
at TextBuffer.module.exports.TextBuffer.saveAs (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:1142:33)
at TextBuffer.module.exports.TextBuffer.save (/usr/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:1108:25)
at TextEditor.module.exports.TextEditor.save (/usr/share/atom/resources/app/src/text-editor.js:925:32)
at Pane.module.exports.Pane.saveItem (/usr/share/atom/resources/app/src/pane.js:780:24)
at Pane.saveItem (/usr/share/atom/resources/app/src/pane.js:3:65)
at Pane.module.exports.Pane.saveActiveItem (/usr/share/atom/resources/app/src/pane.js:763:25)
at Workspace.saveActivePaneItem (/usr/share/atom/resources/app/src/workspace.js:1548:46)
at atom-workspace.core:save (/usr/share/atom/resources/app/src/register-default-commands.js:236:38)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:265:35)
at /usr/share/atom/resources/app/src/command-registry.js:3:65
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:610:22)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:401:28)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/usr/share/atom/resources/app/src/window-event-handler.js:100:42)
at HTMLDocument.<anonymous> (/usr/share/atom/resources/app/src/window-event-handler.js:3:65)
-1:26.1.0 core:save (input.hidden-input)
-1:19.2.0 intentions:highlight (input.hidden-input)
-1:19 core:save (input.hidden-input)
-0:40.6.0 intentions:highlight (input.hidden-input)
14x -0:40.3.0 core:save (input.hidden-input)
-0:27.5.0 intentions:highlight (input.hidden-input)
-0:27.1.0 core:copy (input.hidden-input)
-0:25.6.0 editor:newline (input.hidden-input)
-0:25.1.0 intentions:highlight (input.hidden-input)
-0:24.8.0 core:paste (input.hidden-input)
3x -0:24.2.0 core:move-left (input.hidden-input)
8x -0:23.2.0 core:backspace (input.hidden-input)
-0:21.4.0 intentions:highlight (input.hidden-input)
-0:21.2.0 core:save (input.hidden-input)
-0:03.1.0 intentions:highlight (input.hidden-input)
-0:02.9.0 core:save (input.hidden-input)
autocomplete-racer 0.1.3
build-cargo 2.0.0
busy-signal 1.4.3
hyperclick 0.1.3
intentions 1.1.5
language-rust 0.4.11
linter 2.2.0
linter-rust 0.8.0
linter-ui-default 1.6.3
racer 0.20.0
rustfmt 0.1.3
This seems to have path to rustfmt
hardcoded and no way to change it.
rustfmt
should be detected or user should be given an option to provide own path.
Default value for rustfmt
's executable is /usr/local/bin/rustfmt
which prevents retrieving it from the PATH
making the error message very unclear:
Make sure
/usr/local/bin/rustfmt
is installed and on yourPATH
I propose to simply default to rustfmt
, allowing most users to use the package without configuration since rustfmt
is generally in the path but not forcibly in /usr/local/bin
.
Sometimes when I save a buffer of rust code and rustfmt formats it, my cursor jumps to the top of the buffer. It also seems to insert an undo history item where the file is completely blank, so if I undo through a save I have to undo an extra time to get the content back.
[Enter steps to reproduce below:]
Atom Version: 1.7.3
System: Mac OS X 10.11.4
Thrown From: rustfmt package, v0.1.2
Uncaught Error: spawn EACCES
At /Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:262
Error: spawn EACCES
at exports._errnoException (util.js:856:11)
at ChildProcess.spawn (internal/child_process.js:298:11)
at Object.exports.spawn (child_process.js:374:9)
at BufferedProcess.module.exports.BufferedProcess.spawn (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:190:44)
at new BufferedProcess (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:52:14)
at Object.format (/Users/xiongbingchao/.atom/packages/rustfmt/lib/rustfmt.js:45:9)
at /Users/xiongbingchao/.atom/packages/rustfmt/lib/rustfmt.js:26:22
at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
at TextBuffer.module.exports.TextBuffer.saveAs (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1113:27)
at TextBuffer.module.exports.TextBuffer.save (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1083:19)
at TextEditor.module.exports.TextEditor.save (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:660:26)
at Pane.module.exports.Pane.saveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:718:18)
at Pane.module.exports.Pane.saveActiveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:701:19)
at Workspace.module.exports.Workspace.saveActivePaneItem (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:684:35)
at atom-workspace.commandRegistry.add.core:save (/Applications/Atom.app/Contents/Resources/app.asar/src/register-default-commands.js:214:32)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:580:16)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:388:22)
at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:98:36)
at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)
-8:26.5.0 core:save (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
4x -1:32.7.0 core:undo (atom-text-editor.editor.is-focused)
2x -0:51.1.0 core:backspace (atom-text-editor.editor.is-focused)
4x -0:49.8.0 core:undo (atom-text-editor.editor.is-focused)
-0:47.7.0 core:save (atom-text-editor.editor.is-focused)
2x -0:43.2.0 core:backspace (atom-text-editor.editor.is-focused)
-0:42.1.0 core:save (atom-text-editor.editor.is-focused)
-0:40 core:copy (atom-text-editor.editor.is-focused)
2x -0:38.8.0 core:paste (atom-text-editor.editor.is-focused)
-0:36.3.0 core:save (atom-text-editor.editor.is-focused)
-0:08.6.0 core:paste (atom-text-editor#rustfmt.binPath.editor.mini.is-focused)
6x -0:07.7.0 core:backspace (atom-text-editor#rustfmt.binPath.editor.mini.is-focused)
-0:03.9.0 core:confirm (atom-text-editor#rustfmt.binPath.editor.mini.is-focused)
-0:01.0 core:save (atom-text-editor.editor.is-focused)
{
"core": {
"themes": [
"one-light-ui",
"one-light-syntax"
]
},
"rustfmt": {
"binPath": "/usr/local/bin"
}
}
# User
build, v0.60.0
build-cargo, v0.14.0
language-rust, v0.4.6
linter, v1.11.4
linter-shellcheck, v1.2.0
rustfmt, v0.1.2
# 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.