File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed 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 { IFeature } from "../feature" ;
7
+ import { TextDocumentChangeEvent , workspace , Disposable } from "vscode" ;
8
+ import { LanguageClient } from "vscode-languageclient/lib/main" ;
9
+
10
+ export class HelpCompletionFeature implements IFeature {
11
+ private languageClient : LanguageClient ;
12
+ private triggerCharacters : string ;
13
+ private disposable : Disposable ;
14
+ constructor ( ) {
15
+ this . triggerCharacters = "#<" ;
16
+ let subscriptions = [ ] ;
17
+ workspace . onDidChangeTextDocument ( this . onEvent , this , subscriptions ) ;
18
+ this . disposable = Disposable . from ( ...subscriptions ) ;
19
+ }
20
+
21
+ setLanguageClient ( languageclient : LanguageClient ) {
22
+ this . languageClient = languageclient ;
23
+ }
24
+
25
+ dispose ( ) {
26
+
27
+ }
28
+
29
+ onEvent ( changeEvent : TextDocumentChangeEvent ) : void {
30
+ console . log ( `event triggered. change content: ${ changeEvent . contentChanges [ 0 ] . text } ` ) ;
31
+ }
32
+ }
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import { FindModuleFeature } from './features/PowerShellFindModule';
27
27
import { NewFileOrProjectFeature } from './features/NewFileOrProject' ;
28
28
import { ExtensionCommandsFeature } from './features/ExtensionCommands' ;
29
29
import { DocumentFormatterFeature } from './features/DocumentFormatter' ;
30
+ import { HelpCompletionFeature } from "./features/HelpCompletion" ;
30
31
31
32
// NOTE: We will need to find a better way to deal with the required
32
33
// PS Editor Services version...
@@ -117,7 +118,8 @@ export function activate(context: vscode.ExtensionContext): void {
117
118
new RemoteFilesFeature ( ) ,
118
119
new DebugSessionFeature ( sessionManager ) ,
119
120
new PickPSHostProcessFeature ( ) ,
120
- new SpecifyScriptArgsFeature ( context )
121
+ new SpecifyScriptArgsFeature ( context ) ,
122
+ new HelpCompletionFeature ( )
121
123
] ;
122
124
123
125
sessionManager . setExtensionFeatures ( extensionFeatures ) ;
You can’t perform that action at this time.
0 commit comments