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,16 @@ 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 }
3032
31- get tooltip ( ) : string {
32- return `${ this . label } -${ this . value } ` ;
33- }
3433
35- get description ( ) : string {
36- return this . value ;
37- }
3834}
3935
4036interface PuppetFactResponse {
@@ -53,7 +49,7 @@ export class PuppetFactsProvider implements TreeDataProvider<PuppetFact> {
5349 }
5450
5551 refresh ( ) : void {
56- this . _onDidChangeTreeData . fire ( ) ;
52+ this . _onDidChangeTreeData . fire ( undefined ) ;
5753 }
5854
5955 getTreeItem ( element : PuppetFact ) : TreeItem | Thenable < PuppetFact > {
@@ -75,10 +71,10 @@ export class PuppetFactsProvider implements TreeDataProvider<PuppetFact> {
7571 if we didn't cache, we would have to call out for each expand and getting
7672 facts is slow.
7773 */
78- await this . handler . languageClient . onReady ( ) ;
74+ await this . handler . languageClient . start ( ) ;
7975
8076 const details = await this . handler . languageClient . sendRequest (
81- new RequestType0 < PuppetVersionDetails , void , void > ( 'puppet/getVersion' ) ,
77+ new RequestType0 < PuppetVersionDetails , void > ( 'puppet/getVersion' ) ,
8278 ) ;
8379 if ( ! details . factsLoaded ) {
8480 // language server is ready, but hasn't loaded facts yet
@@ -90,7 +86,7 @@ export class PuppetFactsProvider implements TreeDataProvider<PuppetFact> {
9086 clearInterval ( handle ) ;
9187
9288 const results = await this . handler . languageClient . sendRequest (
93- new RequestType0 < PuppetFactResponse , void , void > ( 'puppet/getFacts' ) ,
89+ new RequestType0 < PuppetFactResponse , void > ( 'puppet/getFacts' ) ,
9490 ) ;
9591 this . elements = this . toList ( results . facts ) ;
9692
@@ -102,13 +98,13 @@ export class PuppetFactsProvider implements TreeDataProvider<PuppetFact> {
10298 }
10399
104100 const details = await this . handler . languageClient . sendRequest (
105- new RequestType0 < PuppetVersionDetails , void , void > ( 'puppet/getVersion' ) ,
101+ new RequestType0 < PuppetVersionDetails , void > ( 'puppet/getVersion' ) ,
106102 ) ;
107103 if ( details . factsLoaded ) {
108104 clearInterval ( handle ) ;
109105
110106 const results = await this . handler . languageClient . sendRequest (
111- new RequestType0 < PuppetFactResponse , void , void > ( 'puppet/getFacts' ) ,
107+ new RequestType0 < PuppetFactResponse , void > ( 'puppet/getFacts' ) ,
112108 ) ;
113109 this . elements = this . toList ( results . facts ) ;
114110
@@ -125,7 +121,7 @@ export class PuppetFactsProvider implements TreeDataProvider<PuppetFact> {
125121 }
126122
127123 const results = await this . handler . languageClient . sendRequest (
128- new RequestType0 < PuppetFactResponse , void , void > ( 'puppet/getFacts' ) ,
124+ new RequestType0 < PuppetFactResponse , void > ( 'puppet/getFacts' ) ,
129125 ) ;
130126 this . elements = this . toList ( results . facts ) ;
131127
0 commit comments