File tree Expand file tree Collapse file tree 4 files changed +17
-8
lines changed Expand file tree Collapse file tree 4 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 1+ declare module '@playlyfe/gql-language-server' {
2+ export function findConfigFile ( path : string ) : string ;
3+ }
Original file line number Diff line number Diff line change @@ -69,8 +69,6 @@ export default class ClientStatusBarItem {
6969 this . _disposables . forEach ( item => {
7070 item . dispose ( ) ;
7171 } ) ;
72- this . _item = null ;
73- this . _client = null ;
7472 }
7573
7674 private _registerStatusChangeListeners ( ) {
@@ -101,11 +99,15 @@ export default class ClientStatusBarItem {
10199 return disposable ;
102100 }
103101
104- private _updateVisibility = ( textEditor : TextEditor ) => {
102+ private _updateVisibility = ( textEditor : TextEditor | undefined ) => {
105103 let hide = true ;
106104
107105 if ( textEditor ) {
108- if ( this . _client . initializeResult ) {
106+ const workspaceFolder = workspace . getWorkspaceFolder (
107+ textEditor . document . uri ,
108+ ) ;
109+
110+ if ( this . _client . initializeResult && workspaceFolder ) {
109111 // if client is initialized then show only for file extensions
110112 // defined in .gqlconfig
111113 // @TODO : if possible, match against patterns defined in .gqlconfig
@@ -115,7 +117,7 @@ export default class ClientStatusBarItem {
115117 {
116118 scheme : 'file' ,
117119 pattern : new RelativePattern (
118- workspace . getWorkspaceFolder ( textEditor . document . uri ) ,
120+ workspaceFolder ,
119121 `**/*.{${ extensions . join ( ',' ) } }` ,
120122 ) ,
121123 } ,
Original file line number Diff line number Diff line change @@ -39,14 +39,16 @@ export function activate(context: ExtensionContext) {
3939export function deactivate ( ) : Thenable < void > {
4040 const promises : Array < Thenable < void > > = [ ] ;
4141 clients . forEach ( client => {
42- promises . push ( client . dispose ( ) ) ;
42+ if ( client ) {
43+ promises . push ( client . dispose ( ) ) ;
44+ }
4345 } ) ;
4446 return Promise . all ( promises ) . then ( ( ) => undefined ) ;
4547}
4648
4749function createClientForWorkspaces ( ) {
4850 const workspaceFolders = Workspace . workspaceFolders || [ ] ;
49- const workspaceFoldersIndex = { } ;
51+ const workspaceFoldersIndex : { [ key : string ] : boolean } = { } ;
5052
5153 workspaceFolders . forEach ( folder => {
5254 const key = folder . uri . toString ( ) ;
Original file line number Diff line number Diff line change 55 "moduleResolution" : " node" ,
66 "lib" : [ " es6" ],
77 "outDir" : " ../out" ,
8- "sourceMap" : true
8+ "sourceMap" : true ,
9+ "noImplicitAny" : true ,
10+ "strictNullChecks" : true
911 }
1012}
You can’t perform that action at this time.
0 commit comments