VSCode tips
18 March 2017
1).clang-format
BasedOnStyle: LLVM
IndentWidth: 4
PointerAlignment: Left
AllowShortFunctionsOnASingleLine: None
AccessModifierOffset: -4
SortIncludes: false
AlwaysBreakTemplateDeclarations: true
AlignTrailingComments: false
- .clang-format 项目根目录
- 参数值大小写要一致
- https://clang.llvm.org/docs/ClangFormatStyleOptions.html
- 输出全部参数 clang-format -style=llvm -dump-config > .clang-format
2) 需要屏蔽上下文菜单[editor.action.changeAll],没有发现对应的配置,只有修改源码 过滤一下actions
private _getMenuActions(): IAction[] {
const result: IAction[] = [];
let contextMenu = this._menuService.createMenu(MenuId.EditorContext, this._contextKeyService);
const groups = contextMenu.getActions(this._editor.getModel().uri);
contextMenu.dispose();
for (let group of groups) {
const [, actions] = group;
result.push(...actions);
result.push(new Separator());
}
result.pop(); // remove last separator
return result;
}
function xxxfilterAction(actions) {
try {
var newActions = [];
for (var i = 0; i < actions.length; i++) {
var a = actions[i];
if (a.id == "editor.action.changeAll") {
continue;
}
newActions.push(a);
}
return newActions;
} catch (e) {
return actions;
}
}
- 修改VSCode\resources\app\out\vs\workbench\electron-browser\workbench.main.js
blog comments powered by Disqus