Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDE: VSCode tasks, intellisense and debug config generator #764

Merged
merged 2 commits into from
Oct 28, 2021

Conversation

rleh
Copy link
Member

@rleh rleh commented Oct 25, 2021

  • Fix copy-paste mistake in scons build system docs
  • scons openocd command added
  • :ide:vscode module generates VSCode tasks, intellisense and debug config file

image

@rleh rleh requested a review from salkinium October 25, 2021 13:07
Copy link
Member

@chris-durand chris-durand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@rleh
Copy link
Member Author

rleh commented Oct 25, 2021

I'm thinking about adding a scons openocd command to the modm:build:scons module as a counterpart to the scons debug-remote command. What do you think?

@rleh
Copy link
Member Author

rleh commented Oct 25, 2021

scons openocd command

That is one step to provide ready-to-use a VSCode debugger integration.
Actually this is not useful for VSCode integration, but in other cases.

@rleh rleh changed the title [doc] Fix copy-paste mistake in scons build system docs Build/debug: VSCode debugger config generator and minor fixes Oct 25, 2021
@salkinium salkinium added this to the 2021q4 milestone Oct 25, 2021
@rleh rleh force-pushed the fix/docs_scons_debug branch 5 times, most recently from 2166a34 to 7084c74 Compare October 26, 2021 14:39
@rleh rleh requested a review from salkinium October 26, 2021 15:57
@rleh rleh added the ci:hal Triggers the exhaustive HAL compile CI jobs label Oct 26, 2021
Copy link
Member

@chris-durand chris-durand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@chris-durand
Copy link
Member

@rleh It was suggested by @salkinium to also add the openocd command for the other build systems. Should we have that as well?

@salkinium
Copy link
Member

I'll add some changes in a fixup commit

@rleh
Copy link
Member Author

rleh commented Oct 26, 2021

@rleh It was suggested by @salkinium to also add the openocd command for the other build systems. Should we have that as well?

Oh, missed that comment.
I can do that, but since all the *-remote commands are only implemented for SCons the openocd command will probably be used almost exclusively together with SCons.

@salkinium
Copy link
Member

I really want a :ide:vscode module, even if it only does debug for now ;-P

The first two commits should be squashed and the commit msg should be adapted due to :build:vscode-debug not being correct anymore

@salkinium
Copy link
Member

I can do that, but since all the *-remote commands are only implemented for SCons the openocd command will probably be used almost exclusively together with SCons.

Good point, then leave it like that.

@rleh
Copy link
Member Author

rleh commented Oct 26, 2021

I can currently think of only two features that would improve integration with VSCode:

  • lbuild (project.xml) language support, this requires a vscode extension, ideally published on the official extension marketplace.
  • Show documentation on hover Already works:

image

(But we should probably inject the module documentation somehow into the generated source code.)

@salkinium
Copy link
Member

salkinium commented Oct 27, 2021

This module is not a Visual Studio Code integration in any way

It is now 😜 I played around with this and found it quite useful.

I've added:

  • wrappers for the SCons and Make build system, only compiling and uploading though.
  • a configuration file for IntelliSense so that it knows the compiler systems headers, the defines and include paths. This is better, since you get the actual system headers from the right compiler toolchain, rather than from your PC.
  • an RTT config, that unfortunately does not work due to some sad issues in their implementation (it's distabled for now).

I think that's as much as we can get out of VSCode without writing a custom extension.

Could you test this and tell me if this works for you? I have not defaulted the release build task, since in order to get to the other build tasks (upload) you have to use your mouse in the menu (Terminal -> Run Task...), where as now you can do Ctl+Shift+B to select the task you want to execute.

Copy link
Member Author

@rleh rleh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve ✅

@rleh rleh force-pushed the fix/docs_scons_debug branch 2 times, most recently from 3d9cdc6 to 809361d Compare October 28, 2021 14:07
rleh and others added 2 commits October 29, 2021 00:23
Co-authored-by: Niklas Hauser <niklas.hauser@rwth-aachen.de>
Co-authored-by: Niklas Hauser <niklas.hauser@rwth-aachen.de>
Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Squashed a little and fixed some indentation. 🚀

@salkinium salkinium merged commit 6b4d656 into modm-io:develop Oct 28, 2021
@salkinium salkinium changed the title Build/debug: VSCode debugger config generator and minor fixes IDE: VSCode tasks, intellisense and debug config generator Oct 29, 2021
@rleh rleh deleted the fix/docs_scons_debug branch October 29, 2021 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advanced 🤯 ci:hal Triggers the exhaustive HAL compile CI jobs enhancement 🌈 feature 🚧
Development

Successfully merging this pull request may close these issues.

3 participants