cannot run javascript debugger under Winodws

NppExec
2013-01-22
2013-05-21
  • Ivo Stoykov
    Ivo Stoykov
    2013-01-22

    Hi

    I'm trying to execute this:

    cmd /k cd /d "$(CURRENT_DIRECTORY)" && Cscript "$(FILE_NAME)" //X //D && exit
    

    the problem is that //X and //D switches do not work.

    If I prepend echo command in front I got line trimmed up to first //

    echo cmd /k cd /d "$(CURRENT_DIRECTORY)" && Cscript "$(FILE_NAME)" //X //D && exit
    cmd /k cd /d "e:\Projects\_test" && Cscript "6.js"
    ================ READY ================
    

    Neither work such a script:

    NPP_SAVE
    cd "$(CURRENT_DIRECTORY)"
    cmd /c Cscript "$(FILE_NAME)" //X //D
    

    I've tried npe_debug on/off and here is the result&

    npe_debug on
    Debug Log is On (1)
    ================ READY ================
    cmd /c Cscript "$(FILE_NAME) //X //D"
    ; command info
    Current command item:  p = 0x75C6F50
    {
       _item  = "cmd /c Cscript "$(FILE_NAME) //X //D""
       _prev  = 0x0
       _next  = 0x0
       _owner = 0x7480FE8
    }
    ; executing ModifyCommandLine
    ModifyCommandLine()
    {
       [in]  "cmd /c Cscript "$(FILE_NAME) //X //D""
       GetCmdType()
       {
          [in]  "cmd /c Cscript "$(FILE_NAME)"
          CheckCmdAliases()
          {
             ; command aliases enabled
             [in]  "cmd /c Cscript "$(FILE_NAME)"
             [out] "cmd /c Cscript "$(FILE_NAME)"
          }
          [ret] 0x0 (unknown)
       }
       CheckNppMacroVars()
       {
          [in]  "cmd /c Cscript "$(FILE_NAME)"
          [out] "cmd /c Cscript "6.js"
       }
       CheckPluginMacroVars()
       {
          [in]  "cmd /c Cscript "6.js"
          [out] "cmd /c Cscript "6.js"
       }
       CheckCmdArgs()
       {
          [in]  "cmd /c Cscript "6.js"
          [out] "cmd /c Cscript "6.js"
       }
       CheckUserMacroVars()
       {
          [in]  "cmd /c Cscript "6.js"
          [out] "cmd /c Cscript "6.js"
       }
       CheckEmptyMacroVars()
       {
          [in]  "cmd /c Cscript "6.js"
          ; the function is enabled
          [out] "cmd /c Cscript "6.js"
       }
       ; command argument(s):
       [out] "cmd /c Cscript "6.js"
       ; command type:
       [ret] 0x0
    }
    ; starting child process "cmd /c Cscript "6.js"
    Microsoft (R) Windows Script Host Version 5.8
    Copyright (C) Microsoft Corporation. All rights reserved.
    test
    ; finished
    ================ READY ================
    

    npp is 6.2.3 with nppexec 0.4.3.1 under Windows 7

    will appreciate your ideas how to run this

     
  • Ivo Stoykov
    Ivo Stoykov
    2013-01-22

    Just for info:

    the above case works when a batch file is used.
    I've created a js.cmd file with following contents

    cscript.exe "%1" //X //D //NoLogo
    

    and the I run it from Execute console:

    NPP_SAVE
    cmd /c $(NPP_DIRECTORY)\js.cmd "$(FULL_CURRENT_PATH)"
    

    and default debugger fires correctly.

    Ivo

     
  • DV
    DV
    2013-01-22

    By the way, NppExec 0.4.3.2 exists already. 
    Refer to NppExec Manual, section 3.8.4 - your exact situation is descriped in the end of that section.

     
  • DV
    DV
    2013-01-22

    Additionally, if you need to use those  //  frequently, you may consider to specify another comment delimiter (instead of //) in NppExec. 
    Follow "NppExec_TechInfo.txt" - see the variable CommentDelimiter. (For example, you can set it to /// or to ## and so on.)

     
  • In addition to all the above workarounds, you can use this NppExec script too:

    cd $(CURRENT_DIRECTORY)
    Cscript /Nologo "$(FILE_NAME)"