@@ -202,23 +202,21 @@ export function activate(context: ExtensionContext) {
202
202
clientConfig [ 'clientVersion' ] = VERSION
203
203
let args = [ '--language-server' ] . concat ( clientConfig [ 'launchArgs' ] ) ;
204
204
205
- let env : any = { }
206
- let kToFoward = [
205
+ let env : any = { } ;
206
+ let kToForward = [
207
207
'ProgramData' ,
208
208
'PATH' ,
209
209
] ;
210
- for ( let e of kToFoward )
211
- env [ e ] = process . env [ e ]
210
+ for ( let e of kToForward )
211
+ env [ e ] = process . env [ e ] ;
212
212
213
213
// env.LIBCLANG_LOGGING = '1';
214
214
// env.MALLOC_CHECK_ = '2';
215
215
216
216
let serverOptions : ServerOptions = {
217
217
command : clientConfig . launchCommand ,
218
218
args : args ,
219
- options : {
220
- env : env
221
- }
219
+ options : { env : env }
222
220
} ;
223
221
console . log (
224
222
`Starting ${ serverOptions . command } in ${ serverOptions . options . cwd } ` ) ;
@@ -281,14 +279,12 @@ export function activate(context: ExtensionContext) {
281
279
uri : document . uri . toString ( ) ,
282
280
} ,
283
281
} )
284
- . then (
285
- ( a : ls . CodeLens [ ] ) :
286
- CodeLens [ ] => {
287
- let result : CodeLens [ ] =
288
- languageClient . protocol2CodeConverter . asCodeLenses ( a ) ;
289
- displayCodeLens ( document , result ) ;
290
- return [ ] ;
291
- } ) ;
282
+ . then ( ( a : ls . CodeLens [ ] ) : CodeLens [ ] => {
283
+ let result : CodeLens [ ] =
284
+ languageClient . protocol2CodeConverter . asCodeLenses ( a ) ;
285
+ displayCodeLens ( document , result ) ;
286
+ return [ ] ;
287
+ } ) ;
292
288
} ;
293
289
294
290
// Options to control the language client
@@ -525,51 +521,54 @@ export function activate(context: ExtensionContext) {
525
521
526
522
// Inheritance hierarchy.
527
523
( ( ) => {
528
- const inheritanceHierarchyProvider = new InheritanceHierarchyProvider ( languageClient ) ;
524
+ const inheritanceHierarchyProvider =
525
+ new InheritanceHierarchyProvider ( languageClient ) ;
529
526
window . registerTreeDataProvider (
530
527
'cquery.inheritanceHierarchy' , inheritanceHierarchyProvider ) ;
531
- commands . registerTextEditorCommand ( 'cquery.inheritanceHierarchy' , ( editor ) => {
532
- setContext ( 'extension.cquery.inheritanceHierarchyVisible' , true ) ;
533
-
534
- let position = editor . selection . active ;
535
- let uri = editor . document . uri ;
536
- languageClient
537
- . sendRequest ( '$cquery/inheritanceHierarchy' , {
538
- textDocument : {
539
- uri : uri . toString ( ) ,
540
- } ,
541
- position : position ,
542
- derived : true ,
543
- detailedName : false ,
544
- levels : 1
545
- } )
546
- . then ( ( entry : InheritanceHierarchyNode ) => {
547
- InheritanceHierarchyNode . setWantsDerived ( entry , true ) ;
548
-
549
- languageClient . sendRequest ( '$cquery/inheritanceHierarchy' , {
550
- id : entry . id ,
551
- kind : entry . kind ,
552
- derived : false ,
553
- detailedName : false ,
554
- levels : 1
555
- } )
556
- . then ( ( parentEntry : InheritanceHierarchyNode ) => {
557
- if ( parentEntry . numChildren > 0 ) {
558
- let parentWrapper = new InheritanceHierarchyNode ( ) ;
559
- parentWrapper . children = parentEntry . children ;
560
- parentWrapper . numChildren = parentEntry . children . length ;
561
- parentWrapper . name = '[[Base]]' ;
562
- InheritanceHierarchyNode . setWantsDerived ( parentWrapper , false ) ;
563
- entry . children . splice ( 0 , 0 , parentWrapper ) ;
564
- entry . numChildren += 1 ;
565
- }
566
-
567
- inheritanceHierarchyProvider . root = entry ;
568
- inheritanceHierarchyProvider . onDidChangeEmitter . fire ( ) ;
569
- } ) ;
570
-
571
- } )
572
- } ) ;
528
+ commands . registerTextEditorCommand (
529
+ 'cquery.inheritanceHierarchy' , ( editor ) => {
530
+ setContext ( 'extension.cquery.inheritanceHierarchyVisible' , true ) ;
531
+
532
+ let position = editor . selection . active ;
533
+ let uri = editor . document . uri ;
534
+ languageClient
535
+ . sendRequest ( '$cquery/inheritanceHierarchy' , {
536
+ textDocument : {
537
+ uri : uri . toString ( ) ,
538
+ } ,
539
+ position : position ,
540
+ derived : true ,
541
+ detailedName : false ,
542
+ levels : 1
543
+ } )
544
+ . then ( ( entry : InheritanceHierarchyNode ) => {
545
+ InheritanceHierarchyNode . setWantsDerived ( entry , true ) ;
546
+
547
+ languageClient
548
+ . sendRequest ( '$cquery/inheritanceHierarchy' , {
549
+ id : entry . id ,
550
+ kind : entry . kind ,
551
+ derived : false ,
552
+ detailedName : false ,
553
+ levels : 1
554
+ } )
555
+ . then ( ( parentEntry : InheritanceHierarchyNode ) => {
556
+ if ( parentEntry . numChildren > 0 ) {
557
+ let parentWrapper = new InheritanceHierarchyNode ( ) ;
558
+ parentWrapper . children = parentEntry . children ;
559
+ parentWrapper . numChildren = parentEntry . children . length ;
560
+ parentWrapper . name = '[[Base]]' ;
561
+ InheritanceHierarchyNode . setWantsDerived (
562
+ parentWrapper , false ) ;
563
+ entry . children . splice ( 0 , 0 , parentWrapper ) ;
564
+ entry . numChildren += 1 ;
565
+ }
566
+
567
+ inheritanceHierarchyProvider . root = entry ;
568
+ inheritanceHierarchyProvider . onDidChangeEmitter . fire ( ) ;
569
+ } ) ;
570
+ } )
571
+ } ) ;
573
572
commands . registerCommand ( 'cquery.closeinheritanceHierarchy' , ( ) => {
574
573
setContext ( 'extension.cquery.inheritanceHierarchyVisible' , false ) ;
575
574
inheritanceHierarchyProvider . root = undefined ;
@@ -589,7 +588,8 @@ export function activate(context: ExtensionContext) {
589
588
context . asAbsolutePath ( path . join ( 'resources' , 'base-light.svg' ) ) ;
590
589
const callHierarchyProvider = new CallHierarchyProvider (
591
590
languageClient , derivedDark , derivedLight , baseDark , baseLight ) ;
592
- window . registerTreeDataProvider ( 'cquery.callHierarchy' , callHierarchyProvider ) ;
591
+ window . registerTreeDataProvider (
592
+ 'cquery.callHierarchy' , callHierarchyProvider ) ;
593
593
commands . registerTextEditorCommand ( 'cquery.callHierarchy' , ( editor ) => {
594
594
setContext ( 'extension.cquery.callHierarchyVisible' , true ) ;
595
595
let position = editor . selection . active ;
@@ -620,7 +620,8 @@ export function activate(context: ExtensionContext) {
620
620
// Common between tree views.
621
621
( ( ) => {
622
622
commands . registerCommand (
623
- 'cquery.gotoForTreeView' , ( node : InheritanceHierarchyNode | CallHierarchyNode ) => {
623
+ 'cquery.gotoForTreeView' ,
624
+ ( node : InheritanceHierarchyNode | CallHierarchyNode ) => {
624
625
if ( ! node . location )
625
626
return ;
626
627
@@ -634,7 +635,8 @@ export function activate(context: ExtensionContext) {
634
635
let lastGotoClickTime : number
635
636
commands . registerCommand (
636
637
'cquery.hackGotoForTreeView' ,
637
- ( node : InheritanceHierarchyNode | CallHierarchyNode , hasChildren : boolean ) => {
638
+ ( node : InheritanceHierarchyNode | CallHierarchyNode ,
639
+ hasChildren : boolean ) => {
638
640
if ( ! node . location )
639
641
return ;
640
642
@@ -719,8 +721,7 @@ export function activate(context: ExtensionContext) {
719
721
return decorations [ symbol . stableId % decorations . length ] ;
720
722
} ;
721
723
722
- if ( symbol . kind == SymbolKind . Class ||
723
- symbol . kind == SymbolKind . Struct ) {
724
+ if ( symbol . kind == SymbolKind . Class || symbol . kind == SymbolKind . Struct ) {
724
725
return get ( 'types' ) ;
725
726
} else if ( symbol . kind == SymbolKind . Enum ) {
726
727
return get ( 'enums' ) ;
@@ -730,8 +731,9 @@ export function activate(context: ExtensionContext) {
730
731
return get ( 'templateParameters' ) ;
731
732
} else if ( symbol . kind == SymbolKind . Function ) {
732
733
return get ( 'freeStandingFunctions' ) ;
733
- } else if ( symbol . kind == SymbolKind . Method ||
734
- symbol . kind == SymbolKind . Constructor ) {
734
+ } else if (
735
+ symbol . kind == SymbolKind . Method ||
736
+ symbol . kind == SymbolKind . Constructor ) {
735
737
return get ( 'memberFunctions' )
736
738
} else if ( symbol . kind == SymbolKind . StaticMethod ) {
737
739
return get ( 'staticMemberFunctions' )
0 commit comments