88 TreeItem ,
99 TreeItemCollapsibleState ,
1010} from 'vscode' ;
11- import { RequestType0 } from 'vscode-languageclient' ;
11+ import { RequestType0 } from 'vscode-languageclient/node ' ;
1212import { ConnectionHandler } from '../handler' ;
1313import { PuppetVersionDetails } from '../messages' ;
1414import { reporter } from '../telemetry' ;
@@ -21,20 +21,14 @@ class PuppetFact extends TreeItem {
2121 public readonly children ?: Array < [ string , PuppetFact ] > ,
2222 ) {
2323 super ( label , collapsibleState ) ;
24+ this . tooltip = `${ this . label } -${ this . value } ` ;
25+ this . description = this . value ;
2426 if ( children ) {
2527 this . iconPath = ThemeIcon . Folder ;
2628 } else {
2729 this . iconPath = ThemeIcon . File ;
2830 }
2931 }
30-
31- get tooltip ( ) : string {
32- return `${ this . label } -${ this . value } ` ;
33- }
34-
35- get description ( ) : string {
36- return this . value ;
37- }
3832}
3933
4034interface PuppetFactResponse {
@@ -53,7 +47,7 @@ export class PuppetFactsProvider implements TreeDataProvider<PuppetFact> {
5347 }
5448
5549 refresh ( ) : void {
56- this . _onDidChangeTreeData . fire ( ) ;
50+ this . _onDidChangeTreeData . fire ( undefined ) ;
5751 }
5852
5953 getTreeItem ( element : PuppetFact ) : TreeItem | Thenable < PuppetFact > {
@@ -75,10 +69,10 @@ export class PuppetFactsProvider implements TreeDataProvider<PuppetFact> {
7569 if we didn't cache, we would have to call out for each expand and getting
7670 facts is slow.
7771 */
78- await this . handler . languageClient . onReady ( ) ;
72+ await this . handler . languageClient . start ( ) ;
7973
8074 const details = await this . handler . languageClient . sendRequest (
81- new RequestType0 < PuppetVersionDetails , void , void > ( 'puppet/getVersion' ) ,
75+ new RequestType0 < PuppetVersionDetails , void > ( 'puppet/getVersion' ) ,
8276 ) ;
8377 if ( ! details . factsLoaded ) {
8478 // language server is ready, but hasn't loaded facts yet
@@ -90,7 +84,7 @@ export class PuppetFactsProvider implements TreeDataProvider<PuppetFact> {
9084 clearInterval ( handle ) ;
9185
9286 const results = await this . handler . languageClient . sendRequest (
93- new RequestType0 < PuppetFactResponse , void , void > ( 'puppet/getFacts' ) ,
87+ new RequestType0 < PuppetFactResponse , void > ( 'puppet/getFacts' ) ,
9488 ) ;
9589 this . elements = this . toList ( results . facts ) ;
9690
@@ -102,13 +96,13 @@ export class PuppetFactsProvider implements TreeDataProvider<PuppetFact> {
10296 }
10397
10498 const details = await this . handler . languageClient . sendRequest (
105- new RequestType0 < PuppetVersionDetails , void , void > ( 'puppet/getVersion' ) ,
99+ new RequestType0 < PuppetVersionDetails , void > ( 'puppet/getVersion' ) ,
106100 ) ;
107101 if ( details . factsLoaded ) {
108102 clearInterval ( handle ) ;
109103
110104 const results = await this . handler . languageClient . sendRequest (
111- new RequestType0 < PuppetFactResponse , void , void > ( 'puppet/getFacts' ) ,
105+ new RequestType0 < PuppetFactResponse , void > ( 'puppet/getFacts' ) ,
112106 ) ;
113107 this . elements = this . toList ( results . facts ) ;
114108
@@ -125,7 +119,7 @@ export class PuppetFactsProvider implements TreeDataProvider<PuppetFact> {
125119 }
126120
127121 const results = await this . handler . languageClient . sendRequest (
128- new RequestType0 < PuppetFactResponse , void , void > ( 'puppet/getFacts' ) ,
122+ new RequestType0 < PuppetFactResponse , void > ( 'puppet/getFacts' ) ,
129123 ) ;
130124 this . elements = this . toList ( results . facts ) ;
131125
0 commit comments