diff options
Diffstat (limited to 'src/vs/workbench/contrib/snippets/browser/snippets.ts')
-rw-r--r-- | src/vs/workbench/contrib/snippets/browser/snippets.ts | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/vs/workbench/contrib/snippets/browser/snippets.ts b/src/vs/workbench/contrib/snippets/browser/snippets.ts new file mode 100644 index 00000000000..fa485ab0f2f --- /dev/null +++ b/src/vs/workbench/contrib/snippets/browser/snippets.ts @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { SnippetFile, Snippet } from 'vs/workbench/contrib/snippets/browser/snippetsFile'; + +export const ISnippetsService = createDecorator<ISnippetsService>('snippetService'); + +export interface ISnippetGetOptions { + includeDisabledSnippets?: boolean; + includeNoPrefixSnippets?: boolean; + noRecencySort?: boolean; + topLevelSnippets?: boolean; +} + +export interface ISnippetsService { + + readonly _serviceBrand: undefined; + + getSnippetFiles(): Promise<Iterable<SnippetFile>>; + + isEnabled(snippet: Snippet): boolean; + + updateEnablement(snippet: Snippet, enabled: boolean): void; + + updateUsageTimestamp(snippet: Snippet): void; + + getSnippets(languageId: string | undefined, opt?: ISnippetGetOptions): Promise<Snippet[]>; + + getSnippetsSync(languageId: string, opt?: ISnippetGetOptions): Snippet[]; +} |