GithubHelp home page GithubHelp logo

vscode-astyle's People

Contributors

ahogen avatar davidritter avatar ensky avatar gama11 avatar kirozen avatar welkineins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-astyle's Issues

use specific astyle option file instead of “cmd_options” in workspace if had set "astyle.astylerc"

"astyle.astylerc": "${workspaceFolder}/.vscode/astylerc"

    "astyle.cmd_options": [
        // 使用kr风格
        "--style=kr",
        // 将tab转为4个空格
        "--convert-tabs",
        // 对于控制流程如果是当行的加入花括号
        "--add-braces",
        // 缩进case标签
        "--indent-switches",
        // 缩进标签
        "--indent-labels",
        // 缩进预处理
        "--indent-preprocessor",
        //缩进一行的注释
        "--indent-col1-comments",
        //缩进命名空间
        "--indent-namespaces",
        //控制关键字 后添加空格
        "--pad-header",
        // 操作符号添加空格
        "--pad-oper",
        //一行的块代码添加花括号
        "--add-brackets",
        //对于一行的代码保持不换行
        "--keep-one-line-blocks",
        // 缩进4个空格
        "--indent=spaces=4",
        "--min-conditional-indent=0",
        "--max-instatement-indent=40",
        //块之间添加空行
        "--break-blocks",
        //括号内的参数和括号不添加空格
        "--unpad-paren",
        // 指针符号贴近变量名
        "--align-pointer=name",
        // 引用符号贴近变量名
        "--align-reference=name"
        // 模式设置为C
        //"--mode=c"
]

when set the option cmd and option file at the same time. astyle format by option cmd ,
i thinks it should format by the stylerc rules

--dry-run isn't supported

Astyle 3.0 supports the --dry-run option to report on changes without actually applying them.
http://astyle.sourceforge.net/astyle.html#_dry-run

However, in Visual Studio there is no option in the Astyle config UI to select it, and when I manually add it to the parameter list text I get an error, when run,
130: Invalid Artistic Style options: dry-run

Cannot process the input stream

If I try to format a C file I get:

"Failed to launch astyle. (reason: "Cannot process the input stream,,Artistic Style has terminated, Error: Command failed: astyle Cannot process the input stream Artistic Style has terminated ")"

Info:
astyle version 2.03
vsc version 1.23.1
Node version 7.9.0

User config:
"C_Cpp.formatting": "Disabled",

Astyle is in the path and it works...

Thanks for the help.

not work in an unsave new file

when I create an new file, change language mode to java, write java code in it. then i format it without save to disk, it does not work. certainly it works if i save it..

Different output with cmd and vscode

Input file:

int f1()
{
   return 0;
}
// two empty lines


int f2()
{
   return 0;
}
// one empty line

int f3()
{
   return 0;
}

SHIFT+ALT+F:

int f1()
{
   return 0;
}
// two empty lines

int f2()
{
   return 0;
}
// one empty line

int f3()
{
   return 0;
}

astyle f.cpp:

int f1()
{
    return 0;
}
// two empty lines


int f2()
{
    return 0;
}
// one empty line

int f3()
{
    return 0;
}

There is no astyle config file.
Differences are:

  • Tab size (ok, i think the 3 spaces tabs come from the vscode settings)
  • Empty Line removed. Where does this come from?

VSCode About:
Version: 1.33.1 (system setup)
Commit: 51b0b28134d51361cf996d2f0a1c698247aeabd8
Date: 2019-04-11T08:27:14.102Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.16299

Failed to launch astyle on format

Failed to launch astyle. (reason: "Cannot open options file ${workspaceRoot}/astylerc")

Using vscode 0.6.1 and just upgraded to Astyle extension 0.6.1.

It works if I changed to the full path. i.e /Users/XXX/Project/astylerc.

Request for Command Line Options

I would like the ability to use the command line to pass options to astyle.
This could be done instead of or in addition to using the options file.

Thanks

astyle selected code

Is it possible to only run astyle on selected code? The only option in my context menu is to do the entire file. Is there any possibility of this feature being added?

Allow for use with arbitrary languages

AStyle does a passable job of formatting (simple) Haxe code, and I'd imagine that's the case for a lot of other languages that are not part of the officially supported / listed ones too. However, it seems like the extension is currently restricted to those.

It would be nice to have a simple setting for this, like:

"astyle.additional_languages": ["Haxe"]

asytle configuration do not show up in Settings

Just installed asytle extension. Cannot find the configuration.
grafik

VSCode:
Version: 1.33.1 (system setup)
Commit: 51b0b28134d51361cf996d2f0a1c698247aeabd8
Date: 2019-04-11T08:27:14.102Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.16299

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.