Glavin001/atom-beautify

Language Request: R via Rfmt

開放

#1,139 建立於 2016年8月16日

 (1 則留言) (0 個反應) (0 位負責人)CoffeeScript (442 個分叉)batch import
add-beautifiergood first issuehelp wanted

倉庫指標

星標
 (1,503 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Description

Would it be possible to add a beautifier for R using the very excellent Rfmt (https://github.com/google/rfmt). I have tried to do this on my own using the attached language definition and beautifier can't get it to find the beautifier I made for R, even after a reload and restart of atom, essentially by copying the gofmt language definition.

One suggestion is that this should probably be run using a one-liner R invocation rather than the rfmt command-line argument, as the rfmt shell installation doesn't make the file accesible via /bin/sh.

Thanks!

-Jon Zelner

r.coffee: `module.exports = {

name: "R" description: "R" namespace: "r"

Supported Grammars

grammars: [ "R" ]

Supported extensions

extensions: [ "R" ]

options: []

} rfmt.coffee:"use strict" Beautifier = require('./beautifier')

module.exports = class Rfmt extends Beautifier name: "rfmt"

options: { R: true }

beautify: (text, language, options) -> @run("rfmt", [ @tempFile("input", text) ]) `

貢獻者指南