From 962f03c9f3b9b2aa21ad7ccb2e79078ab79ac355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20B=C3=BChler?= <david.buhler@cea.fr> Date: Tue, 4 Jun 2024 16:52:54 +0200 Subject: [PATCH] [Ivette] In the sidebar, sorts globals (variables and types) by name. --- ivette/src/frama-c/kernel/Globals.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ivette/src/frama-c/kernel/Globals.tsx b/ivette/src/frama-c/kernel/Globals.tsx index cee66e33d4c..819ee2b202d 100644 --- a/ivette/src/frama-c/kernel/Globals.tsx +++ b/ivette/src/frama-c/kernel/Globals.tsx @@ -220,7 +220,7 @@ function computeFcts( const ef = eva.getData(kf.key); arr.push({ ...ef, ...kf }); }); - return arr.sort((f, g) => alpha(f.name, g.name)); + return arr; } type FunctionProps = InfiniteScrollableListProps @@ -300,6 +300,7 @@ export function Functions(props: FunctionProps): JSX.Element { const items = fcts .filter(showFunction) + .sort((f, g) => alpha(f.name, g.name)) .map((fct) => <FctItem key={fct.key} fct={fct} current={current} />); return ( @@ -399,6 +400,7 @@ export function Variables(props: VariablesProps): JSX.Element { const items = variables .filter(showVariable) + .sort((v1, v2) => alpha(v1.name, v2.name)) .map((v) => makeVarItem(scope, v)); return ( @@ -451,6 +453,7 @@ export function Declarations(props: DeclarationsProps): JSX.Element { () => data .filter(filter) + .sort((d1, d2) => alpha(d1.name, d2.name)) .map((d) => makeItem(scope, d)) , [scope, data, filter] ); -- GitLab