3
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
- import { IConfigurationService } from '../../configuration/common/configuration.js' ;
7
6
import { ContextKeyExpr } from '../../contextkey/common/contextkey.js' ;
8
-
9
- // TODO: @lego - update the docs
10
- // TODO: @lego - update unit tests
7
+ import { IConfigurationService } from '../../configuration/common/configuration.js' ;
11
8
12
9
/**
13
10
* Configuration helper for the `reusable prompts` feature.
14
11
* @see {@link CONFIG_KEY } and {@link LOCATIONS_CONFIG_KEY }.
15
12
*
16
13
* ### Functions
17
14
*
18
- * - {@link getLocationsValue} allows to current read configuration value
19
15
* - {@link enabled} allows to check if the feature is enabled
16
+ * - {@link getLocationsValue} allows to current read configuration value
20
17
* - {@link promptSourceFolders} gets list of source folders for prompt files
21
18
*
22
- * ### Configuration Examples
23
- *
24
- * Enable the feature using the default `'.github/prompts'` folder as a source of prompt files:
25
- * ```json
26
- * {
27
- * "chat.promptFiles": {},
28
- * }
29
- * ```
30
- *
31
- * Enable the feature, providing multiple source folder paths for prompt files,
32
- * in addition to the default `'.github/prompts'` one:
33
- * ```json
34
- * {
35
- * "chat.promptFiles": {
36
- * ".copilot/prompts" : false,
37
- * "/Users/legomushroom/repos/prompts" : true,
38
- * },
39
- * }
40
- * ```
41
- *
42
- * See the next section for details on how we treat the config value.
43
- *
44
- * ### Possible Values
45
- *
46
- * - `undefined`/`null`: feature is disabledx
47
- * - `object`:
48
- * - expects the { "string": `boolean` } pairs, where the `string` is a path and the `boolean`
49
- * is a flag that defines if this additional source folder is enabled or disabled;
50
- * enabled source folders are used in addition to the default {@link DEFAULT_SOURCE_FOLDER} path;
51
- * you can explicitly disable the default source folder by setting it to `false` in the object
52
- * - value of a record in the object can also be a `string`:
53
- * - if the string can be clearly mapped to a `boolean` (e.g., `"true"`, `"FALSE", "TrUe"`, etc.),
54
- * it is treated as `boolean` value
55
- * - any other string value is treated as `false` and is effectively ignored
56
- * - if the record `key` is an `empty` string, it is ignored
57
- * - if the resulting object is empty, the feature is considered `enabled`, prompt files source
58
- * folders fallback to the default {@link DEFAULT_SOURCE_FOLDER} path
59
- * - if the resulting object is not empty, and the default {@link DEFAULT_SOURCE_FOLDER} path
60
- * is not explicitly disabled, it is added to the list of prompt files source folders
61
- *
62
19
* ### File Paths Resolution
63
20
*
64
21
* We resolve only `*.prompt.md` files inside the resulting source folders. Relative paths are resolved
@@ -74,12 +31,12 @@ export namespace PromptsConfig {
74
31
* Configuration key for the `reusable prompts` feature
75
32
* (also known as `prompt files`, `prompt instructions`, etc.).
76
33
*/
77
- export const CONFIG_KEY : string = 'chat.reusablePrompts ' ;
34
+ export const CONFIG_KEY : string = 'chat.promptFiles ' ;
78
35
79
36
/**
80
37
* Configuration key for the locations of reusable prompt files.
81
38
*/
82
- export const LOCATIONS_CONFIG_KEY : string = 'chat.reusablePromptsLocations ' ;
39
+ export const LOCATIONS_CONFIG_KEY : string = 'chat.promptFilesLocations ' ;
83
40
84
41
/**
85
42
* Default reusable prompt files source folder.
0 commit comments