You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: initial files for static site on GitHub Pages
Extension has rich functionality, so it should have a good
documentation so users can understand how to use it.
For this documentation will be updated and stored in 'docs' directory.
Also, there will be a static web-site in 'Read-the-docs' format hosted
on GitHub Pages.
This commit adds first pages with configuration file explaining.
Copy file name to clipboardExpand all lines: docs/configuration.md
+39-14Lines changed: 39 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,41 @@
1
-
# Configuration file
1
+
# Configuration
2
2
3
-
Extension has config file with custom settings - `.vscode/pgsql_hacker_helper.json`.
3
+
Extension has multiple settings to customize different aspects.
4
+
5
+
## VS Code settings
6
+
7
+
There are 3 settings:
8
+
9
+
-`postgresql-hacker-helper.logLevel` - minimum log level (for old VS Code up to 1.74.0).
10
+
11
+
Minimum level of log messages. By default - `INFO`.
12
+
If using VS Code 1.74.0 ang greater use `Output` channel logger settings.
4
13
5
-
> For convenience, file [`properties.schema.json`](../properties.schema.json) contains JSON schema for configuration file.
14
+
-`postgresql-hacker-helper.srcPath` - Path to source code directory
15
+
16
+
*Relative* path to custom PostgreSQL source code directory. Use it, if source
17
+
code files are not in your workspace root (i.e. in `${workspaceFolder}/postgresql`).
18
+
Used for searching files (node tag files, `pg_bsd_indent` and so on).
19
+
If not specified search starts from workspace root.
20
+
21
+
-`postgresql-hacker-helper.pg_bsd_indentPath` - Path to `pg_bsd_indent`
22
+
23
+
Path to `pg_bsd_indent` tool. Required for formatting support. Use it if you have `pg_bsd_indent` installed globally or want to use specific version.
24
+
25
+
- If not specified, it will be searched in `*srcPath*/src/tools` directory.
26
+
- If specified, and failed to run extension will try to build it.
27
+
28
+
## Configuration file
29
+
30
+
Extension has config file with custom settings - `.vscode/pgsql_hacker_helper.json`.
6
31
7
32
You can create file manually or using command `PgSQL: Open or create configuration file`. Json schema will assist you while editing.
8
33
9
34
Extension tracks changes in the file and rereads it, when necessary. Also, you can run `PgSQL: Refresh configuration file` command.
10
35
11
36
> NOTE: after debug session have started changes in configuration file will not be reflected.
12
37
13
-
## Arrays
38
+
###Arrays
14
39
15
40
```json
16
41
{
@@ -78,7 +103,7 @@ NOTES:
78
103
1. You can refer to parent object using `{}`, i.e. `!{}->member1 + {}->member2` or the same in member form `member1 + {}->member2`.
79
104
2. Expression can contain any other entries, i.e. for `PlannerInfo->simple_rel_array` expression is `simple_rel_array_size + 1`.
80
105
81
-
## Aliases (`typedef`)
106
+
###Aliases (`typedef`)
82
107
83
108
```json
84
109
{
@@ -113,7 +138,7 @@ For it you can use this entry:
113
138
}
114
139
```
115
140
116
-
## Custom `List *` pointer types
141
+
###Custom `List *` pointer types
117
142
118
143
```json
119
144
{
@@ -185,9 +210,9 @@ void do_work()
185
210
186
211
> As you can mention, configuration is generalized, because it's clear from context how to handle `parent`
187
212
188
-
## HashTable entries
213
+
### HashTable entries
189
214
190
-
### `HTAB`
215
+
#### `HTAB`
191
216
192
217
```json
193
218
{
@@ -250,7 +275,7 @@ void do_work()
250
275
251
276
> You can notice that configuration entry schema is the same as for custom `List *` type.
252
277
253
-
### `_hash` - simplehash
278
+
####`_hash` - simplehash
254
279
255
280
```json
256
281
{
@@ -298,7 +323,7 @@ Identifiers of structures and functions are derived from `prefix` and generated
298
323
> NOTE: compiler can apply unused symbol stripping, so after compilation there can be no structures/functions for iteration.
299
324
> In such situation, you should add some code that uses `PREFIX_iterator`, `PREFIX_start_iterate` and `PREFIX_iterate` (i.e. wrap such code with debug macros).
> NOTE: macro definitions are added to debug symbols only when using `-g3` level during compilation, otherwise debugger can not use macro names.
373
398
> If debugger can not use macros it will switch to numeric values - that because numeric values are required.
374
399
375
-
## NodeTags
400
+
###NodeTags
376
401
377
402
```json
378
403
{
@@ -389,7 +414,7 @@ NodeTag values are required to find Node types. Extension ships with set of buil
389
414
390
415
Also, when debug session starts, extension will parse `nodetags.h` file to find new NodeTags. If it will find some, then extension will automatically add them to this list.
391
416
392
-
## Custom `typedefs.list`
417
+
###Custom `typedefs.list`
393
418
394
419
```json
395
420
{
@@ -404,7 +429,7 @@ For formatting `src/tools/pgindent` is used. It requires `typedefs.list` file fo
404
429
`typedefs` setting contains list of `typedefs.list` files - each string is a path which can be in 2 forms:
405
430
406
431
- Absolute - specified file is used
407
-
- Relative - file with base folder as [postgresql-hacker-helper.srcPath](../README.md#extension-settings) is used
432
+
- Relative - file with base folder as [postgresql-hacker-helper.srcPath](#vs-code-settings) is used
408
433
409
434
Example:
410
435
@@ -417,6 +442,6 @@ Example:
417
442
}
418
443
```
419
444
420
-
For convenience, if you will try to format file in contrib's directory, extension will try to detect `typedefs.list` in it without specifying it explicitly in configuration file.
445
+
For convenience, if you will try to format file in contrib's directory, extension will try to detect `typedefs.list` in it without specifying it explicitly in configuration file. I.e. if you are formatting file `contrib/my_ext/my_ext.c`, then extension will probe `contrib/my_ext/typedefs.list`.
421
446
422
447
> There is handy command `PgSQL: Find custom typedefs.list in repository` that will execute shell command to find all `*typedefs.list` files in repository.
0 commit comments