Skip to content

Commit a798b79

Browse files
committed
fixes
Signed-off-by: Shaobo He <[email protected]>
1 parent e891f90 commit a798b79

File tree

3 files changed

+65
-109
lines changed
  • cedar-language-server/src/schema
  • cedar-policy-formatter/src/pprint
  • cedar-policy/src

3 files changed

+65
-109
lines changed

cedar-language-server/src/schema/fold.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
use cedar_policy_core::{parser::AsLocRef, validator::ValidatorSchema};
17+
use cedar_policy_core::validator::ValidatorSchema;
1818
use itertools::Itertools;
1919
use tower_lsp_server::lsp_types::{self, FoldingRange};
2020

@@ -70,18 +70,14 @@ pub(crate) fn fold_schema(schema_info: &SchemaInfo) -> Option<Vec<FoldingRange>>
7070
let validator = ValidatorSchema::try_from(schema_info).ok()?;
7171

7272
// 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());
7674

7775
// 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());
8177
let action_locs = validator.action_ids().filter_map(|a| a.loc());
8278
let common_types = validator
8379
.common_types()
84-
.filter_map(|ct| ct.type_loc.as_loc_ref());
80+
.filter_map(|ct| ct.type_loc.as_ref());
8581

8682
// Combine all locations and create folding ranges
8783
let ranges = namespace_locs

0 commit comments

Comments
 (0)