Skip to content

Commit 90ba895

Browse files
committed
rename "global" prompts to "user" ones
1 parent 7585480 commit 90ba895

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

src/vs/platform/userDataSync/common/promptsSync/promptsSync.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function parsePrompts(syncData: ISyncData): IStringDictionary<string> {
3434
}
3535

3636
/**
37-
* Synchronizer class for the global prompt files.
37+
* Synchronizer class for the "user" prompt files.
3838
* Adopted from {@link SnippetsSynchroniser}.
3939
*/
4040
export class PromptsSynchronizer extends AbstractSynchroniser implements IUserDataSynchroniser {

src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/createPromptCommand.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ const BASE_COMMAND_ID = 'workbench.command.prompts.create';
3030
const LOCAL_COMMAND_ID = `${BASE_COMMAND_ID}.local`;
3131

3232
/**
33-
* Command ID for creating a 'global' prompt.
33+
* Command ID for creating a 'user' prompt.
3434
*/
35-
const GLOBAL_COMMAND_ID = `${BASE_COMMAND_ID}.global`;
35+
const USER_COMMAND_ID = `${BASE_COMMAND_ID}.user`;
3636

3737
/**
3838
* Title of the 'create local prompt' command.
3939
*/
4040
const LOCAL_COMMAND_TITLE = localize('commands.prompts.create.title.local', "Create Prompt");
4141

4242
/**
43-
* Title of the 'create global prompt' command.
43+
* Title of the 'create user prompt' command.
4444
*/
45-
const GLOBAL_COMMAND_TITLE = localize('commands.prompts.create.title.global', "Create Global Prompt");
45+
const USER_COMMAND_TITLE = localize('commands.prompts.create.title.user', "Create User Prompt");
4646

4747
/**
4848
* The command implementation.
@@ -95,7 +95,7 @@ const command = async (
9595
/**
9696
* Factory for creating the command handler with specific prompt `type`.
9797
*/
98-
const commandFactory = (type: 'local' | 'global') => {
98+
const commandFactory = (type: 'local' | 'user') => {
9999
return async (accessor: ServicesAccessor): Promise<void> => {
100100
return command(accessor, type);
101101
};
@@ -111,12 +111,12 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
111111
});
112112

113113
/**
114-
* Register the "Create Global Prompt" command.
114+
* Register the "Create User Prompt" command.
115115
*/
116116
KeybindingsRegistry.registerCommandAndKeybindingRule({
117-
id: GLOBAL_COMMAND_ID,
117+
id: USER_COMMAND_ID,
118118
weight: KeybindingWeight.WorkbenchContrib,
119-
handler: commandFactory('global'),
119+
handler: commandFactory('user'),
120120
});
121121

122122
/**
@@ -131,12 +131,12 @@ appendToCommandPalette(
131131
);
132132

133133
/**
134-
* Register the "Create Global Prompt" command in the command palette.
134+
* Register the "Create User Prompt" command in the command palette.
135135
*/
136136
appendToCommandPalette(
137137
{
138-
id: GLOBAL_COMMAND_ID,
139-
title: GLOBAL_COMMAND_TITLE,
138+
id: USER_COMMAND_ID,
139+
title: USER_COMMAND_TITLE,
140140
category: CHAT_CATEGORY,
141141
},
142142
);

src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptName.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { IQuickInputService } from '../../../../../../../../platform/quickinput/
1111
* Asks the user for a prompt name.
1212
*/
1313
export const askForPromptName = async (
14-
_type: 'local' | 'global',
14+
_type: 'local' | 'user',
1515
quickInputService: IQuickInputService,
1616
): Promise<string | undefined> => {
1717
const result = await quickInputService.input(

src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptSourceFolder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface IAskForFolderOptions {
2121
/**
2222
* Prompt type.
2323
*/
24-
readonly type: 'local' | 'global';
24+
readonly type: 'local' | 'user';
2525

2626
readonly labelService: ILabelService;
2727
readonly openerService: IOpenerService;

src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ export class PromptsService extends Disposable implements IPromptsService {
8282
}
8383

8484
public async listPromptFiles(): Promise<readonly IPromptPath[]> {
85-
const globalLocations = [this.userDataService.currentProfile.promptsHome];
85+
const userLocations = [this.userDataService.currentProfile.promptsHome];
8686

8787
const prompts = await Promise.all([
88-
this.fileLocator.listFilesIn(globalLocations, [])
89-
.then(withType('global')),
88+
this.fileLocator.listFilesIn(userLocations, [])
89+
.then(withType('user')),
9090
this.fileLocator.listFiles([])
9191
.then(withType('local')),
9292
]);
@@ -100,11 +100,11 @@ export class PromptsService extends Disposable implements IPromptsService {
100100
// sanity check to make sure we don't miss a new prompt type
101101
// added in the future
102102
assert(
103-
type === 'local' || type === 'global',
103+
type === 'local' || type === 'user',
104104
`Unknown prompt type '${type}'.`,
105105
);
106106

107-
const prompts = (type === 'global')
107+
const prompts = (type === 'user')
108108
? [this.userDataService.currentProfile.promptsHome]
109109
: this.fileLocator.getConfigBasedSourceFolders();
110110

@@ -116,7 +116,7 @@ export class PromptsService extends Disposable implements IPromptsService {
116116
* Utility to add a provided prompt `type` to a prompt URI.
117117
*/
118118
const addType = (
119-
type: 'local' | 'global',
119+
type: 'local' | 'user',
120120
): (uri: URI) => IPromptPath => {
121121
return (uri) => {
122122
return { uri, type: type };
@@ -127,7 +127,7 @@ const addType = (
127127
* Utility to add a provided prompt `type` to a list of prompt URIs.
128128
*/
129129
const withType = (
130-
type: 'local' | 'global',
130+
type: 'local' | 'user',
131131
): (uris: readonly URI[]) => (readonly IPromptPath[]) => {
132132
return (uris) => {
133133
return uris

src/vs/workbench/contrib/chat/common/promptSyntax/service/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ export const IPromptsService = createDecorator<IPromptsService>('IPromptsService
1717
/**
1818
* Supported prompt types.
1919
* - `local` means the prompt is a local file.
20-
* - `global` means a "roamble" prompt file (similar to snippets).
20+
* - `user` means a "roamble" prompt file (similar to snippets).
2121
*/
22-
type TPromptsType = 'local' | 'global';
22+
type TPromptsType = 'local' | 'user';
2323

2424
/**
2525
* Represents a prompt path with its type.

0 commit comments

Comments
 (0)