Skip to content
Snippets Groups Projects
Commit 0057196e authored by Michele Alberti's avatar Michele Alberti
Browse files

[ivette] Bugfix on ASTview concerning go to definition.

parent e975b102
No related branches found
No related tags found
No related merge requests found
...@@ -85,13 +85,13 @@ const ASTview = () => { ...@@ -85,13 +85,13 @@ const ASTview = () => {
// Hooks // Hooks
const buffer = React.useMemo(() => new RichTextBuffer(), []); const buffer = React.useMemo(() => new RichTextBuffer(), []);
const printed: React.MutableRefObject<string | undefined> = React.useRef(); const printed = React.useRef<string | undefined>();
const [selection, updateSelection] = States.useSelection(); const [selection, updateSelection] = States.useSelection();
const multipleSelections = selection?.multiple.allSelections; const multipleSelections = selection?.multiple.allSelections;
const [theme, setTheme] = Dome.useGlobalSetting('ASTview.theme', 'default'); const [theme, setTheme] = Dome.useGlobalSetting('ASTview.theme', 'default');
const [fontSize, setFontSize] = Dome.useGlobalSetting('ASTview.fontSize', 12); const [fontSize, setFontSize] = Dome.useGlobalSetting('ASTview.fontSize', 12);
const [wrapText, setWrapText] = Dome.useSwitch('ASTview.wrapText', false); const [wrapText, setWrapText] = Dome.useSwitch('ASTview.wrapText', false);
const markers = States.useSyncModel(markerInfo); const markers = States.useSyncArray(markerInfo);
const theFunction = selection?.current?.function; const theFunction = selection?.current?.function;
const theMarker = selection?.current?.marker; const theMarker = selection?.current?.marker;
...@@ -131,7 +131,7 @@ const ASTview = () => { ...@@ -131,7 +131,7 @@ const ASTview = () => {
function onContextMenu(id: key<'#markerInfo'>) { function onContextMenu(id: key<'#markerInfo'>) {
const items = []; const items = [];
const marker = markers.getData(id); const marker = markers.find((e) => e.key === id);
if (marker?.kind === 'function') { if (marker?.kind === 'function') {
items.push({ items.push({
label: `Go to definition of ${marker.name}`, label: `Go to definition of ${marker.name}`,
......
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