Skip to content

Commit 0750e1a

Browse files
swaldmannchgeo
andauthored
Videos for VS Code docs (#1429)
Added tiny screencasts for VS Code editor features Added small section about ```cds highlighting on GitHub All videos are ~600 kB total. See internal version for preview --------- Co-authored-by: Christian Georgi <[email protected]>
1 parent 9d53de5 commit 0750e1a

8 files changed

+164
-54
lines changed
109 KB
Binary file not shown.
86.4 KB
Binary file not shown.
60.5 KB
Binary file not shown.
52.6 KB
Binary file not shown.
165 KB
Binary file not shown.
44 KB
Binary file not shown.
87.6 KB
Binary file not shown.

tools/cds-editors.md

Lines changed: 164 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -119,87 +119,197 @@ Using the CDS language server implementation, editors can provide additional sou
119119

120120
[Watch the **SAP CDS language support** extension for VS Code in action by DJ Adams.](https://www.youtube.com/watch?v=eY7BTzch8w0){.learn-more}
121121

122-
123122
### Features and Functions
124123

125-
#### Syntax Highlighting
124+
#### Syntax Coloring & Code Completion
125+
126+
<div class="cols-2">
127+
128+
<div>
126129

127-
#### Code Completion
130+
<video src="./assets/vscode/syntax-coloring-completions_compressed.mp4" autoplay loop muted webkit-playsinline playsinline />
131+
132+
</div>
133+
134+
<div>
128135

129136
- Keywords
130-
- Identifiers including not yet imported identifiers with corresponding `using` statement
131-
- Using paths and artifacts including showing README.md documentation as details
137+
- Annotations
138+
- Identifiers including ones defined in `using` references
139+
- `using` paths <!--and artifacts including _README.md_ documentation-->
132140
- i18n translation IDs
133-
- Turn on/off formatting regions
141+
<!-- - Turn on/off formatting regions -->
134142

135-
#### Where-used Navigation
143+
</div>
136144

137-
- Navigate to definitions
138-
- Navigate to references
139-
- Highlight occurrences
145+
</div>
140146

141-
#### Quick Fixes
147+
#### Snippets
148+
149+
<div class="cols-2">
150+
151+
<div>
152+
153+
<video src="./assets/vscode/snippets_compressed.mp4" autoplay loop muted webkit-playsinline playsinline />
154+
155+
</div>
156+
157+
<div>
158+
159+
- `using`
160+
- `namespace` and `context`
161+
- `service` and `type`
162+
- `entity` and `projection`
163+
- `Association` and `Composition`
164+
- `extend` and `annotate`
165+
- Elements
166+
- Annotations for documentation
167+
168+
</div>
169+
170+
</div>
142171

143-
+ Create using statement for unknown artifacts.
144-
+ Maintain missing translation.
145-
+ Convert `@cds.doc` and `@description` annotations to doc comments.
146172

147173
#### Code Formatting
148174

149-
Format...
175+
<div class="cols-2">
176+
177+
<div>
178+
179+
<video src="./assets/vscode/format_compressed.mp4" autoplay loop muted webkit-playsinline playsinline />
180+
181+
</div>
182+
183+
<div>
184+
150185
- the whole document
151186
- a selected range
152187
- on-the-fly when completing statements using ```;``` or ```}```
153188
- on save (depending on the IDE)
154189
- on paste (depending on the IDE)
155190

156-
Use...
191+
<!-- Use...
157192
- many options, configurable using
158193
- settings file
159194
- command line switches
160195
- config UI with simulation of options for VS Code
161196
- JSON schema for textual support
162-
- also for markdown in doc comments
197+
- also for markdown in doc comments -->
198+
199+
</div>
200+
201+
</div>
202+
203+
<!-- #### Inventory (symbols)
204+
205+
<div class="cols-2">
206+
207+
<div>
208+
209+
<video src="./assets/vscode/inventory_compressed.mp4" autoplay loop muted webkit-playsinline playsinline />
210+
211+
</div>
163212
164-
#### Inventory (symbols)
213+
<div>
165214
166215
- An inventory for the current file.
167216
- An inventory for the workspace including query capabilities to select. For example, artifact types, names, also include reuse models.
168217
169-
#### Snippets
170-
171-
- Namespace and context
172-
- `using`
173-
- `service`
174-
- `type`
175-
- Entity and projections, ...
176-
- Element, associations, and compositions
177-
- Extend and annotate
178-
- Annotations for documentation
218+
</div>
179219
180-
> With documentation extracts of [capire](../cds/cdl) explaining language concepts.
220+
</div> -->
181221

182222
#### Hover Information
183223

224+
<div class="cols-2">
225+
226+
<div>
227+
228+
<video src="./assets/vscode/hover_compressed.mp4" autoplay loop muted webkit-playsinline playsinline />
229+
230+
</div>
231+
232+
<div>
233+
184234
- Doc comments
185235
- `@title`, `@description`, and ~~`@cds.doc`~~ (deprecated) annotations
186236
- Translations
187237

238+
> With documentation extracts of [capire](../cds/cdl) explaining language concepts.
239+
240+
</div>
241+
242+
</div>
243+
244+
#### Where-used Navigation
245+
246+
<div class="cols-2">
247+
248+
<div>
249+
250+
<video src="./assets/vscode/where-used_compressed.mp4" autoplay loop muted webkit-playsinline playsinline />
251+
252+
</div>
253+
254+
<div>
255+
256+
- Navigate to definitions
257+
- Navigate to references
258+
- Highlight occurrences
259+
260+
</div>
261+
262+
</div>
263+
264+
#### Quick Fixes
265+
266+
<div class="cols-2">
267+
268+
<div>
269+
270+
<video src="./assets/vscode/quick-fixes_compressed.mp4" autoplay loop muted webkit-playsinline playsinline />
271+
272+
</div>
273+
274+
<div>
275+
276+
+ Create using statement for unknown artifacts.
277+
+ Maintain missing translation.
278+
+ Convert `@cds.doc` and `@description` annotations to doc comments.
279+
280+
</div>
281+
282+
</div>
283+
188284
#### Translation Support
189285

286+
<div class="cols-2">
287+
288+
<div>
289+
290+
<video src="./assets/vscode/translation-support_compressed.mp4" autoplay loop muted webkit-playsinline playsinline />
291+
292+
</div>
293+
294+
<div>
295+
190296
- Properties, JSON, and CSV files
191-
- Navigate to translation definitions from translation IDs like `'{i18n>customerName}'`.
192-
- Show translations on hover.
193-
- Quickfix to maintain missing translations
297+
- Navigate to translation definitions from translation IDs like `'{i18n>customerName}'`
298+
- Show translations on hover
299+
300+
</div>
301+
302+
</div>
194303

195304
#### And More…
196305

197306
- Plugin framework for external handlers of annotation domains
307+
- Dependency graph visualization
198308

199309

200310
### Settings
201311

202-
##### Code formatting settings
312+
##### Code formatting
203313

204314
These are settings coming with the CDS language server implementation.
205315
Use the command *CDS: Show Formatting Options Configuration*.
@@ -287,29 +397,14 @@ Use the command from the context menu on a folder or CDS file.
287397

288398
A selection popup appears to choose one of three modes:
289399

290-
1. _File to file_ (detailed)
291-
2. _File to file_ (reduced to folders)
292-
3. _Complete folder to complete folder_
293-
294-
The _first option_ shows every model file on its own.
295-
For very large models, the number of files and interdependencies may be too complex to be graphically shown.
296-
A message about insufficient memory will appear. In this case use the second option.
297-
298-
The _second option_ reduces the graph by only showing the folders of all involved files and their interdependencies.
299-
::: tip
300-
Only those files are evaluated that are reachable from the start model where the command was invoked on.
301-
:::
302-
303-
The _third option_ always considers all files in a folder and their dependencies.
400+
1. **_File to file_ (detailed)**: shows every model file on its own. For very large models, the number of files and interdependencies may be too complex to be graphically shown. A message about insufficient memory will appear. In this case use the second option.
401+
2. **_File to file_ (reduced to folders)**: reduces the graph by only showing the folders of all involved files and their interdependencies. Only the files reachable from the start model where the command was invoked on are evaluated.
402+
4. **_Complete folder to complete folder_**: always considers all files in a folder and their dependencies.
304403
This can be useful to understand architectural violations.
305-
> **Example for architectural violation:**<br>
306-
> You want a clean layering in your project: _app_ -> _srv_ -> _db_. With this option, you can visualize and identify that there is a dependency from a file in the service layer to an annotation file in the application layer.
307-
308-
309-
Hovering over a node will show the number of files involved and the combined size of all involved files. Use this function to get a rough understanding about the complexity and the compilation speed.
310-
311-
The command requires the third-party extension _Graphviz (dot) language support for Visual Studio Code_ (joaompinto.vscode-graphviz). If you haven't installed it already, it will be suggested to install.
404+
> **Example for architectural violation:**<br>
405+
> You want a clean layering in your project: _app__srv__db_. With this option, you can visualize and identify that there is a dependency from a file in the service layer to an annotation file in the application layer.
312406
407+
Hovering over a node will show the number of files involved and their combined size. Use this function to get a rough understanding about complexity and compilation speed.
313408

314409
### Editor Performance
315410

@@ -372,6 +467,21 @@ Use `-f` switch to force an overwrite without creating a backup.
372467
This is on your own risk. Should there be problems data loss might occur, especially when formatting in a pre-commit hook.
373468
Better add _.bak_ to your _.gitignore_ file and not use `-f`.
374469

470+
### GitHub Integration
471+
472+
CAP is registered with GitHub [`linguist`](https://github.com/github-linguist/linguist) repository, which means you can use Markdown rendering on GitHub in `cds` code fences like so:
473+
474+
````md
475+
```cds
476+
entity Books {};
477+
```
478+
````
479+
480+
This will render like so:
481+
```cds
482+
entity Books {};
483+
```
484+
375485

376486
## CAP Notebooks { #cap-vscode-notebook }
377487

0 commit comments

Comments
 (0)