Infineon / psoc6make

The PSoC 6 Make Library provides a make based build system for PSoC 6 designs.
Apache License 2.0
0 stars 4 forks source link

VSCode: Multiple build tasks set as default therefore developer always has to select from list. #1

Closed gtaska closed 4 years ago

gtaska commented 4 years ago

Prerequisites

Can you reproduce the problem reliably? Yes

Did you check current release notes for known issues? Yes

If this is not the latest release, have you checked newer releases? confirmed present in master/HEAD

Description:

The file make/scripts/vscode/tasks.json defines a number of tasks in the 'build' group, however every task is configured with "isDefault": true. As a result, every time you start the build task with a keyboard shortcut (default is Ctrl-Shift-B), the developer has to manually select the required build task.

Manually attempting to set a default build task in the IDE does not appear to rectify the problem.

If you manually change all but one of

"group": {
    "kind": "build",
    "isDefault": true
}

to

"group": "build"

in the json file, then everything works as expected.

Steps to Reproduce:

  1. In VSCode attempt to build using Ctrl-Shift-B

Expected Result:

The currently configured default build task starts automatically, without any additional developer input

Actual Result:

Developer always has to choose a build task from the list.

Frequency (1/1, 1/50, 1/100):

4/4

Build/Commit:

commit 8a7e307, comment: "Upload psoc6make 1.4.0.14345"

Target:

CY8CKIT-062-BLE

Host OS and Version:

Windows 10

Compiler:

gcc toolchain, provided by ModusToolbox 2.1

Environment

Visual Studio Code + ModusToolbox + app created using project-creator that pulls in psoc6make.

THANKS!
rmbk19 commented 4 years ago

Hi @gtaska,

Yes, you are right. Every task is configured with "isDefault": true which is why the user is asked to select the appropriate build task each time. If one task is set as default, then if any user, who is not aware of VSCode configurations, wishes to use a different build task the user should edit the task.json file and that is something that needs to be considered. I will be creating an internal ticket so that the development team can evaluate your request. Thank you for bringing this to our notice.

But for now, you can use the following method as a workaround -

  1. Click on File > Preferences > Keyboard Shortcuts. This will open the Keyboard Shortcuts tab.
  2. Next click on Open Keyboard Shortcuts (JSON) icon on the top right corner. I have highlighted the icon in the snapshot below. image
  3. This opens the keybindings.json file. Add the following lines into the file - { "key": "ctrl+q", "command": "workbench.action.tasks.runTask", "args": "Build: Build [Debug]" } You can modify the key and the build task if needed.
  4. Once you have edited, the contents of the file should be similar to this snapshot - image
  5. Save the file.

Now you should be able to use the shortcut to run the build task for all of the ModusToolbox projects. You can use this link for more information - VSCode - Binding keyboard shortcuts to tasks

Please let me know if it works for you.

Thanks and Regards, Rakshith

rmbk19 commented 4 years ago

Hi @gtaska,

Our internal team has updated the task.json file assigning a single task as the default build task. Thanks again for pointing this out. The issue will be fixed in the next release.

Regards, Rakshith

rmbk19 commented 4 years ago

Hi @gtaska,

Upon further review, we have decided not to assign the Debug Build Task as the default because it would force all the users to the same default task. Instead, we have added ‘auto-build tasks’ for launch configurations which automatically picks up the build task based on the config chosen (Debug/Release). If you switch the configuration (from Debug to Release or vice-versa), regenerate VSCode config files by using make vscode command so that the appropriate build task is used. Details regarding this will be documented and I will provide a link to the document on this issue once it is released

Thanks and Regards, Rakshith

gtaska commented 4 years ago

Either way, sounds good. Thanks.