Changed rustfmt beautifier to use context.filePath
This commit is contained in:
parent
458fdb62e2
commit
5cee65780f
|
@ -15,11 +15,8 @@ module.exports = class Rustfmt extends Beautifier
|
||||||
Rust: true
|
Rust: true
|
||||||
}
|
}
|
||||||
|
|
||||||
beautify: (text, language, options) ->
|
beautify: (text, language, options, context) ->
|
||||||
editor = atom.workspace.getActivePaneItem()
|
cwd = context.filePath and path.dirname context.filePath
|
||||||
buffer = editor.getBuffer?()
|
|
||||||
filePath = buffer.getPath?()
|
|
||||||
cwd = if filePath then path.dirname filePath else undefined
|
|
||||||
program = options.rustfmt_path or "rustfmt"
|
program = options.rustfmt_path or "rustfmt"
|
||||||
help = {
|
help = {
|
||||||
link: "https://github.com/nrc/rustfmt"
|
link: "https://github.com/nrc/rustfmt"
|
||||||
|
|
Loading…
Reference in New Issue