国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【VS】visual studio 代碼格式化工具--clang-format

這篇具有很好參考價(jià)值的文章主要介紹了【VS】visual studio 代碼格式化工具--clang-format。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

【VS】visual studio 代碼格式化工具–clang-format

1.到visual studio的tools->Extensions and updates

【VS】visual studio 代碼格式化工具--clang-format

2.在Extensions and updates查找clangFormat 插件

【VS】visual studio 代碼格式化工具--clang-format

3.安裝完插件,重啟vs,菜單中會(huì)多出兩個(gè)菜單:

【VS】visual studio 代碼格式化工具--clang-format
分別表示格式化選中代碼與格式化文檔。、

雖然現(xiàn)在的??022 已經(jīng)內(nèi)置了,但是大部分的流程都是一樣的
【VS】visual studio 代碼格式化工具--clang-format

4.到AppData\Local\Microsoft\VisualStudio\14.0\Extensions\2d20hrwn.tkx目錄找到clang-format.exe,并在cmd上輸入:.\clang-format.exe -style="Google" -dump-config > .clang-format

【VS】visual studio 代碼格式化工具--clang-format
就生成了.clang-format文件:

【VS】visual studio 代碼格式化工具--clang-format

5.將這個(gè)文件拷貝到需要格式化代碼的文件夾中,就可以用這個(gè)插件功能了。

附.clang-format文件:文章來源地址http://www.zghlxwxcb.cn/news/detail-507786.html

---
Language:        Cpp
BasedOnStyle:  Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Left
AlignOperands:   Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
  - __capability
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
  AfterCaseLabel:  false
  AfterClass:      false
  AfterControlStatement: Never
  AfterEnum:       false
  AfterFunction:   false
  AfterNamespace:  false
  AfterObjCDeclaration: false
  AfterStruct:     false
  AfterUnion:      false
  AfterExternBlock: false
  BeforeCatch:     false
  BeforeElse:      false
  BeforeLambdaBody: false
  BeforeWhile:     false
  IndentBraces:    false
  SplitEmptyFunction: true
  SplitEmptyRecord: true
  SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit:     100
#CommentPragmas:  '^ IWYU pragma:'
#CommentPragmas:  '^[^ ]'
CommentPragmas:  '^\\.+'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: true
DisableFormat:   false
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
  - foreach
  - Q_FOREACH
  - BOOST_FOREACH
StatementAttributeLikeMacros:
  - Q_EMIT
IncludeBlocks:   Preserve
IncludeCategories:
  - Regex:           '^<ext/.*\.h>'
    Priority:        2
    SortPriority:    0
    CaseSensitive:   false
  - Regex:           '^<.*\.h>'
    Priority:        1
    SortPriority:    0
    CaseSensitive:   false
  - Regex:           '^<.*'
    Priority:        2
    SortPriority:    0
    CaseSensitive:   false
  - Regex:           '.*'
    Priority:        3
    SortPriority:    0
    CaseSensitive:   false
IncludeIsMainRegex: '([-_](test|unittest))?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: true
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequires:  false
IndentWidth:     2
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd:   ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PenaltyIndentedWhitespace: 0
PointerAlignment: Left
RawStringFormats:
  - Language:        Cpp
    Delimiters:
      - cc
      - CC
      - cpp
      - Cpp
      - CPP
      - 'c++'
      - 'C++'
    CanonicalDelimiter: ''
    BasedOnStyle:    google
  - Language:        TextProto
    Delimiters:
      - pb
      - PB
      - proto
      - PROTO
    EnclosingFunctions:
      - EqualsProto
      - EquivToProto
      - PARSE_PARTIAL_TEXT_PROTO
      - PARSE_TEST_PROTO
      - PARSE_TEXT_PROTO
      - ParseTextOrDie
      - ParseTextProtoOrDie
      - ParseTestProto
      - ParsePartialTestProto
    CanonicalDelimiter: ''
    BasedOnStyle:    google
ReflowComments:  true
SortIncludes:    true
SortJavaStaticImport: Before
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles:  true
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard:        Auto
StatementMacros:
  - Q_UNUSED
  - QT_REQUIRE_VERSION
TabWidth:        8
UseCRLF:         false
UseTab:          Never
WhitespaceSensitiveMacros:
  - STRINGIZE
  - PP_STRINGIZE
  - BOOST_PP_STRINGIZE
  - NS_SWIFT_NAME
  - CF_SWIFT_NAME
...
 

