完全可行,速度很快,智能提示、代码格式化、查找Symbol等等都不比VS+Visual AssistX 差。

准备

  1. 打开编辑器的Editor Preferences>Source Code,选择VSCode
  2. 在工程的uproject文件上右键>Generate Visual Studio Project,就会生成一个workspace文件,双击即可打开visual studio code. 同时生成的还有一个.vscode文件夹。

配置VSCode

  1. VSCode需要的插件网上众说纷纭,实际证明,只需要这三个就够了:

什么clang-format之类的完全不需要,因为c/c++里面自带了clang-format.

打开设置(Ctrl+,或者File>Preferences>Settings)
选择Extensions>C/C++

C_Cpp:Autocomplete    Default
C_Cpp:Clang_format_fallback Style   Visual Studio(这里是防止Clang_format_style填写的是file,而系统找不到.clang-format文件时候的情况)
C_Cpp:Clang_format_path          不需要填写(默认配置好了)
C_Cpp:Clang_format_style          Visual Studio(或者LLVM)
C_Cpp>Default: Cpp Standard        c++11
C_Cpp:Workspace Symbols          All

最后这条最重要,否则查找Symbol时候就无法识别到UE源码中的代码了。

注意上面的两个format 可以取值Visual Studio, LLVM, Google, WebKit等。推荐使用WebKit

如果追求完美,可以这样设置

官方C/C++插件自带的clang-format版本是6.0,所以设置相关选项时要注意参考的文档版本。
可以自行下载最新的clang-format文件,目前最新版本是7.0。
下载位置:下载
选择编译好的win64版本。

安装好以后只需要找到里面的clang-format.exe 拷贝到别处(例如C:/),其余部分就可以卸载了。

然后将C_Cpp:Clang_format_path设置为刚下载的clang-format.exe路径:
"C_Cpp.clang_format_path": "C:\\clang-format.exe",
C_Cpp:Clang_format_style设置为file,表示从工作目录或上级文件夹中寻找.clang-format配置文件。
在工作目录中创建一个名称为.clang-format的文件
windows系统中无法创建名字以.开头的文件,可以这样创建:打开cmd,输入echo >.clang-format ,回车即可创建。

内容用下方内容粘贴

这里有一个专门为UE4配置好的.clang-format文件内容:

---
Language:        Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands:   true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Allman
BreakBeforeInheritanceComma: false
BreakInheritanceList: AfterColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit:     0
CommentPragmas:  '^ IWYU pragma:'
CompactNamespaces: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 0
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DisableFormat:   false
FixNamespaceComments: true
ForEachMacros:   - for
IncludeBlocks:   Regroup
IncludeCategories: - Regex:           '.*\.generated\.h'Priority:        100- Regex:           '.*(PCH).*'Priority:        -1- Regex:           '".*"'Priority:        1- Regex:           '^<.*\.(h)>'Priority:        3- Regex:           '^<.*>'Priority:        4
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth:     4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd:   ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
RawStringFormats: - Language:        CppDelimiters:      - cc- CC- cpp- Cpp- CPP- 'c++'- 'C++'CanonicalDelimiter: ''BasedOnStyle:    google- Language:        TextProtoDelimiters:      - pb- PB- proto- PROTOEnclosingFunctions: - EqualsProto- EquivToProto- PARSE_PARTIAL_TEXT_PROTO- PARSE_TEST_PROTO- PARSE_TEXT_PROTO- ParseTextOrDie- ParseTextProtoOrDieCanonicalDelimiter: ''
ReflowComments:  true
SortIncludes:    true
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 4
SpacesInAngles:  false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard:        Auto
TabWidth:        4
UseTab:          Always
...

自动格式化

Text Editor> Formatting
Format On Save和Format On Type都打勾。

常用快捷操作

打开Symbol: 按Ctrl键并鼠标左键点击Symbol
查找Symbol: 选择Symbol并Ctrl+T (VAssist中的Alt+Shift+S)
转到定义: F12
转到声明: Ctrl+F12
重命名: Ctrl+F2
切换头/源文件: Alt+O (VAssist快捷键一样)
快速打开文件: Ctrl+P (VAssist中的Alt+Shift+O)

转载于:https://www.cnblogs.com/AnKen/p/10654678.html

