question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Manual annotations removed by worker

See original GitHub issue

Problem

I’m rendering a react-ace component with annotations like this:

<ReactAce
  mode={'javascript'}
  // ...
  annotations={[{row: 0, column: 0, type: 'error', text: 'Some error.'}]}
/>

The manual annotation will show up briefly, then be removed once the worker runs. This gif shows a page refresh. On each page load the annotation shows up, but is then removed. annotation

I’ve disabled the worker with setOptions={{useWorker: false}}, but this also disables annotations done manually.

Thanks!

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:4
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
bkempercommented, May 20, 2019

Instead of using the annotations prop, I manually setAnnotations.

const Editor = ({ annotations: customAnnotations = [], value }) => {
  const [annotations, setAnnotations] = useState([]);
  const [editor, setEditor] = useState();

  const nextAnnotations = [
    ...annotations.filter(({ custom }) => !custom),  // annotations by worker
    ...customAnnotations.map((annotation) => ({ ...annotation, custom: true })) // flag for exclusion
  ];

  useEffect(() => {
    if (editor) {
      editor.getSession().setAnnotations(nextAnnotations);
    }
  }, [editor, JSON.stringify(nextAnnotations)]);

  return (
    <ReactAce
      mode="html"
      onLoad={setEditor}
      onValidate={setAnnotations}
      setOptions={{ useWorker: true }}
      value={value}
   />
}
3reactions
charlesgirouxcommented, Jul 4, 2018

I feel like there should be 2 sets of annotations. The manually added annotations and the ones generated by the mode’s parser. I think they currently collide and erase one another…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Modeling the Complexity of Manual Annotation Tasks
to assist and guide the work of annotators. Automatic annotation methods, sometimes based on machine learning, have been introduced to relieve the annotator ......
Read more >
Dealing with validation problems - Gradle User Manual
Missing normalization annotation ... This error occurs whenever a task or artifact transform is cacheable and that a file or file collection input...
Read more >
Data Annotation: Types of Annotation and Data Labeling
Learn about the world of data annotation: defintion, types and data labeling ... To give a sense of the scale of manual labor...
Read more >
Work on Video Frame Object Detection Tasks
The predict next feature will not overwrite manually created annotations. It will only add annotations. If you use predict next and as a...
Read more >
Manual Annotation Studio (MAS): a collaborative platform for ...
With respect to phage genomes, this would entail removal of assembly artifacts and genomic termini resolution [20]. Uploading the genome. Once ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found