Skip to content

Commit 33a53aa

Browse files
committed
update docs of the config module, use the current prompt files public feature name
1 parent 45aaeff commit 33a53aa

File tree

3 files changed

+10
-54
lines changed

3 files changed

+10
-54
lines changed

src/vs/platform/prompts/common/config.ts

Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,62 +3,19 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { IConfigurationService } from '../../configuration/common/configuration.js';
76
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';
118

129
/**
1310
* Configuration helper for the `reusable prompts` feature.
1411
* @see {@link CONFIG_KEY} and {@link LOCATIONS_CONFIG_KEY}.
1512
*
1613
* ### Functions
1714
*
18-
* - {@link getLocationsValue} allows to current read configuration value
1915
* - {@link enabled} allows to check if the feature is enabled
16+
* - {@link getLocationsValue} allows to current read configuration value
2017
* - {@link promptSourceFolders} gets list of source folders for prompt files
2118
*
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-
*
6219
* ### File Paths Resolution
6320
*
6421
* We resolve only `*.prompt.md` files inside the resulting source folders. Relative paths are resolved
@@ -74,12 +31,12 @@ export namespace PromptsConfig {
7431
* Configuration key for the `reusable prompts` feature
7532
* (also known as `prompt files`, `prompt instructions`, etc.).
7633
*/
77-
export const CONFIG_KEY: string = 'chat.reusablePrompts';
34+
export const CONFIG_KEY: string = 'chat.promptFiles';
7835

7936
/**
8037
* Configuration key for the locations of reusable prompt files.
8138
*/
82-
export const LOCATIONS_CONFIG_KEY: string = 'chat.reusablePromptsLocations';
39+
export const LOCATIONS_CONFIG_KEY: string = 'chat.promptFilesLocations';
8340

8441
/**
8542
* Default reusable prompt files source folder.

src/vs/platform/prompts/test/common/config.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const createMock = <T>(value: T): IConfigurationService => {
3434
suite('PromptsConfig', () => {
3535
ensureNoDisposablesAreLeakedInTestSuite();
3636

37-
suite('• getValue', () => {
37+
suite('• getLocationsValue', () => {
3838
test('• undefined', () => {
3939
const configService = createMock(undefined);
4040

src/vs/workbench/contrib/chat/browser/chat.contribution.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,25 +203,24 @@ configurationRegistry.registerConfiguration({
203203
type: 'boolean',
204204
title: nls.localize(
205205
'chat.reusablePrompts.config.enabled.title',
206-
"Reusable Prompts",
206+
"Prompt Files",
207207
),
208208
markdownDescription: nls.localize(
209209
'chat.reusablePrompts.config.enabled.description',
210-
"Enable reusable prompts (`*{0}`) in Chat, Edits, and Inline Chat sessions. [Learn More]({0}).",
210+
"Enable reusable prompt files (`*{0}`) in Chat, Edits, and Inline Chat sessions. [Learn More]({0}).",
211211
PROMPT_FILE_EXTENSION,
212212
DOCUMENTATION_URL,
213213
),
214214
default: true,
215215
restricted: true,
216216
disallowConfigurationDefault: true,
217-
tags: ['experimental'],
217+
tags: ['experimental', 'prompts', 'reusable prompts', 'prompt snippets', 'instructions'],
218218
},
219-
// TODO: @lego - add more tags?
220219
[PromptsConfig.LOCATIONS_CONFIG_KEY]: {
221220
type: 'object',
222221
title: nls.localize(
223222
'chat.reusablePrompts.config.locations.title',
224-
"Reusable Prompt Locations",
223+
"Prompt File Locations",
225224
),
226225
markdownDescription: nls.localize(
227226
'chat.reusablePrompts.config.locations.description',
@@ -237,7 +236,7 @@ configurationRegistry.registerConfiguration({
237236
unevaluatedProperties: { type: 'boolean' },
238237
restricted: true,
239238
disallowConfigurationDefault: true,
240-
tags: ['experimental'],
239+
tags: ['experimental', 'prompts', 'reusable prompts', 'prompt snippets', 'instructions'],
241240
examples: [
242241
{
243242
[PromptsConfig.DEFAULT_SOURCE_FOLDER]: true,

0 commit comments

Comments
 (0)