@@ -1466,60 +1466,60 @@ defmodule ElixirLS.LanguageServer.Providers.DocumentSymbolsTest do
1466
1466
end
1467
1467
]
1468
1468
1469
- result = = DocumentSymbols . symbols ( uri , text , true )
1469
+ result = DocumentSymbols . symbols ( uri , text , true )
1470
1470
1471
1471
# earlier elixir versions return different ranges
1472
1472
if Version . match? ( System . version ( ) , ">= 1.13.0" ) do
1473
- assert { :ok ,
1474
- [
1475
- % Protocol.DocumentSymbol {
1476
- children: [
1477
- % Protocol.DocumentSymbol {
1478
- children: [
1479
- % Protocol.DocumentSymbol {
1480
- children: [ ] ,
1481
- kind: 7 ,
1482
- name: "name" ,
1483
- range: % {
1484
- "end" => % { "character" => 55 , "line" => 3 } ,
1485
- "start" => % { "character" => 15 , "line" => 3 }
1473
+ assert { :ok ,
1474
+ [
1475
+ % Protocol.DocumentSymbol {
1476
+ children: [
1477
+ % Protocol.DocumentSymbol {
1478
+ children: [
1479
+ % Protocol.DocumentSymbol {
1480
+ children: [ ] ,
1481
+ kind: 7 ,
1482
+ name: "name" ,
1483
+ range: % {
1484
+ "end" => % { "character" => 55 , "line" => 3 } ,
1485
+ "start" => % { "character" => 15 , "line" => 3 }
1486
+ } ,
1487
+ selectionRange: % {
1488
+ "end" => % { "character" => 55 , "line" => 3 } ,
1489
+ "start" => % { "character" => 15 , "line" => 3 }
1490
+ }
1486
1491
} ,
1487
- selectionRange: % {
1488
- "end" => % { "character" => 55 , "line" => 3 } ,
1489
- "start" => % { "character" => 15 , "line" => 3 }
1492
+ % Protocol.DocumentSymbol {
1493
+ children: [ ] ,
1494
+ kind: 7 ,
1495
+ name: "age" ,
1496
+ range: % {
1497
+ "end" => % { "character" => 55 , "line" => 3 } ,
1498
+ "start" => % { "character" => 15 , "line" => 3 }
1499
+ } ,
1500
+ selectionRange: % {
1501
+ "end" => % { "character" => 55 , "line" => 3 } ,
1502
+ "start" => % { "character" => 15 , "line" => 3 }
1503
+ }
1490
1504
}
1505
+ ] ,
1506
+ kind: 5 ,
1507
+ name: "defrecord :user" ,
1508
+ range: % {
1509
+ "end" => % { "character" => 55 , "line" => 3 } ,
1510
+ "start" => % { "character" => 8 , "line" => 3 }
1491
1511
} ,
1492
- % Protocol.DocumentSymbol {
1493
- children: [ ] ,
1494
- kind: 7 ,
1495
- name: "age" ,
1496
- range: % {
1497
- "end" => % { "character" => 55 , "line" => 3 } ,
1498
- "start" => % { "character" => 15 , "line" => 3 }
1499
- } ,
1500
- selectionRange: % {
1501
- "end" => % { "character" => 55 , "line" => 3 } ,
1502
- "start" => % { "character" => 15 , "line" => 3 }
1503
- }
1512
+ selectionRange: % {
1513
+ "end" => % { "character" => 55 , "line" => 3 } ,
1514
+ "start" => % { "character" => 8 , "line" => 3 }
1504
1515
}
1505
- ] ,
1506
- kind: 5 ,
1507
- name: "defrecord :user" ,
1508
- range: % {
1509
- "end" => % { "character" => 55 , "line" => 3 } ,
1510
- "start" => % { "character" => 8 , "line" => 3 }
1511
- } ,
1512
- selectionRange: % {
1513
- "end" => % { "character" => 55 , "line" => 3 } ,
1514
- "start" => % { "character" => 8 , "line" => 3 }
1515
1516
}
1516
- }
1517
- ] ,
1518
- kind: 2 ,
1519
- name: "MyModule"
1520
- }
1521
- ] } = result
1522
- end
1517
+ ] ,
1518
+ kind: 2 ,
1519
+ name: "MyModule"
1520
+ }
1521
+ ] } = result
1522
+ end
1523
1523
end
1524
1524
1525
1525
test "[flat] handles records" do
@@ -1535,49 +1535,49 @@ defmodule ElixirLS.LanguageServer.Providers.DocumentSymbolsTest do
1535
1535
1536
1536
# earlier elixir versions return different ranges
1537
1537
if Version . match? ( System . version ( ) , ">= 1.13.0" ) do
1538
- assert { :ok ,
1539
- [
1540
- % Protocol.SymbolInformation {
1541
- name: "MyModule" ,
1542
- kind: 2 ,
1543
- location: % {
1544
- range: % {
1545
- "end" => % { "character" => 9 , "line" => 4 } ,
1546
- "start" => % { "character" => 6 , "line" => 1 }
1538
+ assert { :ok ,
1539
+ [
1540
+ % Protocol.SymbolInformation {
1541
+ name: "MyModule" ,
1542
+ kind: 2 ,
1543
+ location: % {
1544
+ range: % {
1545
+ "end" => % { "character" => 9 , "line" => 4 } ,
1546
+ "start" => % { "character" => 6 , "line" => 1 }
1547
+ }
1547
1548
}
1548
- }
1549
- } ,
1550
- % Protocol.SymbolInformation {
1551
- name: "defrecord :user" ,
1552
- kind: 5 ,
1553
- containerName: "MyModule"
1554
- } ,
1555
- % Protocol.SymbolInformation {
1556
- containerName: "defrecord :user" ,
1557
- kind: 7 ,
1558
- location: % {
1559
- range: % {
1560
- "end" => % { "character" => 55 , "line" => 3 } ,
1561
- "start" => % { "character" => 15 , "line" => 3 }
1562
- } ,
1563
- uri: "file:///project/file.ex"
1564
1549
} ,
1565
- name: "name"
1566
- } ,
1567
- % Protocol.SymbolInformation {
1568
- containerName: "defrecord :user" ,
1569
- kind: 7 ,
1570
- location: % {
1571
- range: % {
1572
- "end" => % { "character" => 55 , "line" => 3 } ,
1573
- "start" => % { "character" => 15 , "line" => 3 }
1550
+ % Protocol.SymbolInformation {
1551
+ name: "defrecord :user" ,
1552
+ kind: 5 ,
1553
+ containerName: "MyModule"
1554
+ } ,
1555
+ % Protocol.SymbolInformation {
1556
+ containerName: "defrecord :user" ,
1557
+ kind: 7 ,
1558
+ location: % {
1559
+ range: % {
1560
+ "end" => % { "character" => 55 , "line" => 3 } ,
1561
+ "start" => % { "character" => 15 , "line" => 3 }
1562
+ } ,
1563
+ uri: "file:///project/file.ex"
1574
1564
} ,
1575
- uri : "file:///project/file.ex "
1565
+ name : "name "
1576
1566
} ,
1577
- name: "age"
1578
- }
1579
- ] } = result
1580
- end
1567
+ % Protocol.SymbolInformation {
1568
+ containerName: "defrecord :user" ,
1569
+ kind: 7 ,
1570
+ location: % {
1571
+ range: % {
1572
+ "end" => % { "character" => 55 , "line" => 3 } ,
1573
+ "start" => % { "character" => 15 , "line" => 3 }
1574
+ } ,
1575
+ uri: "file:///project/file.ex"
1576
+ } ,
1577
+ name: "age"
1578
+ }
1579
+ ] } = result
1580
+ end
1581
1581
end
1582
1582
1583
1583
test "[nested] skips docs attributes" do
0 commit comments