akof1314 / coolformat Goto Github PK
View Code? Open in Web Editor NEWCoolFormat Source Code Formatter
Home Page: http://blog.csdn.net/akof1314/article/details/5355948
CoolFormat Source Code Formatter
Home Page: http://blog.csdn.net/akof1314/article/details/5355948
我使用的是Notepad++6.9.1版本
把工程所有项目属性都修改为了 使用 Unicode 字符集
编译后把CoolFormatLib.dll,CoolFormatNppPlugin.dll 放到Notepad++ plugins目录
运行Notepad++,提示 This ANSI plugin is not compatible with your Unicode Notepad++
从https://sourceforge.net/projects/coolformat/files/Plugins/NPP/ 下载1.1版本
使用这个报同样错误。
我检查了所有项目,都是Unicode属性,不知为什么编译出来的dll会被Notepad++认为是Ansi的。
编译生成的插件,在Notepad++ unicode版本下不可用。需要unicode版本
求解
源代码: template ,经过“高亮到博客”之后 ,拷贝到新浪博客,预览是正常的,发布后变为
template <class T>
您好,我尝试单独编译了PhpFormatterLib模块,主函数改为直接调用phpTidy->TidyMain函数。
输入代码都会在node.cpp:151行报错,原因是last节点出现了一个空字符串(应该是Node节点生成出了bug),当访问[0]元素时出错,不知是哪里出了问题。下面是我测试的php样例代码:
parse.cpp当中语句debug("Token: %s", yytname[YYTRANSLATE(yychar)])输出 如下:
Token: T_OPEN_TAG String:
Token: $ String:
PS:为什么没看到 .l 以及 .y 文件呢 (⊙⊙?)
sublime3 安装此插件后其他都很好用,但有一个问题:
使用
#define For(i,x,y) for(int i=x;i<y;++i)
语句后,在程序内使用如下语句的时候
For(i,0,n)
cin>>a[n];
那句cin 无法自动缩进,是哪里设置有问题吗?
JSON代码:
{
"employees" : [
{
"firstName" : "Bill",
"lastName" : "\u64cd\u4f5c"
}
]
}
会被格式化成乱码:
{
"employees" : [
{
"firstName" : "Bill",
"lastName" : "鎿嶄綔"
}
]
}
当存在新版本时,在右上角显示新版本链接,用来提示用户。
用Qt编译时,CoolFormatLib.pro中要加INCLUDEPATH += ../Include ../FormatterLib/SqlFormatterLib ../FormatterLib/CssTidyLib ../FormatterLib/JsonCppLib ../FormatterLib/JsFormatterLib ../FormatterLib/PhpFormatterLib ../FormatterLib/tidy/src ../FormatterLib/AStyle/src
否则会有头文件找不到的问题
格式化PHP代码时报错,原因是认为下面的代码有语法错误:
$c = $a ?: $b;
其实这是PHP5.4新添加的语法,相当于原来的
$c = $a ? $a : $b;
另一个报错是数组的JSON式定义语法:
$d = ['a' => 1];
相当于原来的
$d = array('a' => 1);
只想格式化所选的,但是格式化后,没有起始缩进。示例:
function myFunction()
{
/* 只格式化以下 */
if ('this_is' == /an_example/)
{
of_beautifer();
}
else
{
var a = b ? (c % d) : e[f];
}
}
数组留空格
例如:
int array[COLS_CNT][ROWS_CNT];
能否提供如下格式转换:
int array[ COLS_CNT ][ ROWS_CNT ];
您好,
希望能增加支持以下语法。支持高亮就好,格式化相对来说不那么重要。
相信增加这些语法的支持可以很大程度上增加这软件的覆盖率。望作者考虑!
notepad++ 64位
格式下下列sql语句出错:
select count(*) from user;
格式化结果:
select
count
(
)
from
user;
比如将代码从VS复制到剪切板上,这时候是保留了颜色信息的
我建议在粘贴到CoolFormat时提供选项,可以选择粘贴纯文本或者保留颜色
纯文本就套用CoolFormat的高亮配置,如果已有颜色就采用原来颜色
继续支持一下大大,软件很好用
Source Insight支持自定义命令和插件脚本,如果能把CoolFormat做成插件,使用起来一定很便利。
多个工具之间复制粘贴感觉有点儿麻烦。
If I try to use CoolFormat for non-supported syntax (e.g., python, batch), it deletes a line (Selected Format) or the whole file content (Quick Format)
在英文操作系统下,并且安装了东亚语言支持,可以正常显示中文,但是非Unicode系统区域设置为非中文,这时可能将界面语言设置为‘中文’,但是还是显示成英文。
嗨作者 还记得我吗 之前跟你反馈verilog 格式化不起作用的
请问这个功能什么时候能加好啊 好期待啊~
“高亮到博客”只能将整个文件的代码转换成HTML格式,大多数时候是想将部分代码粘贴到博客中。
这个行不。。。
RULE: 在对象创建时,属性中的 :
之后必须有空格,:
之前不允许有空格。
万分感谢!
`public class Utils {
public static int parseInt(String value, int defValue) {
try {
return Integer.parseInt(value);
} catch (Exception e) {
return defValue;
}
}
}`
java代码中函数或者类的左括号和名字在同一行,不会对左括号进行格式化,上面的就是测试代码。
如果括号和名字不在同一行就可以格式化了,我用的是 V3.4 版本,命令行方式 -f
在英文操作系统下,并且安装了东亚语言支持,可以正常显示中文,这时格式化带中文代码就会产生乱码。
因为tidy内核问题,不支持中文标签,但是对XML来说,这是必要的。
格式化失败示例:
<?xml version="1.0" encoding="gb2312"?>
<商店><书籍>aaa</书籍><电影>bbb</电影></商店>
插件系统notepad++
本来打算 学习一下C++,在本地编译你的源码,结果 报错,tidyplatform.h、tidybuffio.h文件不存在,跑不起来,楼主有时间,提交一下
软件本身只有一个exe,可以方便的放在U盘中使用,可惜目前配置是记录在注册表中的。
int test() {
string str =
"dfdffddfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffbb";
string ss = "sdfsfs \
svfdsfs";
string s = "dfd"
"sdfss"
"sds";
}
1、当string类型过长时,最大行数设置的也只是仅仅将值换到下一行,可是值依然超过80行了
2、代码格式化后,反斜杠不能识别,下一行提前了两个空格。
1)既然作为开源软件,为什么不使用Qt+Ribbon?
2)项目中有Pro文件,使用Qt打开后发现里面只能生成lib,而没有app,即没有可执行程序生成。
Hello, currently I use this amazing plugin is my sublime text 3.
I want to change the keyboard binding of this plugin in my user keybinding.
But I don't know the command of these two operations.
Hope you could help me.
Best Regards,
Zhengshuai
C/C++设置 pad operators
为 yes
a=a^*b++;
这样的代码中 ^
前后不会添加空格。
经多种测试,发现是出现了 ^*
的原因。
a^=*b++
这样的会被格式化为a ^= *b++
。
而且 b ++
不会被格式化成 b++
,已设置 unpad parens
下面是设置
C++=""-A1-s4-S-K-xW-w-Y-m2-M40-f-p-U-k3-W3-xj-c""
64位的notepad++不能正常加载32为插件
插件系统sublime text 3
How to make it format on save?
#if defined 开头的预处理语句 到 #endif 之间无法缩进
示例代码:
#if defined ABC
#ifdef KK
#endif
#else
#ifdef BBB
#define HGF
#endif
#endif
#define OPP 1
#if OPP
#ifdef HGF
#define OOO
#endif
#endif
#if defined HGF && defined OOO
#ifdef KKK
#undef OOO
#endif
#endif
插件系统vs2013
This option is not working when used in "Selected format" command, but works fine in "Quick format" command. I was using Sublime Text version 3066 on Windows 7.
I am having an issue with CoolFormat inserting indentation into multi-line conditional statements.
This is the format I use for conditional statements:
if ( ( condition_1 == false )
&& ( condition_2 == false ) )
{
if ( ( condition_3 == false )
|| ( condition_4 == false ) )
{ doThis (); }
else if ( ( ( condition_3 == true )
&& ( condition_4 == true ) )
||
( ( condition_3 == false )
( condition_4 == true ) ) )
{ doThat (); }
}
This is the result after performing a QuickFormat:
if ( ( condition_1 == false )
&& ( condition_2 == false ) )
{
if ( ( condition_3 == false )
|| ( condition_4 == false ) )
{ doThis (); }
else if ( ( ( condition_3 == true )
&& ( condition_4 == true ) )
||
( ( condition_3 == false )
( condition_4 == true ) ) )
{ doThat (); }
}
My configuration:
Java=""-A7-T-C-xG-S-K-N-L-m0-f-p-P-d-D-xd-H-k2-W2-y-j-J-O-o-c-xy""
I have also tried removing all CoolFormat operators aside from the "A7" format, using different formatting schemes, & implementing the "m0" operator. However, for some reason the conditional operators are always indented when they are on separate lines.
注册表没找到
如题,我是在notepad++中使用。
另外,在格式化JOSN中含有unicode中文乱码时 不能解析成功。
老给<script>标签里加cdata真的好烦
压缩成示例:
if('this_is'==/an_example/){of_beautifer();}else{var a=b?(c%d):e[f];}
3.4版本,导出配置后在目标文件夹下面没有配置文件,Win8.1 x64
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.