File tree Expand file tree Collapse file tree 3 files changed +10
-15
lines changed
vscode-tests/no-workspace Expand file tree Collapse file tree 3 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -92,14 +92,14 @@ export default class AstBuilder {
9292 } ;
9393
9494 idToItem . set ( id , item as RootAstItem ) ;
95- const parent = idToItem . get ( childToParent . get ( id ) || - 1 ) ;
95+ const parent = idToItem . get ( childToParent . has ( id ) ? childToParent . get ( id ) ! : - 1 ) ;
9696
9797 if ( parent ) {
9898 const astItem = item as AstItem ;
9999 astItem . parent = parent ;
100100 parent . children . push ( astItem ) ;
101101 }
102- const children = parentToChildren . get ( id ) || [ ] ;
102+ const children = parentToChildren . has ( id ) ? parentToChildren . get ( id ) ! : [ ] ;
103103 children . forEach ( childId => {
104104 const child = idToItem . get ( childId ) as AstItem | undefined ;
105105 if ( child ) {
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ describe('AstBuilder', () => {
110110
111111const expectedRoots = [
112112 {
113- id : 26362 ,
113+ id : 0 ,
114114 label : '[TopLevelFunction] int disable_interrupts()' ,
115115 location : {
116116 uri : 'file:/opt/src/arch/sandbox/lib/interrupts.c' ,
Original file line number Diff line number Diff line change 6262 ],
6363 [
6464 {
65- "id" : 26362 ,
65+ "id" : 0 ,
6666 "label" : " [TopLevelFunction] int disable_interrupts()" ,
6767 "url" : {
6868 "uri" : " file:/opt/src/arch/sandbox/lib/interrupts.c" ,
7777 ],
7878 [
7979 {
80- "id" : 26362 ,
80+ "id" : 0 ,
8181 "label" : " [TopLevelFunction] int disable_interrupts()" ,
8282 "url" : {
8383 "uri" : " file:/opt/src/arch/sandbox/lib/interrupts.c" ,
384384 "tuples" : [
385385 [
386386 {
387- "id" : 26362 ,
387+ "id" : 0 ,
388388 "label" : " [TopLevelFunction] int disable_interrupts()" ,
389389 "url" : {
390390 "uri" : " file:/opt/src/arch/sandbox/lib/interrupts.c" ,
410410 ],
411411 [
412412 {
413- "id" : 26362 ,
413+ "id" : 0 ,
414414 "label" : " [TopLevelFunction] int disable_interrupts()" ,
415415 "url" : {
416416 "uri" : " file:/opt/src/arch/sandbox/lib/interrupts.c" ,
436436 ],
437437 [
438438 {
439- "id" : 26362 ,
439+ "id" : 0 ,
440440 "label" : " [TopLevelFunction] int disable_interrupts()" ,
441441 "url" : {
442442 "uri" : " file:/opt/src/arch/sandbox/lib/interrupts.c" ,
462462 ],
463463 [
464464 {
465- "id" : 26362 ,
465+ "id" : 0 ,
466466 "label" : " [TopLevelFunction] int disable_interrupts()" ,
467467 "url" : {
468468 "uri" : " file:/opt/src/arch/sandbox/lib/interrupts.c" ,
967967 "kind" : " String"
968968 }
969969 ],
970- "tuples" : [
971- [
972- " semmle.graphKind" ,
973- " tree"
974- ]
975- ]
970+ "tuples" : [[" semmle.graphKind" , " tree" ]]
976971 }
977972]
You can’t perform that action at this time.
0 commit comments