Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
18092bd2
Commit
18092bd2
authored
4 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[ivette] fix function filters settings
parent
52bbd1e6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ivette/src/dome/src/renderer/frame/sidebars.tsx
+1
-1
1 addition, 1 deletion
ivette/src/dome/src/renderer/frame/sidebars.tsx
ivette/src/renderer/Globals.tsx
+52
-52
52 additions, 52 deletions
ivette/src/renderer/Globals.tsx
with
53 additions
and
53 deletions
ivette/src/dome/src/renderer/frame/sidebars.tsx
+
1
−
1
View file @
18092bd2
...
@@ -134,7 +134,7 @@ export function Section(props: SectionProps) {
...
@@ -134,7 +134,7 @@ export function Section(props: SectionProps) {
<
div
className
=
"dome-xSideBarSection"
>
<
div
className
=
"dome-xSideBarSection"
>
<
div
<
div
className
=
"dome-xSideBarSection-title dome-color-frame"
className
=
"dome-xSideBarSection-title dome-color-frame"
title
=
{
props
.
label
}
title
=
{
props
.
title
}
onContextMenu
=
{
props
.
onContextMenu
}
onContextMenu
=
{
props
.
onContextMenu
}
>
>
<
Label
label
=
{
props
.
label
}
/>
<
Label
label
=
{
props
.
label
}
/>
...
...
This diff is collapsed.
Click to expand it.
ivette/src/renderer/Globals.tsx
+
52
−
52
View file @
18092bd2
...
@@ -6,25 +6,13 @@ import React from 'react';
...
@@ -6,25 +6,13 @@ import React from 'react';
import
{
Section
,
Item
}
from
'
dome/frame/sidebars
'
;
import
{
Section
,
Item
}
from
'
dome/frame/sidebars
'
;
import
type
{
Hint
}
from
'
dome/frame/toolbars
'
;
import
type
{
Hint
}
from
'
dome/frame/toolbars
'
;
import
*
as
States
from
'
frama-c/states
'
;
import
*
as
States
from
'
frama-c/states
'
;
import
{
useFlipSettings
}
from
'
dome
'
;
import
{
alpha
}
from
'
dome/data/compare
'
;
import
{
alpha
}
from
'
dome/data/compare
'
;
import
{
functions
,
functionsData
}
from
'
frama-c/api/kernel/ast
'
;
import
{
functions
,
functionsData
}
from
'
frama-c/api/kernel/ast
'
;
import
{
isComputed
}
from
'
frama-c/api/plugins/eva/general
'
;
import
{
isComputed
}
from
'
frama-c/api/plugins/eva/general
'
;
import
*
as
Dome
from
'
dome
'
;
import
*
as
Dome
from
'
dome
'
;
// --------------------------------------------------------------------------
// --- Filters
// --------------------------------------------------------------------------
const
defaultFilter
=
{
stdlib
:
false
,
// Show functions from the Frama-C stdlib
builtin
:
false
,
// Show Frama-C builtins
undef
:
true
,
// Show undefined functions
eva_only
:
false
,
// Only show functions analyzed by Eva
selected_only
:
false
,
// Only show functions from a multiple selection
};
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// --- Global Search Hints
// --- Global Search Hints
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
...
@@ -64,7 +52,11 @@ export default () => {
...
@@ -64,7 +52,11 @@ export default () => {
const
fcts
=
States
.
useSyncArray
(
functions
).
getArray
().
sort
(
const
fcts
=
States
.
useSyncArray
(
functions
).
getArray
().
sort
(
(
f
,
g
)
=>
alpha
(
f
.
name
,
g
.
name
),
(
f
,
g
)
=>
alpha
(
f
.
name
,
g
.
name
),
);
);
const
[
filter
,
setFilter
]
=
React
.
useState
(
defaultFilter
);
const
[
stdlib
,
flipStdlib
]
=
useFlipSettings
(
'
ivette.globals.stdlib
'
,
false
);
const
[
builtin
,
flipBuiltin
]
=
useFlipSettings
(
'
ivette.globals.builtin
'
,
false
);
const
[
undef
,
flipUndef
]
=
useFlipSettings
(
'
ivette.globals.undef
'
,
true
);
const
[
selected
,
flipSelected
]
=
useFlipSettings
(
'
ivette.globals.selected
'
,
false
);
const
[
evaOnly
,
flipEvaOnly
]
=
useFlipSettings
(
'
ivette.globals.evaonly
'
,
false
);
const
multipleSelection
=
selection
?.
multiple
;
const
multipleSelection
=
selection
?.
multiple
;
const
multipleSelectionActive
=
multipleSelection
?.
allSelections
.
length
>
0
;
const
multipleSelectionActive
=
multipleSelection
?.
allSelections
.
length
>
0
;
const
evaComputed
=
States
.
useRequest
(
isComputed
,
null
);
const
evaComputed
=
States
.
useRequest
(
isComputed
,
null
);
...
@@ -77,46 +69,45 @@ export default () => {
...
@@ -77,46 +69,45 @@ export default () => {
function
showFunction
(
fct
:
functionsData
)
{
function
showFunction
(
fct
:
functionsData
)
{
const
visible
=
const
visible
=
(
filter
.
stdlib
||
!
fct
.
stdlib
)
(
stdlib
||
!
fct
.
stdlib
)
&&
(
filter
.
builtin
||
!
fct
.
builtin
)
&&
(
builtin
||
!
fct
.
builtin
)
&&
(
filter
.
undef
||
fct
.
defined
)
&&
(
undef
||
fct
.
defined
)
&&
(
!
filter
.
eva
_o
nly
||
!
evaComputed
||
(
fct
.
eva_analyzed
===
true
))
&&
(
!
eva
O
nly
||
!
evaComputed
||
(
fct
.
eva_analyzed
===
true
))
&&
(
!
filter
.
selected
_only
||
!
multipleSelectionActive
||
isSelected
(
fct
));
&&
(
!
selected
||
!
multipleSelectionActive
||
isSelected
(
fct
));
return
visible
;
return
visible
;
}
}
async
function
onContextMenu
()
{
async
function
onContextMenu
()
{
const
items
:
Dome
.
PopupMenuItem
[]
=
[];
const
items
:
Dome
.
PopupMenuItem
[]
=
[
items
.
push
({
{
label
:
'
Show Frama-C builtins
'
,
label
:
'
Show Frama-C builtins
'
,
checked
:
filter
.
builtin
,
checked
:
builtin
,
onClick
:
()
=>
setFilter
({
...
filter
,
builtin
:
!
filter
.
builtin
}),
onClick
:
flipBuiltin
,
});
items
.
push
({
label
:
'
Show stdlib functions
'
,
checked
:
filter
.
stdlib
,
onClick
:
()
=>
setFilter
({
...
filter
,
stdlib
:
!
filter
.
stdlib
}),
});
items
.
push
({
label
:
'
Show undefined functions
'
,
checked
:
filter
.
undef
,
onClick
:
()
=>
setFilter
({
...
filter
,
undef
:
!
filter
.
undef
}),
});
items
.
push
(
'
separator
'
);
items
.
push
({
label
:
'
Selected only
'
,
enabled
:
multipleSelectionActive
,
checked
:
filter
.
selected_only
,
onClick
:
()
=>
{
setFilter
({
...
filter
,
selected_only
:
!
filter
.
selected_only
});
},
},
});
{
items
.
push
({
label
:
'
Show stdlib functions
'
,
label
:
'
Analyzed by Eva only
'
,
checked
:
stdlib
,
enabled
:
evaComputed
,
onClick
:
flipStdlib
,
checked
:
filter
.
eva_only
,
},
onClick
:
()
=>
setFilter
({
...
filter
,
eva_only
:
!
filter
.
eva_only
}),
{
});
label
:
'
Show undefined functions
'
,
checked
:
undef
,
onClick
:
flipUndef
,
},
'
separator
'
,
{
label
:
'
Selected only
'
,
enabled
:
multipleSelectionActive
,
checked
:
selected
,
onClick
:
flipSelected
,
},
{
label
:
'
Analyzed by Eva only
'
,
enabled
:
evaComputed
,
checked
:
evaOnly
,
onClick
:
flipEvaOnly
,
}
];
Dome
.
popupMenu
(
items
);
Dome
.
popupMenu
(
items
);
}
}
...
@@ -135,12 +126,21 @@ export default () => {
...
@@ -135,12 +126,21 @@ export default () => {
);
);
};
};
// Filtered
const
filtered
=
fcts
.
filter
(
showFunction
);
const
nTotal
=
fcts
.
length
;
const
nFilter
=
filtered
.
length
;
const
title
=
`Filtered
${
nFilter
}
/
${
nTotal
}
`
;
return
(
return
(
<
Section
label
=
"Functions"
onContextMenu
=
{
onContextMenu
}
defaultUnfold
>
<
Section
{
fcts
.
filter
(
showFunction
).
map
(
makeFctItem
)
}
label
=
"Functions"
title
=
{
title
}
onContextMenu
=
{
onContextMenu
}
defaultUnfold
>
{
filtered
.
map
(
makeFctItem
)
}
</
Section
>
</
Section
>
);
);
}
;
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment