Ticket Created
over 3 years ago

CIQQA-753

VS Code plugin can run the wrong PRG file if multiple PRGs exist in the bin/ directory

- Windows 10

- Visual Studio Code 1.62.3

- Monkey C Extension 1.0.0

- SDK: 4.0.6

If multiple PRGs exist in the bin/ directory, VS Code will run the first one (in alphabetical order), which may not be the actual PRG that belongs to the project. This can cause problems if a new project is created by copying an existing project which has already been built once. Seems like it would also cause a problem if the project folder is renamed.

Recreation procedure:

- Create simple data field app in a folder called TESTA, which just returns "TESTA" in compute()

- Build app and note that TESTA.PRG is created. Run app and verify that it works as expected

- Copy project folder, and change the new folder name to TESTB. Change compute() to return "TESTB"

- Build app and note that TESTB.PRG is created. Run app and note that it's actually TESTA which runs.

- Delete TESTA.PRG from TESTB/bin, and run TESTB again. Note that TESTB runs now.

Parents
  • I've been trying to reproduce this, but based on the method of choosing the PRG that is defined in the launch configuration it doesn't seem like it can behave the way that you describe. 

    "prg": "${workspaceFolder}${pathSeparator}bin${pathSeparator}${workspaceFolderBasename}.prg",

    The PRG that is copied over to the temp/Garmin/Apps folder is based on the project folder name so changing the folder name changes both the name of the PRG that is created and the name of the PRG that is ran. 

    Is there any other information that you can give that might help show the difference between our VScode environments?

Comment
  • I've been trying to reproduce this, but based on the method of choosing the PRG that is defined in the launch configuration it doesn't seem like it can behave the way that you describe. 

    "prg": "${workspaceFolder}${pathSeparator}bin${pathSeparator}${workspaceFolderBasename}.prg",

    The PRG that is copied over to the temp/Garmin/Apps folder is based on the project folder name so changing the folder name changes both the name of the PRG that is created and the name of the PRG that is ran. 

    Is there any other information that you can give that might help show the difference between our VScode environments?

Children
  • Thanks for the reply!

    I've seen the launch config and your analysis sounds plausible, but I've seen this problem with more than one project. And there was a forum post by someone who had copied their project folder to start a new project, and had issues where it seemed that the old binary was being run (which sounds similar to or the same as this problem).

    Unfortunately I can't recreate it this second, but I'll give it another shot when I have more free time.

    I will note that I use CTRL-F5 to run my app and at the time I don't think I had a launch.json configuration.