From a05dfc80a2425ebade1569d206076120280e74f3 Mon Sep 17 00:00:00 2001
From: Maxime Jacquemin <maxime2.jacquemin@gmail.com>
Date: Tue, 17 Jan 2023 09:28:33 +0100
Subject: [PATCH] [Ivette] Linter, again

---
 ivette/src/dome/renderer/text/editor.tsx | 2 +-
 ivette/src/frama-c/kernel/SourceCode.tsx | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ivette/src/dome/renderer/text/editor.tsx b/ivette/src/dome/renderer/text/editor.tsx
index 15d4be789fe..64287c759db 100644
--- a/ivette/src/dome/renderer/text/editor.tsx
+++ b/ivette/src/dome/renderer/text/editor.tsx
@@ -370,7 +370,7 @@ export function selectLine(view: View, line: number, atTop: boolean): void {
   const { from: goto } = doc.line(Math.max(line, 1));
   if (here === goto) return;
   view.dispatch({ selection: { anchor: goto }, scrollIntoView: true });
-  if (!atTop) return
+  if (!atTop) return;
   const effects = EditorView.scrollIntoView(goto, { y: 'start', yMargin: 0 });
   view.dispatch({ effects });
 }
diff --git a/ivette/src/frama-c/kernel/SourceCode.tsx b/ivette/src/frama-c/kernel/SourceCode.tsx
index b099a503816..05cb75e067b 100644
--- a/ivette/src/frama-c/kernel/SourceCode.tsx
+++ b/ivette/src/frama-c/kernel/SourceCode.tsx
@@ -165,13 +165,13 @@ const extensions: Editor.Extension[] = [
   EventsHandler,
 ];
 
-function markerLocation(m: Ast.marker | undefined): Ast.source | undefined {
+function useMarkerLocation(m: Ast.marker | undefined): Ast.source | undefined {
   const markersInfo = States.useSyncArray(Ast.markerInfo);
   if (m === undefined || m === '') return undefined;
   return markersInfo.getData(m)?.sloc;
 }
 
-function functionLocation(fct: string | undefined): Ast.source | undefined {
+function useFunctionLocation(fct: string | undefined): Ast.source | undefined {
   const functionsData = States.useSyncArray(Ast.functions).getArray();
   if (fct === undefined || fct === '') return undefined;
   return functionsData.find((e) => e.name === fct)?.sloc;
@@ -187,8 +187,8 @@ export default function SourceCode(): JSX.Element {
   const fct = selection?.current?.fct;
   const displayedFct = React.useRef<string | undefined>(undefined);
 
-  const markerSloc = markerLocation(marker);
-  const fctSloc = functionLocation(fct);
+  const markerSloc = useMarkerLocation(marker);
+  const fctSloc = useFunctionLocation(fct);
   const file = fctSloc?.file ?? '';
   const filename = Path.parse(file).base;
 
-- 
GitLab