Skip to content
Snippets Groups Projects
Commit eb59210e authored by Allan Blanchard's avatar Allan Blanchard
Browse files

[ivette] table for marker menu

parent b2788456
No related branches found
No related tags found
No related merge requests found
......@@ -29,8 +29,6 @@ import * as Utils from 'dome/data/arrays';
import * as States from 'frama-c/states';
import * as Settings from 'dome/data/settings';
import { IconButton } from 'dome/controls/buttons';
import * as Studia from 'frama-c/plugins/studia';
import * as Wp from 'frama-c/plugins/wp';
import * as Ast from 'frama-c/kernel/api/ast';
import { text } from 'frama-c/kernel/api/data';
import * as Eva from 'frama-c/plugins/eva/api/general';
......@@ -493,6 +491,15 @@ function createPropertiesGutter(): Editor.Extension {
// Context menu
// -----------------------------------------------------------------------------
type MarkerMenuExtender =
(items: Dome.PopupMenuItem[], attr: Ast.markerAttributesData) => void;
const MarkerMenuExtenders : MarkerMenuExtender[] = [];
export function registerMarkerMenuExtender(e : MarkerMenuExtender) : void {
MarkerMenuExtenders.push(e);
}
// This field contains all the current function's callers, as inferred by Eva.
const Callers = Editor.createField<Eva.CallSite[]>([]);
......@@ -546,8 +553,7 @@ function createContextMenuHandler(): Editor.Extension {
items.push({ label, onClick });
});
}
Studia.buildMenu(items, attributes);
Wp.buildMenu(items, attributes);
MarkerMenuExtenders.forEach((ext) => ext(items, attributes));
items.push({
label: 'Copy to clipboard',
onClick: () => {
......
......@@ -26,6 +26,7 @@ import * as States from 'frama-c/states';
import * as Server from 'frama-c/server';
import * as Status from 'frama-c/kernel/Status';
import * as Ast from 'frama-c/kernel/api/ast';
import * as ASTview from 'frama-c/kernel/ASTview';
import * as Locations from 'frama-c/kernel/Locations';
import { getWritesLval, getReadsLval } from 'frama-c/plugins/studia/api/studia';
import './style.css';
......@@ -105,6 +106,8 @@ export function buildMenu(
}
}
ASTview.registerMarkerMenuExtender(buildMenu);
const studiaReadsMode : Ivette.SearchProps = {
id: 'frama-c.plugins.studia.reads',
rank: -1,
......
......@@ -34,6 +34,7 @@ import * as Ivette from 'ivette';
import * as Server from 'frama-c/server';
import * as States from 'frama-c/states';
import * as Ast from 'frama-c/kernel/api/ast';
import * as ASTview from 'frama-c/kernel/ASTview';
import { GoalTable } from './goals';
import { TIPView } from './tip';
import * as WP from 'frama-c/plugins/wp/api';
......@@ -43,7 +44,7 @@ import './style.css';
/* --- Generate Goals --- */
/* -------------------------------------------------------------------------- */
export function buildMenu(
function buildMenu(
menu: Dome.PopupMenuItem[],
attr: Ast.markerAttributesData,
): void {
......@@ -61,6 +62,8 @@ export function buildMenu(
}
}
ASTview.registerMarkerMenuExtender(buildMenu);
/* -------------------------------------------------------------------------- */
/* --- Goal Component --- */
/* -------------------------------------------------------------------------- */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment