File tree Expand file tree Collapse file tree 3 files changed +65
-109
lines changed
cedar-language-server/src/schema
cedar-policy-formatter/src/pprint Expand file tree Collapse file tree 3 files changed +65
-109
lines changed Original file line number Diff line number Diff line change 14
14
* limitations under the License.
15
15
*/
16
16
17
- use cedar_policy_core:: { parser :: AsLocRef , validator:: ValidatorSchema } ;
17
+ use cedar_policy_core:: validator:: ValidatorSchema ;
18
18
use itertools:: Itertools ;
19
19
use tower_lsp_server:: lsp_types:: { self , FoldingRange } ;
20
20
@@ -70,18 +70,14 @@ pub(crate) fn fold_schema(schema_info: &SchemaInfo) -> Option<Vec<FoldingRange>>
70
70
let validator = ValidatorSchema :: try_from ( schema_info) . ok ( ) ?;
71
71
72
72
// Get namespace locations first (will contain other elements)
73
- let namespace_locs = validator
74
- . namespaces ( )
75
- . filter_map ( |ns| ns. def_loc . as_loc_ref ( ) ) ;
73
+ let namespace_locs = validator. namespaces ( ) . filter_map ( |ns| ns. def_loc . as_ref ( ) ) ;
76
74
77
75
// Get locations for all other elements
78
- let entity_type_locs = validator
79
- . entity_types ( )
80
- . filter_map ( |et| et. loc . as_loc_ref ( ) ) ;
76
+ let entity_type_locs = validator. entity_types ( ) . filter_map ( |et| et. loc . as_ref ( ) ) ;
81
77
let action_locs = validator. action_ids ( ) . filter_map ( |a| a. loc ( ) ) ;
82
78
let common_types = validator
83
79
. common_types ( )
84
- . filter_map ( |ct| ct. type_loc . as_loc_ref ( ) ) ;
80
+ . filter_map ( |ct| ct. type_loc . as_ref ( ) ) ;
85
81
86
82
// Combine all locations and create folding ranges
87
83
let ranges = namespace_locs
You can’t perform that action at this time.
0 commit comments