ioBroker.javascript icon indicating copy to clipboard operation
ioBroker.javascript copied to clipboard

(Blockly) Warning when deleting a used function

Open aleks-83 opened this issue 6 years ago • 4 comments

When one deletes a variable that is still in use somewhere in the active script, there is a warning that tells me that this variable will be deleted there as well.

I think it would be nice to adopt that to the function snippet.

When one deletes a funktion snippet that is in use somewhere in the code, give a warning. Currently the call snippet of this function is just deleted as well, without notice maybe...

aleks-83 avatar Oct 25 '19 07:10 aleks-83

Are you talking about Blockly?

AlCalzone avatar Oct 25 '19 08:10 AlCalzone

Sorry, Yes i mean blockly. I updated the description

aleks-83 avatar Oct 25 '19 08:10 aleks-83

grafik

arteck avatar Nov 03 '19 17:11 arteck

here sample


<xml xmlns="http://www.w3.org/1999/xhtml">
  <block type="procedures_defcustomnoreturn" id="?gd0vS;kZx?WVfkUZ@,o" x="137" y="-512">
    <mutation statements="false"></mutation>
    <field name="NAME">etwas tun</field>
    <field name="SCRIPT">Y29uc3QgcHJlYWZpeCAgICAgICAgICAgPSAgICJqYXZhc2NyaXB0LjAuIjsgLy9HcnVuZHBmYWQNCg0KLy9kYXRlbnB1bmt0IG1pdCBFaW5oZWl0ZW4gWmFobCAoICUsIEwsIG0sKSB1c3cuDQpjcmVhdGVTdGF0ZShwcmVhZml4ICsgIlN0cm9tLktpbmRlcnppbW1lci5TdHJvbV9QcmVpcy4zRF9EcnVja2VyLlRhZWdsaWNoIiwgMCwge3JlYWQ6dHJ1ZSwgd3JpdGU6dHJ1ZSwgbmFtZTogIlTkZ2xpY2giLCByb2xlOiJzdGF0ZSIsIHR5cGU6ICJudW1iZXIiLCBkZWY6ICIwIiwgdW5pdDogIiJ9KTsNCmNyZWF0ZVN0YXRlKHByZWFmaXggKyAiU3Ryb20uS2luZGVyemltbWVyLlN0cm9tX1ByZWlzLjNEX0RydWNrZXIuTW9uYXRsaWNoIiwgMCwge3JlYWQ6dHJ1ZSwgd3JpdGU6dHJ1ZSwgbmFtZTogIk1vbmF0bGljaCIsIHJvbGU6InN0YXRlIiwgdHlwZTogIm51bWJlciIsIGRlZjogIjAiLCB1bml0OiAiIn0pOw0KY3JlYXRlU3RhdGUocHJlYWZpeCArICJTdHJvbS5LaW5kZXJ6aW1tZXIuU3Ryb21fUHJlaXMuM0RfRHJ1Y2tlci5KYWVybGljaCIsIDAsIHtyZWFkOnRydWUsIHdyaXRlOnRydWUsIG5hbWU6ICJK5GhybGljaCIsIHJvbGU6InN0YXRlIiwgdHlwZTogIm51bWJlciIsIGRlZjogIjAiLCB1bml0OiAiIn0pOw0K</field>
    <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
  </block>
  <block type="procedures_callcustomnoreturn" id="JM6O,v[ADIZ4[x9g+]S6" x="137" y="-487">
    <mutation name="etwas tun"></mutation>
    <next>
      <block type="comment" id=")yo%Hp!z2Q~:f;!H230%">
        <field name="COMMENT">3D Drucker </field>
        <next>
          <block type="comment" id="-yqMvw]I;H}3fASyU72P">
            <field name="COMMENT">Täglich</field>
            <next>
              <block type="on_ext" id="9POP_CSIM?gvX_=)]kvN" collapsed="true">
                <mutation items="2"></mutation>
                <field name="CONDITION">ne</field>
                <field name="ACK_CONDITION"></field>
                <value name="OID0">
                  <shadow type="field_oid" id="G}z#N{#mn8+cm]=@g=fW">
                    <field name="oid">default</field>
                  </shadow>
                  <block type="field_oid" id=":=bC2N@%P{K*RMsaMQ16">
                    <field name="oid">sourceanalytix.0.sonoff__0__3D_Drucker_Cube__ENERGY_Total.cost.01_current_day</field>
                    <comment pinned="false" h="80" w="160">CUBE</comment>
                  </block>
                </value>
                <value name="OID1">
                  <shadow type="field_oid" id="Lw?]PPZ.kZXp^XWrwb9t">
                    <field name="oid">default</field>
                  </shadow>
                  <block type="field_oid" id="ml2fOvrmD|du[FW]{GZn">
                    <field name="oid">sourceanalytix.0.sonoff__0__3D_Drucker_4MAX__ENERGY_Total.cost.01_current_day</field>
                    <comment pinned="false" h="80" w="160">CUBE</comment>
                  </block>
                </value>
                <statement name="STATEMENT">
                  <block type="control_ex" id="d7-jDo]J;AK,*]cXT[%D">
                    <field name="TYPE">true</field>
                    <field name="CLEAR_RUNNING">FALSE</field>
                    <value name="OID">
                      <shadow type="field_oid" id="7]wn):9OM#kFFdw*@-t{">
                        <field name="oid">javascript.0.Strom.Kinderzimmer.Strom_Preis.3D_Drucker.Taeglich</field>
                      </shadow>
                    </value>
                    <value name="VALUE">
                      <shadow type="logic_boolean" id="3]9#^J={OPStiFF7Qi1b">
                        <field name="BOOL">TRUE</field>
                      </shadow>
                      <block type="math_rndfixed" id="%o6BAQ@6inOa0d11f(}(">
                        <field name="n">2</field>
                        <value name="x">
                          <shadow type="math_number" id="]s_{l?R{O4JPxQ(0C}oC">
                            <field name="NUM">3.1234</field>
                          </shadow>
                          <block type="math_arithmetic" id="MY[7;aMHzzRCNbhje6(%" inline="false">
                            <field name="OP">ADD</field>
                            <value name="A">
                              <shadow type="math_number" id="[bv%h),R`!DdW!Bwo(NM">
                                <field name="NUM">1</field>
                              </shadow>
                              <block type="convert_tonumber" id="Rj!DQ9}1~j?N|U@j%GMN">
                                <value name="VALUE">
                                  <block type="get_value" id="~!I.=g6BnIt/PqW(C%u!">
                                    <field name="ATTR">val</field>
                                    <field name="OID">sourceanalytix.0.sonoff__0__3D_Drucker_Cube__ENERGY_Total.cost.01_current_day</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <value name="B">
                              <shadow type="math_number" id="(845}rFz2I0?g`/I8fs!">
                                <field name="NUM">1</field>
                              </shadow>
                              <block type="convert_tonumber" id=":g1[{90I8#yw#6KSe{zo">
                                <value name="VALUE">
                                  <block type="get_value" id="OD{G5!x#z];d*!2E@U}|">
                                    <field name="ATTR">val</field>
                                    <field name="OID">sourceanalytix.0.sonoff__0__3D_Drucker_4MAX__ENERGY_Total.cost.01_current_day</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                          </block>
                        </value>
                      </block>
                    </value>
                    <value name="DELAY_MS">
                      <shadow type="math_number" id="FXaCcI?-j6pGtq/(mO.X">
                        <field name="NUM">0</field>
                      </shadow>
                    </value>
                  </block>
                </statement>
                <next>
                  <block type="comment" id="CAgd/IzPy~7?d0d3*~VM">
                    <field name="COMMENT">Monatlich</field>
                    <next>
                      <block type="on_ext" id="=]^ov%1/7doD7(zt|q2g" collapsed="true">
                        <mutation items="2"></mutation>
                        <field name="CONDITION">ne</field>
                        <field name="ACK_CONDITION"></field>
                        <value name="OID0">
                          <shadow type="field_oid" id="26]^8i2CU|]Ukz,;-1n8">
                            <field name="oid">default</field>
                          </shadow>
                          <block type="field_oid" id="tfZ0}Cv.rrKTr;P%Ew)#">
                            <field name="oid">sourceanalytix.0.sonoff__0__3D_Drucker_Cube__ENERGY_Total.cost.03_current_month</field>
                            <comment pinned="false" h="80" w="160">CUBE</comment>
                          </block>
                        </value>
                        <value name="OID1">
                          <shadow type="field_oid" id="(hH(jHO`3AHQs5NXA-]e">
                            <field name="oid">default</field>
                          </shadow>
                          <block type="field_oid" id="O?^{|03n4~0g)C!OiMd0">
                            <field name="oid">sourceanalytix.0.sonoff__0__3D_Drucker_4MAX__ENERGY_Total.cost.03_current_month</field>
                            <comment pinned="false" h="80" w="160">CUBE</comment>
                          </block>
                        </value>
                        <statement name="STATEMENT">
                          <block type="control_ex" id="xy=AQ?Q%?#^]Dm8ZE#w,">
                            <field name="TYPE">true</field>
                            <field name="CLEAR_RUNNING">FALSE</field>
                            <value name="OID">
                              <shadow type="field_oid" id="x1dokWFPy5-.rK?bF?2m">
                                <field name="oid">javascript.0.Strom.Kinderzimmer.Strom_Preis.3D_Drucker.Monatlich</field>
                              </shadow>
                            </value>
                            <value name="VALUE">
                              <shadow type="logic_boolean" id="3]9#^J={OPStiFF7Qi1b">
                                <field name="BOOL">TRUE</field>
                              </shadow>
                              <block type="math_rndfixed" id="aUjxN2Dw**a^HuBajvH9">
                                <field name="n">2</field>
                                <value name="x">
                                  <shadow type="math_number" id="66`w;0hz;xDK`9Z||eAP">
                                    <field name="NUM">3.1234</field>
                                  </shadow>
                                  <block type="math_arithmetic" id="jL4t[N_;luW{o8)qMu6l">
                                    <field name="OP">ADD</field>
                                    <value name="A">
                                      <shadow type="math_number" id="[bv%h),R`!DdW!Bwo(NM">
                                        <field name="NUM">1</field>
                                      </shadow>
                                      <block type="convert_tonumber" id="Cq.A*f:[email protected]_">
                                        <value name="VALUE">
                                          <block type="get_value" id="10TadqUPLFFta}*TqHfF">
                                            <field name="ATTR">val</field>
                                            <field name="OID">sourceanalytix.0.sonoff__0__3D_Drucker_Cube__ENERGY_Total.cost.03_current_month</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <shadow type="math_number" id="(845}rFz2I0?g`/I8fs!">
                                        <field name="NUM">1</field>
                                      </shadow>
                                      <block type="convert_tonumber" id="IASri_H{5APd`HzS8E.n">
                                        <value name="VALUE">
                                          <block type="get_value" id="hWW[0oOz@L%RE[LaE9QX">
                                            <field name="ATTR">val</field>
                                            <field name="OID">sourceanalytix.0.sonoff__0__3D_Drucker_4MAX__ENERGY_Total.cost.03_current_month</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <value name="DELAY_MS">
                              <shadow type="math_number" id="{e=^X+g{1..iY-w1jWZR">
                                <field name="NUM">0</field>
                              </shadow>
                            </value>
                          </block>
                        </statement>
                        <next>
                          <block type="comment" id="B{Apa(cVS;z),meC)gn(">
                            <field name="COMMENT">Jährlich</field>
                            <next>
                              <block type="on_ext" id="3+5Mw94;O6iS|kQ}uu.W" collapsed="true">
                                <mutation items="2"></mutation>
                                <field name="CONDITION">ne</field>
                                <field name="ACK_CONDITION"></field>
                                <value name="OID0">
                                  <shadow type="field_oid" id="(R)3VDtj+W-5H^?LSA`W">
                                    <field name="oid">default</field>
                                  </shadow>
                                  <block type="field_oid" id="U/3)H0SF)d`qIEj%!vjU">
                                    <field name="oid">sourceanalytix.0.sonoff__0__3D_Drucker_Cube__ENERGY_Total.cost.05_current_year</field>
                                    <comment pinned="false" h="80" w="160">CUBE</comment>
                                  </block>
                                </value>
                                <value name="OID1">
                                  <shadow type="field_oid" id="iJYE]*Ep?us-IzG!pe{h">
                                    <field name="oid">default</field>
                                  </shadow>
                                  <block type="field_oid" id="vG_:%gW?93x.AUl@+e?0">
                                    <field name="oid">sourceanalytix.0.sonoff__0__3D_Drucker_4MAX__ENERGY_Total.cost.05_current_year</field>
                                    <comment pinned="false" h="80" w="160">CUBE</comment>
                                  </block>
                                </value>
                                <statement name="STATEMENT">
                                  <block type="control_ex" id="n{ps%4qcx-8mTXL@@p97">
                                    <field name="TYPE">true</field>
                                    <field name="CLEAR_RUNNING">FALSE</field>
                                    <value name="OID">
                                      <shadow type="field_oid" id=".-d_L3L5a`wawSs#AE=p">
                                        <field name="oid">javascript.0.Strom.Kinderzimmer.Strom_Preis.3D_Drucker.Jaerlich</field>
                                      </shadow>
                                    </value>
                                    <value name="VALUE">
                                      <shadow type="logic_boolean" id="3]9#^J={OPStiFF7Qi1b">
                                        <field name="BOOL">TRUE</field>
                                      </shadow>
                                      <block type="math_rndfixed" id="%=!?E9Q,2E/j?z:pKwGJ">
                                        <field name="n">2</field>
                                        <value name="x">
                                          <shadow type="math_number" id="e0,PidkJ1n:NL:g4;CO.">
                                            <field name="NUM">3.1234</field>
                                          </shadow>
                                          <block type="math_arithmetic" id="X+5~u]lhUdVzO)Q^3Pso">
                                            <field name="OP">ADD</field>
                                            <value name="A">
                                              <shadow type="math_number" id="[bv%h),R`!DdW!Bwo(NM">
                                                <field name="NUM">1</field>
                                              </shadow>
                                              <block type="convert_tonumber" id="~E^1VKY1vmjT@,^gYzcO">
                                                <value name="VALUE">
                                                  <block type="get_value" id="na6q!%Ewm(4bs{K@YY8F">
                                                    <field name="ATTR">val</field>
                                                    <field name="OID">sourceanalytix.0.sonoff__0__3D_Drucker_Cube__ENERGY_Total.cost.05_current_year</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <value name="B">
                                              <shadow type="math_number" id="(845}rFz2I0?g`/I8fs!">
                                                <field name="NUM">1</field>
                                              </shadow>
                                              <block type="convert_tonumber" id="!AS#~(z:WYs9cgDO]Ih=">
                                                <value name="VALUE">
                                                  <block type="get_value" id="B(wPp26j6R}zM0LO!cL9">
                                                    <field name="ATTR">val</field>
                                                    <field name="OID">sourceanalytix.0.sonoff__0__3D_Drucker_4MAX__ENERGY_Total.cost.05_current_year</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="DELAY_MS">
                                      <shadow type="math_number" id="`4Qj`fxPCvV1=XC!)Q!;">
                                        <field name="NUM">0</field>
                                      </shadow>
                                    </value>
                                  </block>
                                </statement>
                              </block>
                            </next>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </next>
      </block>
    </next>
  </block>
</xml>

arteck avatar Nov 03 '19 17:11 arteck