From 099f137917fe60b38bf86743004bc93e5d91797e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Loi=CC=88c=20Correnson?= <loic.correnson@cea.fr>
Date: Tue, 22 Feb 2022 15:54:11 +0100
Subject: [PATCH] [ivette/eva] suppress probe labelling

---
 ivette/src/frama-c/plugins/eva/probeinfos.tsx |  8 +----
 ivette/src/frama-c/plugins/eva/probes.ts      | 31 +------------------
 ivette/src/frama-c/plugins/eva/valuetable.tsx |  5 ++-
 3 files changed, 4 insertions(+), 40 deletions(-)

diff --git a/ivette/src/frama-c/plugins/eva/probeinfos.tsx b/ivette/src/frama-c/plugins/eva/probeinfos.tsx
index ed7a18124c7..9baa4c9acdb 100644
--- a/ivette/src/frama-c/plugins/eva/probeinfos.tsx
+++ b/ivette/src/frama-c/plugins/eva/probeinfos.tsx
@@ -27,7 +27,7 @@
 // React & Dome
 import React from 'react';
 import { Hpack, Filler } from 'dome/layout/boxes';
-import { Label, Code } from 'dome/controls/labels';
+import { Code } from 'dome/controls/labels';
 import { IconButton } from 'dome/controls/buttons';
 import { ButtonGroup, Button } from 'dome/frame/toolbars';
 
@@ -48,7 +48,6 @@ function ProbeEditor(props: ModelProp): JSX.Element | null {
   const { model } = props;
   const probe = model.getFocused();
   if (!probe || !probe.code) return null;
-  const { label } = probe;
   const { code } = probe;
   const { stmt, marker } = probe;
   const { cols, rows } = sizeof(code);
@@ -57,11 +56,6 @@ function ProbeEditor(props: ModelProp): JSX.Element | null {
   const { zoomable } = probe;
   return (
     <>
-      <Label
-        display={label !== code}
-        className="eva-probeinfo-label">
-        {label}
-      </Label>
       <div className="eva-probeinfo-code">
         <SizedArea cols={cols} rows={rows}>{code}</SizedArea>
       </div>
diff --git a/ivette/src/frama-c/plugins/eva/probes.ts b/ivette/src/frama-c/plugins/eva/probes.ts
index f39a671bec9..e9bdb0da9ca 100644
--- a/ivette/src/frama-c/plugins/eva/probes.ts
+++ b/ivette/src/frama-c/plugins/eva/probes.ts
@@ -33,31 +33,10 @@ import * as Ast from 'frama-c/kernel/api/ast';
 import { ModelCallbacks } from './cells';
 
 /* --------------------------------------------------------------------------*/
-/* --- Probe Labelling                                                    ---*/
+/* --- Probe State                                                        ---*/
 /* --------------------------------------------------------------------------*/
 
-const Ka = 'A'.charCodeAt(0);
-const Kz = 'Z'.charCodeAt(0);
 const LabelSize = 12;
-let La = Ka;
-let Lk = 0;
-
-function newLabel(): string {
-  const a = La;
-  const k = Lk;
-  const lbl = String.fromCharCode(a);
-  if (a < Kz) {
-    La++;
-  } else {
-    La = Ka;
-    Lk++;
-  }
-  return k > 0 ? `${lbl}${k}` : lbl;
-}
-
-/* --------------------------------------------------------------------------*/
-/* --- Probe State                                                        ---*/
-/* --------------------------------------------------------------------------*/
 
 export class Probe {
 
@@ -69,7 +48,6 @@ export class Probe {
   prev?: Probe;
   transient = true;
   loading = true;
-  label?: string;
   code?: string;
   stmt?: Ast.marker;
   rank?: number;
@@ -89,27 +67,20 @@ export class Probe {
 
   requestProbeInfo(): void {
     this.loading = true;
-    this.label = '…';
     Server
       .send(Values.getProbeInfo, this.marker)
       .then(({ code, stmt, rank, effects, condition }) => {
         this.code = code;
         this.stmt = stmt;
         this.rank = rank;
-        this.label = undefined;
         this.effects = effects;
         this.condition = condition;
         this.loading = false;
-        if (code && code.length > LabelSize)
-          this.label = newLabel();
-        else
-          this.label = code;
       })
       .catch(() => {
         this.code = '(error)';
         this.stmt = undefined;
         this.rank = undefined;
-        this.label = undefined;
         this.effects = false;
         this.condition = false;
         this.loading = false;
diff --git a/ivette/src/frama-c/plugins/eva/valuetable.tsx b/ivette/src/frama-c/plugins/eva/valuetable.tsx
index ce10beec388..3e09f9d2c54 100644
--- a/ivette/src/frama-c/plugins/eva/valuetable.tsx
+++ b/ivette/src/frama-c/plugins/eva/valuetable.tsx
@@ -101,11 +101,10 @@ function TableCell(props: TableCellProps) {
     // ---- Probe Contents
     case 'probes':
       {
-        const { stmt, code, label } = probe;
-        const textClass = label ? 'dome-text-label' : 'dome-text-cell';
+        const { stmt, code } = probe;
         contents = (
           <>
-            <span className={textClass}>{label ?? code}</span>
+            <span className='dome-text-cell'>{code}</span>
             <Stmt stmt={stmt} marker={marker} short />
           </>
         );
-- 
GitLab