2017년 3월 31일 금요일

Getting information about errors and warnings for blocky code


For my project I need to get the number of warnings and error messages displayed (While working on block editor which can be viewed lower bottom left corner of the viewer window). I can see the code for doing same this behavior in blocky-all.js. But this file is generated runtime.

These are the contents for displaying the number of errors and warnings as text in blocky-all.js

  this.errorCount_ = Blockly.createSvgElement('text',
      {'fill': "black", 'transform':"translate(75,14)"},
      this.svgGroup_);
  this.errorCount_.textContent = "0";

  this.warningCount_ = Blockly.createSvgElement('text',
      {'fill': "black", 'transform':"translate(20,14)"},
      this.svgGroup_);
  this.warningCount_.textContent = "0";

These are the comments I found in the build-common.xml. But I am not sure how this file is being generated.

<!-- ==================================
       blocklyeditor_BlocklyCompile builds:
       - build/blockly-all.js
 ===================================== -->

  <target name="blocklyeditor_BlocklyCompile">
    <ant inheritAll="false" useNativeBasedir="true" dir="${appinventor.dir}/blocklyeditor"
         target="BlocklyCompile"/>
  </target>

Please can anyone suggest easy way for getting this information or point to some sources? Thanks in advance for all the help and time

--
There is some information about the blocks editor in this unfinished
document: The Blocks Editor in App Inventor 2

--
Thanks a lot that was helpful. The code logic related to error and warning counts is in warninghandler.js
--

댓글 없음:

댓글 쓰기