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';
2727import { NewFileOrProjectFeature } from './features/NewFileOrProject' ;
2828import { ExtensionCommandsFeature } from './features/ExtensionCommands' ;
2929import { DocumentFormatterFeature } from './features/DocumentFormatter' ;
30+ import { HelpCompletionFeature } from "./features/HelpCompletion" ;
3031
3132// NOTE: We will need to find a better way to deal with the required
3233// PS Editor Services version...
@@ -117,7 +118,8 @@ export function activate(context: vscode.ExtensionContext): void {
117118 new RemoteFilesFeature ( ) ,
118119 new DebugSessionFeature ( sessionManager ) ,
119120 new PickPSHostProcessFeature ( ) ,
120- new SpecifyScriptArgsFeature ( context )
121+ new SpecifyScriptArgsFeature ( context ) ,
122+ new HelpCompletionFeature ( )
121123 ] ;
122124
123125 sessionManager . setExtensionFeatures ( extensionFeatures ) ;
You can’t perform that action at this time.
0 commit comments