到了這里,關(guān)于【VS】visual studio 代碼格式化工具--clang-format的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • VS Code保存后自動(dòng)格式化Vue代碼---Vetur

    VS Code保存后自動(dòng)格式化Vue代碼---Vetur

    在VS Code里面編輯Vue代碼,通常我們會(huì)安裝插件Vetur,本次介紹的格式化代碼也依賴于Vetur插件。具體見一下步驟 注: VS Code版本為1.74.3 1. 安裝插件Vetur 2. 配置自動(dòng)格式化,具體路徑【文件】-【首選項(xiàng)】-【設(shè)置】,打開設(shè)置(json) 3. 將以下內(nèi)容復(fù)制到settings.json 完成以上配置

    2024年02月15日
    瀏覽(26)
  • IDEA代碼自動(dòng)格式化工具

    IDEA代碼自動(dòng)格式化工具

    在IDEA中,打開 IDEA 的設(shè)置,找到 Editor - General - Auto Import。勾選上 Add unambiguous imports on the fly Optimize imports on the fly (for current project) 設(shè)置方法如下: 1.打開設(shè)置 2.找到版本控制(Version Control),點(diǎn)擊提交(Commit) 3.勾選Before Commit下的Reform code activate save actions on save – 在保存的時(shí)候激活

    2024年02月15日
    瀏覽(103)
  • VS Code 一鍵刪除所有注釋,仨健格式化全部代碼,一鍵去除行尾空格空白

    VS Code 一鍵刪除所有注釋,仨健格式化全部代碼,一鍵去除行尾空格空白

    1. 打開VSCode的替換頁面,快捷鍵為: Ctl + H 2. 鼠標(biāo)左擊使能正則表達(dá)式選項(xiàng),快捷鍵為: Alt + R 3. 瞄準(zhǔn)全部注釋的正則表達(dá)式為: ? ? ? 4. 替換的內(nèi)容什么都不寫, 鼠標(biāo)左擊替換全部, 快捷鍵為: Ctl + Alt + Enter 5. 如果想刪除全部空行,瞄準(zhǔn)全部空行的正則表達(dá)式為: 同樣用空來替換全

    2024年02月03日
    瀏覽(33)
  • Python 代碼格式化工具YAPF 0.17.0問世

    導(dǎo)讀 YAPF 0.17.0 已發(fā)布,YAPF 是 Google 開源的一個(gè)用來格式化 Python 代碼的工具。 目前用于 Python 的格式化程序(如 autopep8 和 pep8ify)都用于刪除代碼中的 lint 錯(cuò)誤。這有很明顯的局限性。YAPF 采用了不同的方法,基于 Daniel Jasper 開發(fā)的 “clang-format” 。從本質(zhì)上來說,該算法取

    2024年02月05日
    瀏覽(95)
  • Python 潮流周刊#25:性能最快的代碼格式化工具 Ruff!

    你好,我是貓哥。這里每周分享優(yōu)質(zhì)的 Python、AI 及通用技術(shù)內(nèi)容,大部分為英文。標(biāo)題取自其中一則分享,不代表全部?jī)?nèi)容都是該主題,特此聲明。 本周刊由 Python貓 出品,精心篩選國(guó)內(nèi)外的 250+ 信息源,為你挑選最值得分享的文章、教程、開源項(xiàng)目、軟件工具、播客和視頻

    2024年02月06日
    瀏覽(92)
  • VSCode 配置 python 代碼格式化工具(yapf,autopep8)

    需要注意的是,yapf的配置選項(xiàng)都是可選的,你可以根據(jù)自己的需要選擇使用哪些選項(xiàng)。不過,使用太多選項(xiàng)可能會(huì)導(dǎo)致代碼格式化的規(guī)則變得復(fù)雜,對(duì)代碼的可讀性有影響。因此,建議盡量使用最少的選項(xiàng)來保持代碼的簡(jiǎn)潔性。 aggressive: 這個(gè)選項(xiàng)表示在格式化代碼時(shí)使用更

    2024年02月09日
    瀏覽(180)
  • Python 進(jìn)階指南(編程輕松進(jìn)階):三、使用 Black 工具來格式化代碼

    Python 進(jìn)階指南(編程輕松進(jìn)階):三、使用 Black 工具來格式化代碼

    原文:http://inventwithpython.com/beyond/chapter3.html 代碼格式化是將一組規(guī)則應(yīng)用于源代碼,從而使得代碼風(fēng)格能夠簡(jiǎn)潔統(tǒng)一。雖然代碼格式對(duì)解析程序的計(jì)算機(jī)來說不重要,但代碼格式對(duì)于可讀性是至關(guān)重要的,這是維護(hù)代碼所必需的條件。如果你的代碼對(duì)人(無論是你還是同事)

    2023年04月09日
    瀏覽(96)
  • 【工具分享】程序員在線工具集(json格式化-html格式化-加密工具)

    演示地址 在線工具集 功能介紹 json格式化 。 JSON 可以將程序語言對(duì)象中表示的一組數(shù)據(jù)轉(zhuǎn)換為字符串,然后就可以在網(wǎng)絡(luò)或者程序之間輕松地傳遞這個(gè)字符串,并在需要的時(shí)候?qū)⑺€原為各編程語言所支持的數(shù)據(jù)格式,例如在 PHP 中,可以將 JSON還原為數(shù)組或者一個(gè)基本對(duì)象

    2024年02月12日
    瀏覽(99)
  • vscode中怎樣格式化js代碼_vscode如何格式化代碼

    vs code格式化代碼的快捷鍵如下: 在Mac上 Shift+ Option+F 在Ubuntu上 Ctrl+ Shift+I 但是自帶的格式化并不能滿足我的需求,這個(gè)時(shí)候,不得不說插件大法好。 代碼格式化為eslint風(fēng)格 需要插件:eslint

    2024年02月16日
    瀏覽(97)
  • JSON格式化工具

    JSON格式化工具

    格式化JSON有多種方式,選兩種。 我喜歡用這個(gè)網(wǎng)站:在線JSON工具 需要插件 - JSON Viewer。 安裝方式: 2.1 點(diǎn)擊工具欄“插件”-選擇“插件管理…”,彈出插件管理窗口,在“可用”tab頁,找到“JSON viewer ”,勾選,點(diǎn)擊右上方的“安裝”按鈕,等待一會(huì),就可以了。 2.2 如果因

    2024年02月05日
    瀏覽(91)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包