33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55'use strict' ;
6-
7- import 'vs/workbench/parts/snippets/electron-browser/snippetsService' ;
8- import 'vs/workbench/parts/snippets/electron-browser/insertSnippet' ;
9- import 'vs/workbench/parts/snippets/electron-browser/tabCompletion' ;
10-
116import { CommandsRegistry } from 'vs/platform/commands/common/commands' ;
127import { fileExists , writeFile } from 'vs/base/node/pfs' ;
138import { IEnvironmentService } from 'vs/platform/environment/common/environment' ;
@@ -21,10 +16,31 @@ import { Registry } from 'vs/platform/registry/common/platform';
2116import * as errors from 'vs/base/common/errors' ;
2217import * as JSONContributionRegistry from 'vs/platform/jsonschemas/common/jsonContributionRegistry' ;
2318import * as nls from 'vs/nls' ;
24- import * as snippetsTracker from './snippetsTracker' ;
25- import * as tmSnippets from './TMSnippets' ;
26- import * as winjs from 'vs/base/common/winjs.base' ;
27- import * as workbenchContributions from 'vs/workbench/common/contributions' ;
19+ import { createDecorator } from 'vs/platform/instantiation/common/instantiation' ;
20+ import { LanguageId } from 'vs/editor/common/modes' ;
21+ import { TPromise } from 'vs/base/common/winjs.base' ;
22+
23+ export const ISnippetsService = createDecorator < ISnippetsService > ( 'snippetService' ) ;
24+
25+ export interface ISnippetsService {
26+
27+ _serviceBrand : any ;
28+
29+ getSnippets ( languageId : LanguageId ) : TPromise < ISnippet [ ] > ;
30+
31+ getSnippetsSync ( languageId : LanguageId ) : ISnippet [ ] ;
32+ }
33+
34+
35+ export interface ISnippet {
36+ readonly name : string ;
37+ readonly prefix : string ;
38+ readonly description : string ;
39+ readonly codeSnippet : string ;
40+ readonly source : string ;
41+ readonly isBogous ?: boolean ;
42+ readonly isFromExtension ?: boolean ;
43+ }
2844
2945namespace OpenSnippetsAction {
3046
@@ -37,7 +53,7 @@ namespace OpenSnippetsAction {
3753 const environmentService = accessor . get ( IEnvironmentService ) ;
3854 const windowsService = accessor . get ( IWindowsService ) ;
3955
40- function openFile ( filePath : string ) : winjs . TPromise < void > {
56+ function openFile ( filePath : string ) : TPromise < void > {
4157 return windowsService . openWindow ( [ filePath ] , { forceReuseWindow : true } ) ;
4258 }
4359
@@ -86,7 +102,7 @@ namespace OpenSnippetsAction {
86102 } ) ;
87103 } ) ;
88104 }
89- return winjs . TPromise . as ( null ) ;
105+ return TPromise . as ( null ) ;
90106 } ) ;
91107 } ) ;
92108
@@ -136,11 +152,3 @@ const schema: IJSONSchema = {
136152Registry
137153 . as < JSONContributionRegistry . IJSONContributionRegistry > ( JSONContributionRegistry . Extensions . JSONContribution )
138154 . registerSchema ( schemaId , schema ) ;
139-
140- Registry
141- . as < workbenchContributions . IWorkbenchContributionsRegistry > ( workbenchContributions . Extensions . Workbench )
142- . registerWorkbenchContribution ( snippetsTracker . SnippetsTracker ) ;
143-
144- Registry
145- . as < workbenchContributions . IWorkbenchContributionsRegistry > ( workbenchContributions . Extensions . Workbench )
146- . registerWorkbenchContribution ( tmSnippets . MainProcessTextMateSnippet ) ;
0 commit comments