使用VSCODE开发UE4
完全可行,速度很快,智能提示、代码格式化、查找Symbol等等都不比VS+Visual AssistX 差。
准备
- 打开编辑器的Editor Preferences>Source Code,选择VSCode
- 在工程的uproject文件上右键>Generate Visual Studio Project,就会生成一个workspace文件,双击即可打开visual studio code. 同时生成的还有一个.vscode文件夹。
配置VSCode
- 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: 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
CanonicalDelimiter: ''
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)
使用VSCODE开发UE4的更多相关文章
- .Net Core Linux centos7行—vscode开发,linux部署运行
前面搭建好啦linux运行环境,下面搭建windows下的开发环境.并完成调试 参考地址:https://www.microsoft.com/net/core#windows. 按照步骤来就好.安装. ...
- vscode 开发.net core 从安装到部署 教程详解
一:环境准备: windows系统需要 win7 sp1 / windows 8 / windows 2008 r2 sp1 / windows10: 其他版本的windows系统在安装.NET C ...
- 用VSCode开发一个基于asp.net core 2.0/sql server linux(docker)/ng5/bs4的项目(1)
最近使用vscode比较多. 学习了一下如何在mac上使用vscode开发asp.netcore项目. 这里是我写的关于vscode的一篇文章: https://www.cnblogs.com/cgz ...
- 用VSCode开发一个基于asp.net core 2.0/sql server linux(docker)/ng5/bs4的项目(3)
第一部分: http://www.cnblogs.com/cgzl/p/8478993.html 第二部分: http://www.cnblogs.com/cgzl/p/8481825.html 由于 ...
- 使用vscode开发调试.net core应用程序并部署到Linux跨平台
使用VS Code开发 调试.NET Core RC2应用程序,由于.NET Core 目前还处于预览版. 本文使用微软提供的示例进行开发及调试. https://github.com/aspnet/ ...
- vsCode 开发微信小程序插件
用 vsCode 开发微信小程序可以配置以下插件,让开发更美好: 1. vscode weapp api 2. vscode wxml 3. vscode-wechat 4. Easy WXLESS ...
- 用vscode开发vue应用[转]
https://segmentfault.com/a/1190000019055976 现在用VSCode开发Vue.js应用几乎已经是前端的标配了,但很多时候我们看到的代码混乱不堪,作为一个前端工程 ...
- 【.NET Core项目实战-统一认证平台】基于jackcao博客使用VSCode开发及感悟One搭建开发环境
原博客系列文章链接:https://www.cnblogs.com/jackcao/ 金焰的世界 感谢博主无私的奉献,感谢博主幼儿班的教学 基于jackcao博客使用VsCode开发及感悟One搭建开 ...
- 用vscode开发vue应用
阅读 3237 收藏 205 2019-05-02 原文链接:segmentfault.com 云服务器 1 核 2G , 9元/月 ,买十送二,99/年!!!快来上车!developer.huawe ...
随机推荐
- 如何决定使用 HashMap 还是 TreeMap? (转)
问:如何决定使用 HashMap 还是 TreeMap? 介绍 TreeMap<K,V>的Key值是要求实现java.lang.Comparable,所以迭代的时候TreeMap默认是按照 ...
- 33.服务之间的调用之RPC、Restful深入理解
33.服务之间的调用之RPC.Restful深入理解 2018年05月08日 01:52:42 郑学炜 阅读数 13577更多 分类专栏: 6.框架 版权声明:本文为博主原创文章,遵循CC 4.0 ...
- 使用zookeeper报错 stat is not executed because it is not in the whitelist. envi is not executed because it is not in the whitelist.
在使用四字命令或者zk ui界面查看zookeeper集群时,出现如下提示: stat is not executed because it is not in the whitelist. envi ...
- Java中的Switch....case语句:
一.格式: switch(表达式){ case 常量表达式1: 语句1; case 常量表达式2: 语句2; … case 常量表达式n: 语句n; default: ...
- xampp for mac配置局域网访问
下载了xampp,之前在window上面经常用.后来用了mac下载xampp后,配置局域网总是没成功.现在配置好了,来和大家分享一下配置局域网访问步骤. 1. 下载 下载地址:https://www. ...
- django优化--ORM优缺点
谈Django绕不开ORM ORM : ORM概念,ORM特点,ORM 的优点,ORM 的缺点 orm : 对象关系映射 (Object Relational Mapping) ,用于实现面向对象编程 ...
- 3.1.2-arm-linux-ld选项
有文件link.S,内容如下 .text .global _start _start: b step1 step1: ldr pc, =step2 step2: b step2 经过如下命令编译 ar ...
- nginx服务学习第一章
一.ubuntu系统安装nginx服务 # apt-get install nginx 二.nginx.config配置文件详解 配置文件结构: 全局块(全局变量) events{ } http{ h ...
- linux内核配置与编译
配置内核:配置硬件和软件需的部分. make config:基于文本模式的交互式配置.(一问一答) make menuconfig:基于文本模式菜单性配置.(直观简单高效) <*>会产生b ...
- zabbix的nginx监控+邮件报警
nginx监控 下载nginx的监控模板