Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Disable auto compile

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Disable auto compile

    I use Rider to develop NinjaScript which automatically saves files every half a second or so.
    Ninja Trader automatically compiles when it detects changes, so it compiles very often because Rider saves very often.
    How do I disable the auto compilation?

    #2
    Hello Bobin,

    To disable the auto compiling, close all open NinjaScript Editors.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I have just started using JetBrains Rider to develp NinjaScripts. I followed the setup instructions for Visual Studio, and I'm able to use Rider to work with the NinjaTrader.Custom project.

      I have a NinjaScript editor window open, but the editor does not always reflect the file changes when I save from within Rider.
      To guarantee that NinjaScript editor detects changes, I can delete a line ending semi-colon (within Rider). I then have to go to the NinjaScript editor and re-add the semi-colon.
      This way all my edits are detected and the script compiles.

      I notice that all file edits from within Visual Studio are detected automatically by the NinjaScript editor.
      Is there any way that I can get the NinjaScript editor to detect Rider file changes without the above work around?

      Comment


        #4
        Hello FatCanary,

        Thank you for your note.

        I have a NinjaScript editor window open, but the editor does not always reflect the file changes when I save from within Rider.
        Do you notice if there are any specific actions that do/do not trigger a compile in the NinjaScript Editor? What steps are you taking to save from within Rider? Ultimately, Rider is not documented by NinjaTrader and therefore is not supported. We wouldn't be able to troubleshoot the behavior of a third-party program. I was able to find this publicly available link from the JetBrains website with information about saving/reverting changes in Rider:


        You could try modifying the actions performed on each save to see if you get different results.

        Please let me know if I may be of further assistance.
        Emily C.NinjaTrader Customer Service

        Comment


          #5
          Hi Emily

          Thanks for the saving/reverting changes link, but I don't think that is the issue. I do manual saves in any case.

          On further investigation, it looks as though NinjaScript editor is 'listening' for file changes but only reliably responds if it detects an error. For example, a missing semi-colon, a missing math operator.
          If I fix the error from within Rider, NinjaScript editor seems to not respond to those changes.

          I fully understand that Rider is not supported by NinjaTrader, but it seems that this is more a case that the NinjaScript editor is fussy what it responds to. I would have thought that if it were listening for file changes, then it would pick up on all file changes.

          Could it have anything to do with NinjaScript editor being debug mode?
          Last edited by FatCanary; 11-16-2022, 09:38 AM.

          Comment


            #6
            Hello FatCanary,

            Thank you for your reply.

            This could be related to debug mode; I just tested in a different text editor and it was not compiling as expected when debug mode was enabled. Please right-click in the NinjaScript Editor then uncheck debug mode. Now, test saving after an edit in Rider to see if this auto-compiles the NinjaScript Editor as expected. You may need to close and relaunch Rider first.

            Please let me know if the symptoms persist.
            Emily C.NinjaTrader Customer Service

            Comment


              #7
              Hi Emily

              I'm not sure that disabling debug mode has made a difference. It may have, but the NinjaScript editor's response is weird and unpredictable.

              I can see no pattern as to when the NinjaScript editor will respond and compile.

              For example, I can save an edit, and NinjaScript editor appears to do nothing. I can then put a space at the end of a line, save, and NinjaScript editor will compile.
              Last edited by FatCanary; 11-16-2022, 11:48 AM.

              Comment


                #8
                Hello FatCanary,

                Thank you for your response.

                Do you have another program that you could use to test, such as Visual Studio or Sublime text? I have not been able to replicate this behavior with these programs, so I am curious to know if they exhibit the same behavior on your PC or if saving in the editor compiles in NinjaTrader as expected. If these programs behave as expected, that helps to narrow down the issue to Rider only.

                I look forward to hearing the results.
                Emily C.NinjaTrader Customer Service

                Comment


                  #9
                  Hi Emily

                  Visual Studio works fine with the NinjaScript editor. Unfortunately I do not like VS.

                  Let me give Sublime Text a go and see what happens.

                  Comment


                    #10
                    Hi Emily

                    Well, I am totally confused.

                    Making an edit in Sublime Text is reflected in NinjaScript editor, but only after saving the file twice.
                    However, I can make the edit, save once, and that same edit is reflected in Rider.

                    VSCode works, but also requires me to save twice.

                    I can save in Rider, and the edits are reflected in both VSCode and Sublime Text.
                    Last edited by FatCanary; 11-16-2022, 02:29 PM.

                    Comment


                      #11
                      I may have narrowed it down, Rider only saves a file if the file has changed. Whereas, VSCode will just save the file whether it has changed or not.
                      So, if it takes two saves for NinjaScript editor to respond, Rider will not do anything on the second save, which means NinjaScript editor does not know anything has happened.

                      It appears there is no way to get Rider to save an unchanged file.
                      Last edited by FatCanary; 11-16-2022, 02:48 PM.

                      Comment


                        #12
                        Hello FatCanary,

                        Thank you for the information.

                        Your findings are certainly interesting, although I do not know of a way to get Rider to save an unchanged file. You could certainly check after saving a file if the last modified date/time in the file explorer is the current date and time from the moment of saving it. Otherwise, if there are no changes and the file is not newly saved, it would be expected that the NinjaScript Editor does not detect a change and therefore does not trigger the editor to compile scripts.

                        I appreciate your time and patience.
                        Emily C.NinjaTrader Customer Service

                        Comment


                          #13
                          Hi Emily

                          ...it would be expected that the NinjaScript Editor does not detect a change and therefore does not trigger the editor to compile scripts.
                          Yep, that's my conclusion. And, since it is not possible to have Rider save unchanged files, I guess it is what it is.

                          Thanks for the assistance.

                          Comment


                            #14
                            Hi Emily

                            Can I just check, that from your testing, you did not need to save twice to get the NinjaScript editor to recognise a file change?

                            I have now tried JetBrains Rider, JetBrains Fleet, VSCode and Sublime Text, and they all require a double save.
                            I'm trying to work out if the issue lies with my setup.

                            Comment


                              #15
                              Hey FatCanary,

                              I do not need to save twice for the NinjaScript compiler to kick in. I can use Visual Studio by clicking the button in the NinjaScript Editor toolbar, then each time I save with Ctrl + S the NinjaScript Editor compiles, even if I have not made any edits to any files.

                              Please let me know if I may be of further assistance.
                              Emily C.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by PaulMohn, Today, 03:49 AM
                              0 responses
                              7 views
                              0 likes
                              Last Post PaulMohn  
                              Started by inanazsocial, Today, 01:15 AM
                              1 response
                              9 views
                              0 likes
                              Last Post NinjaTrader_Jason  
                              Started by rocketman7, Today, 02:12 AM
                              0 responses
                              10 views
                              0 likes
                              Last Post rocketman7  
                              Started by dustydbayer, Today, 01:59 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post dustydbayer  
                              Started by trilliantrader, 04-18-2024, 08:16 AM
                              5 responses
                              23 views
                              0 likes
                              Last Post trilliantrader  
                              Working...
                              X