File tree 3 files changed +39
-1
lines changed
3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 27
27
"main" : " ./out/main" ,
28
28
"activationEvents" : [
29
29
" onLanguage:powershell" ,
30
- " onCommand:PowerShell.NewProjectFromTemplate"
30
+ " onCommand:PowerShell.NewProjectFromTemplate" ,
31
+ " onCommand:PowerShell.OpenExamplesFolder"
31
32
],
32
33
"dependencies" : {
33
34
"vscode-languageclient" : " 1.3.1"
139
140
"command" : " PowerShell.NewProjectFromTemplate" ,
140
141
"title" : " Create New Project from Plaster Template" ,
141
142
"category" : " PowerShell"
143
+ },
144
+ {
145
+ "command" : " PowerShell.OpenExamplesFolder" ,
146
+ "title" : " Open Examples Folder" ,
147
+ "category" : " PowerShell"
142
148
}
143
149
],
144
150
"snippets" : [
Original file line number Diff line number Diff line change
1
+ /*---------------------------------------------------------
2
+ * Copyright (C) Microsoft Corporation. All rights reserved.
3
+ *--------------------------------------------------------*/
4
+
5
+ import vscode = require( 'vscode' ) ;
6
+ import path = require( 'path' ) ;
7
+ import { IFeature } from '../feature' ;
8
+ import { LanguageClient } from 'vscode-languageclient' ;
9
+
10
+ export class ExamplesFeature implements IFeature {
11
+ private command : vscode . Disposable ;
12
+ private examplesPath : string ;
13
+
14
+ constructor ( ) {
15
+ this . examplesPath = path . resolve ( __dirname , "../../examples" ) ;
16
+ this . command = vscode . commands . registerCommand ( 'PowerShell.OpenExamplesFolder' , ( ) => {
17
+ vscode . commands . executeCommand (
18
+ "vscode.openFolder" ,
19
+ vscode . Uri . file ( this . examplesPath ) ,
20
+ true ) ;
21
+ } ) ;
22
+ }
23
+
24
+ public setLanguageClient ( languageclient : LanguageClient ) {
25
+ }
26
+
27
+ public dispose ( ) {
28
+ this . command . dispose ( ) ;
29
+ }
30
+ }
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { IFeature } from './feature';
10
10
import { SessionManager } from './session' ;
11
11
import { PowerShellLanguageId } from './utils' ;
12
12
import { ConsoleFeature } from './features/Console' ;
13
+ import { ExamplesFeature } from './features/Examples' ;
13
14
import { OpenInISEFeature } from './features/OpenInISE' ;
14
15
import { NewFileOrProjectFeature } from './features/NewFileOrProject' ;
15
16
import { ExpandAliasFeature } from './features/ExpandAlias' ;
@@ -88,6 +89,7 @@ export function activate(context: vscode.ExtensionContext): void {
88
89
// Create features
89
90
extensionFeatures = [
90
91
new ConsoleFeature ( ) ,
92
+ new ExamplesFeature ( ) ,
91
93
new OpenInISEFeature ( ) ,
92
94
new ExpandAliasFeature ( ) ,
93
95
new ShowHelpFeature ( ) ,
You can’t perform that action at this time.
0 commit comments