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
ad4b146e
Commit
ad4b146e
authored
4 years ago
by
Michele Alberti
Browse files
Options
Downloads
Patches
Plain Diff
[ivette] Some refactoring to Locations components.
parent
a70275dc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ivette/src/renderer/ASTview.tsx
+10
-8
10 additions, 8 deletions
ivette/src/renderer/ASTview.tsx
with
10 additions
and
8 deletions
ivette/src/renderer/ASTview.tsx
+
10
−
8
View file @
ad4b146e
...
...
@@ -65,16 +65,15 @@ async function loadAST(
}
}
async
function
functionCallers
(
updateSelection
:
(
a
:
States
.
SelectionActions
)
=>
void
,
kf
:
string
,
)
{
/** Compute the [[functionName]] caller locations. */
async
function
functionCallers
(
functionName
:
string
)
{
try
{
const
data
=
await
Server
.
send
(
getCallers
,
k
f
);
const
data
=
await
Server
.
send
(
getCallers
,
f
unctionName
);
const
locations
=
data
.
map
(([
fct
,
marker
])
=>
({
function
:
fct
,
marker
}));
updateSelection
({
locations
})
;
return
locations
;
}
catch
(
err
)
{
PP
.
error
(
`Fail to retrieve callers of function
${
kf
}
`
,
err
);
PP
.
error
(
`Fail to retrieve callers of function
${
functionName
}
.`
,
err
);
return
[];
}
}
...
...
@@ -145,7 +144,10 @@ const ASTview = () => {
if
(
marker
?.
kind
===
'
declaration
'
&&
marker
?.
name
)
{
items
.
push
({
label
:
'
Go to callers
'
,
onClick
:
()
=>
functionCallers
(
updateSelection
,
marker
.
name
),
onClick
:
async
()
=>
{
const
locations
=
await
functionCallers
(
marker
.
name
);
updateSelection
({
locations
});
},
});
}
if
(
items
.
length
>
0
)
...
...
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