|
1 | 1 | # 4D Analyzer |
2 | 2 |
|
3 | | -This extension provides support for the **[4D](https://www.4d.com/)** language. |
| 3 | +This extension developed by **[4D](https://www.4d.com/)** provides support for the **[4D language](https://developer.4d.com/docs/Concepts/about,)** through the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/). |
4 | 4 |
|
5 | 5 | ## Features |
6 | 6 |
|
7 | | -* [Syntax Coloring](https://blog.4d.com/setting-up-code-syntax-highlighting-using-the-visual-studio-code-extension/) (v19 R6) |
8 | | -* [Signature helper](https://blog.4d.com/vs-code-go-to-definition-signature-help/) (v19 R7) |
9 | | -* [Go to definition](https://blog.4d.com/vs-code-go-to-definition-signature-help/) (v19 R7) |
10 | | -* [Auto completion](https://blog.4d.com/vs-code-extension-code-completion/) (v19 R8) |
11 | | -* [Document syntax checking](https://blog.4d.com/new-vs-code-editor-features-with-4d-v20/) (v20) |
12 | | -* [Code Folding](https://blog.4d.com/new-vs-code-editor-features-with-4d-v20/) (v20) |
13 | | -* [Indentation](https://blog.4d.com/new-vs-code-editor-features-with-4d-v20/) (v20) |
14 | | -* [Code formatting](https://blog.4d.com/format-your-4d-code-in-visual-studio-code/) (v20 R2) |
15 | | -* [Show Documentation](https://blog.4d.com/vs-code-extension-show-4d-documentation/) (v20 R3) |
| 7 | +Release numbers indicate the minimal 4D release where the feature is available. |
| 8 | + |
| 9 | +- [Syntax Coloring](https://blog.4d.com/setting-up-code-syntax-highlighting-using-the-visual-studio-code-extension/) (4D 19 R6) |
| 10 | +- [Signature helper](https://blog.4d.com/vs-code-go-to-definition-signature-help/) (4D 19 R7) |
| 11 | +- [Go to definition](https://blog.4d.com/vs-code-go-to-definition-signature-help/) (4D 19 R7) |
| 12 | +- [Auto completion](https://blog.4d.com/vs-code-extension-code-completion/) (4D 19 R8) |
| 13 | +- [Document syntax checking](https://blog.4d.com/new-vs-code-editor-features-with-4d-v20/) (4D 20) |
| 14 | +- [Code Folding](https://blog.4d.com/new-vs-code-editor-features-with-4d-v20/) (4D 20) |
| 15 | +- [Indentation](https://blog.4d.com/new-vs-code-editor-features-with-4d-v20/) (4D 20) |
| 16 | +- [Code formatting](https://blog.4d.com/format-your-4d-code-in-visual-studio-code/) (4D 20 R2) |
| 17 | +- [Show Documentation](https://blog.4d.com/vs-code-extension-show-4d-documentation/) (4D 20 R3) |
| 18 | +- [Workspace syntax checking](https://blog.4d.com/workspace-syntax-checking-in-vs-code-editor/) (4D 20 R5) |
| 19 | + |
16 | 20 |
|
17 | 21 | ## Quick start |
18 | 22 |
|
19 | | -1. Install a **4D**, **4D Server** or **tool4d** application on your computer. **tool4d** free download links: [Windows](https://product-download.4d.com/release/20%20Rx/latest/latest/win/tool4d_v20R2_win.tar.xz), [macOS Intel](https://product-download.4d.com/release/20%20Rx/latest/latest/mac/tool4d_v20R2_mac_x86.tar.xz), [macOS Silicon](https://product-download.4d.com/release/20%20Rx/latest/latest/mac/tool4d_v20R2_mac_arm.tar.xz). |
20 | 23 | 1. Install the 4D Analyzer extension in VS Code. |
21 | | -1. Set the path of the application executable to **4D-Analyzer.Server.path**. |
| 24 | +1. Open a 4D project folder or a 4D method (.4dm) file. |
22 | 25 |
|
23 | | -More information on installation in this [4D Blog post](https://blog.4d.com/a-brand-new-visual-studio-code-extension-at-your-disposal/). |
24 | | -All 4D Blog posts about this extension are available [here](https://blog.4d.com/tag/vscode/). |
| 26 | +All 4D blog posts about this extension are available [here](https://blog.4d.com/tag/vscode/). |
25 | 27 |
|
26 | 28 | ## Configuration |
27 | 29 |
|
28 | 30 | This extension provides configurations through VSCode's configuration settings. |
29 | | -All configurations are under __4d-analyzer.*__. |
30 | | - |
| 31 | +All configurations are under __4D-Analyzer.*__. |
31 | 32 | See the VSCode manual for more information on specific configurations. |
| 33 | + |
| 34 | +More precision on automatic **tool4d** download and use in [this 4D blog post](https://blog.4d.com/auto-tool4d-download-in-4d-analyzer-extension-for-vs-code). |
| 35 | + |
| 36 | +### Extension Settings |
| 37 | + |
| 38 | +- **Tool4d: Enable** |
| 39 | + - Setting: 4D-Analyzer.server.tool4d.enable |
| 40 | + - Values: true (default) / false |
| 41 | + - Enables/disables the automatic **tool4d** download and use. |
| 42 | + |
| 43 | +- **Tool4d: Version** |
| 44 | + - Setting: 4D-Analyzer.server.tool4d.version |
| 45 | + - only has an impact when the "Automatic download and use of tool4d" parameter is activated. |
| 46 | + - Values: "latest" (default) / Version as string |
| 47 | + - Defines the [**tool4d** version](In the new "Warnings" page, ) to use: |
| 48 | + - "latest" corresponds to the latest global version of **tool4d**. This is the default value and the best way to ensure you're always up to date. Versions will be downloaded as they are released, including HotFix versions. |
| 49 | + - "20R" corresponds to the latest **tool4d** 20 Feature Release version, including HotFix versions. |
| 50 | + - "20R4" corresponds to the latest version of **tool4d** 20 R4. This will limit the download to 20 R4, including HotFix versions, when available. Of course, you can specify "20R5", "20R6," and so on as they become available. |
| 51 | + - "20" means the latest version of **tool4d** 20 Long Term Service, including HotFix versions. Of course, you can specify "21", "22" and so on as they become available. |
| 52 | + |
| 53 | +- **Tool4d: Channel** |
| 54 | + - Setting: 4D-Analyzer.server.tool4d.channel |
| 55 | + - only has an impact when the "Automatic download and use of tool4d" parameter is activated. |
| 56 | + - Values: "stable" (default) / "beta" |
| 57 | + - Defines the **tool4d** version channel to use. |
| 58 | + |
| 59 | +- **Tool4d: Location** |
| 60 | + - Setting: 4D-Analyzer.server.tool4d.location |
| 61 | + - only has an impact when the "Automatic download and use of tool4d" parameter is activated. |
| 62 | + - Values: path |
| 63 | + - Optional. Defines a custom location where the downloaded **tool4d** will be placed on disk. |
| 64 | + |
| 65 | +- **Server: Path** |
| 66 | + - Setting: 4D-Analyzer.server.path |
| 67 | + - only has an impact when the "Automatic download and use of tool4d" parameter is deactivated. |
| 68 | + - Values: path |
| 69 | + - Path to the local **4D**, **4D Server** or **tool4d** executable launched by the extension to use as LSP server. |
| 70 | + |
| 71 | +- **Diagnostics: Enable** |
| 72 | + - Setting: 4D-Analyzer.diagnostics.enable |
| 73 | + - Values: true (default) / false |
| 74 | + - Enables/disables the automatic Syntax Checking. |
| 75 | + |
| 76 | +- **Diagnostics: Scope** |
| 77 | + - Setting: 4D-Analyzer.diagnostics.scope |
| 78 | + - Values: "Workspace" (default) / "Document" |
| 79 | + - Specifies if the Syntax Checking is performed on the current workspace or on the current document only. |
| 80 | + |
| 81 | +- **Trace: Server** |
| 82 | + - Setting: 4D-Analyzer.trace.server |
| 83 | + - Values: "off" (default) / "messages" / "verbose" |
| 84 | + - For debugging purposes. Defines the level of information logged in the output panel. |
| 85 | + |
| 86 | +### Use custom local 4D application |
| 87 | + |
| 88 | +1. Install a **4D**, **4D Server** or **tool4d** application on your computer. For example, here is the free download link for [**tool4d**](https://product-download.4d.com/?branch=All&flag=All&version_number=All&platform=All&type=tool). |
| 89 | +1. Deactivate the "Automatic download and use of tool4d" setting (**4D-Analyzer.server.tool4d.enable**). |
| 90 | +1. Set the path of the application executable to **4D-Analyzer.Server.path**. |
| 91 | +More information on this kind of installation in this [4D Blog post](https://blog.4d.com/a-brand-new-visual-studio-code-extension-at-your-disposal/). |
| 92 | + |
| 93 | +### 4D Code Stylesheets |
| 94 | + |
| 95 | +To display 4D code with the default 4D stylesheets, insert this property in the VSCode User settings.json file: |
| 96 | +```json |
| 97 | +"editor.semanticTokenColorCustomizations": { |
| 98 | + "[Default Light+]": { |
| 99 | + "enabled": true, |
| 100 | + "rules": { |
| 101 | + "*:4d": { |
| 102 | + "foreground": "#000000", |
| 103 | + "bold": false, |
| 104 | + "italic": false, |
| 105 | + "underline": false, |
| 106 | + "strikethrough": false |
| 107 | + }, |
| 108 | + "method:4d": { |
| 109 | + "foreground": "#000088", |
| 110 | + "bold": true, |
| 111 | + "italic": true |
| 112 | + }, |
| 113 | + "method.defaultLibrary:4d": { |
| 114 | + "foreground": "#068c00", |
| 115 | + "italic": false |
| 116 | + }, |
| 117 | + "method.plugin:4d": { |
| 118 | + "foreground": "#000000" |
| 119 | + }, |
| 120 | + "property:4d": { |
| 121 | + "foreground": "#a0806b" |
| 122 | + }, |
| 123 | + "function:4d": { |
| 124 | + "foreground": "#5f8e5e", |
| 125 | + "italic": true |
| 126 | + }, |
| 127 | + "parameter:4d": { |
| 128 | + "foreground": "#000b76", |
| 129 | + "bold": true |
| 130 | + }, |
| 131 | + "variable.interprocess:4d": { |
| 132 | + "foreground": "#ff0088" |
| 133 | + }, |
| 134 | + "variable.process:4d": { |
| 135 | + "foreground": "#0000ff" |
| 136 | + }, |
| 137 | + "variable.local:4d": { |
| 138 | + "foreground": "#0031ff" |
| 139 | + }, |
| 140 | + "keyword:4d": { |
| 141 | + "foreground": "#034d00", |
| 142 | + "bold": true |
| 143 | + }, |
| 144 | + "table:4d": { |
| 145 | + "foreground": "#532300" |
| 146 | + }, |
| 147 | + "field:4d": { |
| 148 | + "foreground": "#323232" |
| 149 | + }, |
| 150 | + "comment:4d": { |
| 151 | + "foreground": "#535353" |
| 152 | + }, |
| 153 | + "type:4d": { |
| 154 | + "foreground": "#068c00", |
| 155 | + "bold": true |
| 156 | + }, |
| 157 | + "constant:4d": { |
| 158 | + "foreground": "#4d004d", |
| 159 | + "underline": true |
| 160 | + }, |
| 161 | + "string:4d": { |
| 162 | + "foreground": "#000000" |
| 163 | + }, |
| 164 | + "error:4d": { |
| 165 | + "foreground": "#ff0000", |
| 166 | + "bold": true, |
| 167 | + "italic": true |
| 168 | + } |
| 169 | + } |
| 170 | + }, |
| 171 | + "[Default Dark+]": { |
| 172 | + "enabled": true, |
| 173 | + "rules": { |
| 174 | + "*:4d": { |
| 175 | + "foreground": "#FFFFFF", |
| 176 | + "bold": false, |
| 177 | + "italic": false, |
| 178 | + "underline": false, |
| 179 | + "strikethrough": false |
| 180 | + }, |
| 181 | + "method:4d": { |
| 182 | + "foreground": "#1B79F3", |
| 183 | + "bold": true, |
| 184 | + "italic": true |
| 185 | + }, |
| 186 | + "method.defaultLibrary:4d": { |
| 187 | + "foreground": "#59BB00", |
| 188 | + "italic": false |
| 189 | + }, |
| 190 | + "method.plugin:4d": { |
| 191 | + "foreground": "#BFBFBF" |
| 192 | + }, |
| 193 | + "property:4d": { |
| 194 | + "foreground": "#A0806B" |
| 195 | + }, |
| 196 | + "function:4d": { |
| 197 | + "foreground": "#4EC36E", |
| 198 | + "italic": true |
| 199 | + }, |
| 200 | + "parameter:4d": { |
| 201 | + "foreground": "#0C70FF", |
| 202 | + "bold": true |
| 203 | + }, |
| 204 | + "variable.interprocess:4d": { |
| 205 | + "foreground": "#FF0088" |
| 206 | + }, |
| 207 | + "variable.process:4d": { |
| 208 | + "foreground": "#53B0EB" |
| 209 | + }, |
| 210 | + "variable.local:4d": { |
| 211 | + "foreground": "#18B3F1" |
| 212 | + }, |
| 213 | + "keyword:4d": { |
| 214 | + "foreground": "#575757", |
| 215 | + "bold": true |
| 216 | + }, |
| 217 | + "table:4d": { |
| 218 | + "foreground": "#CF5600" |
| 219 | + }, |
| 220 | + "field:4d": { |
| 221 | + "foreground": "#9C6765" |
| 222 | + }, |
| 223 | + "comment:4d": { |
| 224 | + "foreground": "#8F8F8F" |
| 225 | + }, |
| 226 | + "type:4d": { |
| 227 | + "foreground": "#59BB00", |
| 228 | + "bold": true |
| 229 | + }, |
| 230 | + "constant:4d": { |
| 231 | + "foreground": "#FA647F", |
| 232 | + "underline": true |
| 233 | + }, |
| 234 | + "string:4d": { |
| 235 | + "foreground": "#FFFFFF" |
| 236 | + }, |
| 237 | + "error:4d": { |
| 238 | + "foreground": "#ff0000", |
| 239 | + "bold": true, |
| 240 | + "italic": true |
| 241 | + } |
| 242 | + } |
| 243 | + } |
| 244 | +} |
| 245 | +``` |
0 commit comments