安装delphi 11.3
版本信息参考:
https://blogs.embarcadero.com/delphi-11-and-cbuilder-11-community-editions-released/
https://blogs.embarcadero.com/new-rad-studio-11-3-inline-build/
- 断开网络
- 加载ISO
- 管理员身份加载 radstudio_11_esd_113236a.exe
- Agree the License Agreement, 通过Options修改安装位置, click Next for the License Input page, DO NOT click Install
- Now on KeyPatch, click Generate Serial Number and Patch RAD Studio Setup process, 选择高级patch,否则可能影响 vs code 的delphi插件安装
- Go Back to Setup – RAD Studio 11 click Back, then select Use Existing License, click Install
- On RAD Studio Platform Selection, select features to complete the installation
- 选择 Delphi windows enterprise
- 选择如下功能,不选择teechart
- 第一次启动时,以管理员权限启动RUN RAD STUDIO AS ADMINISTRATOR FOR THE FIRST TIME
设置 VS Code 编辑器
VS Code插件 DelphiLSP
参考: https://marketplace.visualstudio.com/items?itemName=EmbarcaderoTechnologies.delphilsp
-
Make sure you have Embarcadero Delphi 11.0 or higher installed on your machine
-
RAD中打开Delphi项目
-
Generate
.delphilsp.json
files for the projects you want to work with:
- In Delphi: Tools > Options > User Interface > Editor > Language(选择delphi) > Code Insight and turn on ‘Generate LSP Config’, and close and reopen your project.
- For full information, see the detailed instructions on the docwiki’s Code Insight Reference page
-
Open a directory in VSCode that contains one or more Delphi projects
- If there are multiple projects (
.delphilsp.json
files) in the folder, you will be prompted to choose one - …and if you close that dialog by mistake, you can execute the command
DelphiLSP: Select project settings
in order to set the project context
- If there are multiple projects (
-
Start working with your Delphi code!
(不用每个项目都设置,也会自动生成.delphilsp.json)
VS Code插件 Delphi Extension Pack
参考: https://marketplace.visualstudio.com/items?itemName=alefragnani.delphi-pack
Includes the basic extensions to get started with Delphi development in Visual Studio Code.
包含如下插件:
Extension | Objective |
---|---|
Pascal | Syntax Highlight, Snippets, Code Formatter and Navigation |
Numbered Bookmarks | Bookmarks in Delphi style |
Delphi Keymap | Popular Delphi keyboard shortcuts |
Delphi Themes | Make Visual Studio Code look like Delphi |
启动会提示: The "global" command is not available. Make sure it is on PATH
, 因为需要 GNU Global 支持
安装 GNU Global: http://adoxa.altervista.org/global/
- 下载解压到
C:\global4vscode
- 将
C:\global4vscode\bin
添加到系统path
VS Code中的代码格式化
打开vscode,按F1,搜索task生成task.json,配置任务format delphi file
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
// https://code.visualstudio.com/docs/editor/tasks#vscode
// 注意路径中空格的处理,参考上述 URL
// Task的类型,分为shell和process两种
"version": "2.0.0",
"tasks": [
{
"label": "format delphi file",
"type": "process",
"command": "C:/Program Files (x86)/Embarcadero/Studio/22.0/bin/Formatter.exe",
"args": [
{
"value": "${file}",
"quoting": "escape"
}
],
"presentation": {
"echo": false,
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
},
]
}
这个task.json在当前项目中新建.vscode
的文件夹,中,把该文件移动到 C:\Users\用户名\AppData\Roaming\Code\User
这个文件夹下面, 就会变成全局任务,其他项目也可以用了。
打开vscode,按F1,搜索 open keyboard shortcuts,打开keybindings.json
// 将键绑定放在此文件中以覆盖默认值
// 单个命令 "command": "workbench.action.tasks.runTask",
[
{
"key": "ctrl+d",
"command": "workbench.action.tasks.runTask",
"args": "format delphi file",
"when": "resourceExtname == .pas"
},
]
可以用 ctrl + d 格式化代码了
cnpack
Releases · cnpack/cnwizards (github.com)
以管理员身份启动命令行运行 CnWizards_1.2.7.1138.exe, 修改安装目录到 d:\CnPack\CnWizards, 重启delphi11
快捷键:
- 代码格式化: CTRL + W
TeeChart Pro
-
创建编译目标目录: D:\Embarcadero\teechartPro
-
编译安装
fastreport
编译安装。
其他
- devexpress