使用VSCODE开发UE4相关推荐

  1. 使用VScode开发ESP32,PlatformIO开发ESP32

    arduino IDE安装开发板库 安装arduino IDE 首先下载arduino IDE并安装.在官网下载即可.如果官网下载慢,可以找第三方资源下载. 下载开发板库 安装后进入"文件& ...

  2. 使用VScode开发ESP8266,PlatformIO开发ESP8266

    arduino IDE安装开发板库 安装arduino IDE 首先下载arduino IDE并安装.在官网下载即可.如果官网下载慢,可以找第三方资源下载. 下载开发板库 安装后进入"文件& ...

  3. 【开发环境】Ubuntu 中使用 VSCode 开发 C/C++ ⑤ ( tasks.json 中的 args 数组配置分析 | 编译并执行 C++ 程序 )

    文章目录 一.tasks.json 中的 args 数组配置分析 二.编译并执行 C++ 程序 可以参考官方提供的文档 : https://code.visualstudio.com/docs/cpp ...

  4. 【开发环境】Ubuntu 中使用 VSCode 开发 C/C++ ④ ( 创建 tasks.json 编译器构建配置文件 | tasks.json 编译器构建配置文件分析 )

    文章目录 一.创建 tasks.json 编译器构建配置文件 二.tasks.json 编译器构建配置文件分析 可以参考官方提供的文档 : https://code.visualstudio.com/ ...

  5. 【开发环境】Ubuntu 中使用 VSCode 开发 C/C++ ③ ( 创建工程目录 | 添加 C++ 源代码 | 代码自动提示 )

    文章目录 一.创建工程目录 二.添加 C++ 源代码 三.代码自动提示 可以参考官方提供的文档 : https://code.visualstudio.com/docs/cpp/config-linu ...

  6. vsCode 开发微信小程序插件

    用 vsCode 开发微信小程序可以配置以下插件,让开发更美好: 1. vscode weapp api 2. vscode wxml 3. vscode-wechat 4. Easy WXLESS ...

  7. VSCode开发.NETCore项目入门(1)设置中文语言环境

    安装VSCode 最新地址:https://code.visualstudio.com/,下载后安装即可 配置语言环境 打开安装好的VSCode软件,可以看到刚刚安装的VSCode软件默认使用的是英文 ...

  8. vscode 开发vue必备插件_vsCode开发vue项目必备插件

    VSCode 开发Vue必备插件 对于很多使用vscode编写vue项目的新手同学来说,可能不知道使用什么插件,这里简单说一下我常用的几款插件. 1. vetur 实现在 vue 文件中: 语法错误检 ...

  9. ESP32开发 0.windows Vscode开发环境搭建,基于esp-idf-V4.2 | Cmake | Vscode插件

    一 前言 入坑嵌入式以来,一直都在寻找一款通用MCU控制器:他应有优秀的计算处理能力.丰富的外设扩展能力.支持有线/无线联网.小巧的封装.自从ESP8266爆火以来,熟悉过它的使用,但窘于硬件限制,只 ...

最新文章

  1. linux配置4g网络命令_Linux网络基本配置命令
  2. linux搭建vsftpd虚拟用户访问
  3. java中将json字符串_Java中JSON字符串与java对象的互换实例详解
  4. vs2010 问题 LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
  5. Python入门100题 | 第068题
  6. python常见面试题:m1={‘a‘:1,‘b‘:2,‘c‘:1} 将同样的value的key集合在list里,输出{1:[‘a‘,‘c‘],2:[‘b‘]}
  7. 计算机专业女生的就业方向参考
  8. 石子合并问题--直线版(Hrbust-1818)
  9. 【Daily Scrum】
  10. 中达优控触摸屏编程视频教程_YKBuilder(中达优控触摸屏编程软件)下载
  11. 处理Windows快捷键占用冲突
  12. 5254. 卖木头块 动态规划
  13. outlook邮箱备份步骤
  14. es6 箭头函数 模板字符串 点点点运算符
  15. c语言父进程创建孙进程,进程的创建与并发的执行-带答案版.doc
  16. 阿里无线11.11 | 手机淘宝主会场实践之路
  17. IDEA无法启动:error launching idea (Failed to create JVM )
  18. 计算机主机的拆卸步骤,电脑主板怎么拆CPU 主板拆CPU步骤图文教程
  19. 在线学习算法FTRL基本原理
  20. sql语句查询某字段中包含某值(模糊查找)

热门文章

  1. ggspatial | ggplot2的地图制作拓展包(1):如何添加指北针和比例尺
  2. python平稳性检验_Python中非平稳时间序列的处理
  3. java request获取域,Java Web - Servlet(13)HttpServletRequest详解(获取请求数据、请求分派、请求域)(二)...
  4. opencv配置中常见问题
  5. linux文件系统选哪种,linux下几种文件系统的测试比较
  6. 计算机应用基础word教程,计算机应用基础-文字处理word教程PPT课件.ppt
  7. python数据库去重复_python string 去重复数据库
  8. oracle删除临时表空间语句,Oracle中临时表空间的清理
  9. 做了项目才知道的Cookie和Session
  10. pytorch学习——基本优化思想与最小二乘法