Skip to content

Feature vscode #3915

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

Merged
merged 1 commit into from
Apr 20, 2017
Merged

Feature vscode #3915

merged 1 commit into from
Apr 20, 2017

Conversation

janjongboom
Copy link
Contributor

@janjongboom janjongboom commented Mar 9, 2017

Adds the Visual Studio Code exporter. See also #3568 and #3679.

Things that are a bit broken

  • Non-recursive includes are broken in Visual Studio Code on Windows and Linux. Will be fixed upstream. Works on Windows.

@janjongboom janjongboom force-pushed the feature-vscode branch 4 times, most recently from 9977a34 to 1d925b3 Compare March 9, 2017 14:58
Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

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

Looks nice. I look forward to seeing this on master.

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

Is this now ready for integration?

@@ -0,0 +1,37 @@
# VSCode exporter
Exporting for Microsoft Visual Studio code works on Windows, Mac and Linux but will expect a few system dependnecies to be installed. The exporter creates task files and launch files that make it easy to compile and debug within the IDE. Building is done using the created makefile. Debugging with GDB and pyOCD
Copy link
Contributor

Choose a reason for hiding this comment

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

dependnecies to be installed.

dependencies

@@ -0,0 +1,80 @@
from os.path import join, exists, realpath, relpath, basename, isfile, splitext
Copy link
Contributor

Choose a reason for hiding this comment

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

missing license header on top of the file

@janjongboom
Copy link
Contributor Author

@0xc0170 Let's see what the MS people come back with around the two issues raised.

@adbridge
Copy link
Contributor

restart uvisor

@sg- sg- removed the needs: review label Mar 22, 2017
@janjongboom
Copy link
Contributor Author

@sg- @0xc0170 Windows now debugs out of the box!

According to MS the issue with non-recursive paths is only there on macOS and Linux, so I'd suggest to just release this, and when the new version of vscode comes out it will be patched for mac and Linux. The right paths are already generated.

@janjongboom
Copy link
Contributor Author

Proof that it's context-aware :-) (exported to K64F). Jump to definition also goes to the right PinNames file now.

vscode-context-aware

@janjongboom
Copy link
Contributor Author

@sg- @0xc0170 Can someone test this and merge if they're happy?

@janjongboom
Copy link
Contributor Author

Ping again, @0xc0170 @theotherjimmy

@theotherjimmy
Copy link
Contributor

What do you need from me? I can't merge PRs and I approved this one.

@janjongboom
Copy link
Contributor Author

@theotherjimmy Then, ping @sg- again :p

Copy link
Contributor

@sg- sg- left a comment

Choose a reason for hiding this comment

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

A few questions and some docs work but looking good. Let me know what parts I can help with.

"debugServerPath": "pyocd-gdbserver"
},
"windows": {
"preLaunchTask": "make.exe",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to prelaunch and run make on windows only?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't. There's a global prelaunchTask for make which runs on macOS and Linux.

"windows": {
"preLaunchTask": "make.exe",
"MIMode": "gdb",
"MIDebuggerPath": "C:\\Program Files (x86)\\GNU Tools ARM Embedded\\4.9 2015q3\\bin\\arm-none-eabi-gdb.exe",
Copy link
Contributor

Choose a reason for hiding this comment

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

Though it was ok to just use the executable name. Why the path here?

},
"osx": {
"MIMode": "gdb",
"MIDebuggerPath": "/usr/local/bin/arm-none-eabi-gdb",
Copy link
Contributor

Choose a reason for hiding this comment

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

Though it was ok to just use the executable name. Why the path here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sg- Only for debugServerPath unfortunately... See this comment.

},
"linux": {
"MIMode": "gdb",
"MIDebuggerPath": "/usr/bin/arm-none-eabi-gdb",
Copy link
Contributor

Choose a reason for hiding this comment

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

Though it was ok to just use the executable name. Why the path here?

"MIMode": "gdb",
"MIDebuggerPath": "C:\\Program Files (x86)\\GNU Tools ARM Embedded\\4.9 2015q3\\bin\\arm-none-eabi-gdb.exe",
"debugServerPath": "pyocd-gdbserver.exe",
"setupCommands": [
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this override global setup commands or should they be moved under Mac / Linux?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this overrides the global setupCommands section. So only applies on Windows.

@@ -0,0 +1,40 @@
# VSCode exporter
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets get rid of this and have a proper docs page in the handbook under exporters

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@janjongboom
Copy link
Contributor Author

@sg- Rebased against master. Docs are in the handbook now: https://docs.mbed.com/docs/mbed-os-handbook/en/5.4/debugging/vscode/ .

@sg-
Copy link
Contributor

sg- commented Apr 10, 2017

The handbook makes me sad. I think this is what every exporter page should look like. I'd never look under debugging to find this

@theotherjimmy
Copy link
Contributor

restarting Cam-CI because it failed due to a java traceback. We did not write java stuff.

@sg-
Copy link
Contributor

sg- commented Apr 10, 2017

Looking great! Other than moving the docs under the category exporter 👍 We should also consider what is the default debugPath should be. Reasonable options seem to be:

  • Default installation path for the version of GCC_ARM that is supported (4 soon to be 6)
  • Default installation path as installed by mbed CLI installer
  • A environment variable such as VSCODE_GDB_PATH that is required to be setup per machine such that each export doesnt need this field modified
  • Similar, instructions on how to make a symlink from the actual installed path to the path defined by the template

Thoughts?

@janjongboom
Copy link
Contributor Author

janjongboom commented Apr 21, 2017

Tears in my eyes! This is gonna be in 5.4.5 ?

@theotherjimmy
Copy link
Contributor

I can't see why not. @adbridge Could you check the release version for me?

@theotherjimmy
Copy link
Contributor

Thanks for the new exporter @janjongboom !

@sg-
Copy link
Contributor

sg- commented Apr 21, 2017

@janjongboom mbed-cli now supports flashing https://github.com/ARMmbed/mbed-cli/releases/tag/1.1.0

This maybe an option for flashing as it will support all boards and not be restricted to pyOCD support (other than the debug ability)... Just a thought I might try out unless you beat me to it :)

@adbridge
Copy link
Contributor

@theotherjimmy You were the one that marked it to go to 5.5.0 .....

@theotherjimmy
Copy link
Contributor

wait what did I mark for 5.5.0?

@adbridge
Copy link
Contributor

This pr

@theotherjimmy
Copy link
Contributor

is 5.4.5....

@janjongboom
Copy link
Contributor Author

@sg- Yeah, but the feature now does not require CLI at all.

@theotherjimmy
Copy link
Contributor

theotherjimmy commented Apr 21, 2017

I'm with @janjongboom on this one. Let's keep the exporter free of calls to mbed CLI.

Maybe @sg- was suggesting that you use the same backend?

@adbridge
Copy link
Contributor

beg your pardon i meant 5.4.5 , it's Friday afternoon here and getting close to home time :)

@theotherjimmy
Copy link
Contributor

That's cool. Now that we're on the same page, I don't see what the surprise is about.

@theotherjimmy
Copy link
Contributor

I just wanted you to make sure that it was allowed to go to 5.4.5.

@theotherjimmy
Copy link
Contributor

@janjongboom We have turned off the VScode pages on the docs sight until this gets into a release.

@adbridge
Copy link
Contributor

It looks like it is only adding an extra exporter rather than changing any interfaces, so that would make it eligible for a patch release (also assuming it doesn't rely on any other changes that have been bumped to 5.5.0, of which 2 had to be done today)....

@theotherjimmy
Copy link
Contributor

Yeah. I don't think it is rebased/based on any changes that would cause patch problems come release time.

@adbridge
Copy link
Contributor

@janjongboom I didn't quite understand your comment about which release this was scheduled for? Where you hoping for it to make 5.4.4 ? If so, it just missed it due to it being labeled for 5.4.5. But that will be produced in 2 weeks time....

@sg-
Copy link
Contributor

sg- commented Apr 21, 2017

I just wanted you to make sure that it was allowed to go to 5.4.5.

If this does it also needs docs rebuilt for the release and tools deployed.

@networkfusion
Copy link

If this has been released, when will the docs be re-enabled?

@theotherjimmy
Copy link
Contributor

Thanks for the reminder @networkfusion. @AnotherButler Let's turn the docks back on.

@networkfusion
Copy link

@theotherjimmy @AnotherButler thanks, please let me know the link when it happens :-)

@janjongboom
Copy link
Contributor Author

@theotherjimmy Can we also make sure it's enabled in online compiler?

@theotherjimmy
Copy link
Contributor

It's not yet. I can push up the 5.4.5 tools release and let you know when it's up.

@janjongboom
Copy link
Contributor Author

@theotherjimmy Cool, please ping me when it's done. I have a blog post ready.

@AnotherButler
Copy link
Contributor

@networkfusion @theotherjimmy The docs are live.

exmachina-auto-deployer pushed a commit to exmachina-dev/mbed-os that referenced this pull request May 16, 2017
…lwip_broadcast

Release mbed OS 5.4.5 and mbed lib v142

Ports for Upcoming Targets

Fixes and Changes

4059: [Silicon Labs] Rename targets ARMmbed#4059
4115: Support for Qt Creator Generic project export and associated Makefile ARMmbed#4115
3915: Feature vscode ARMmbed#3915
4205: tests: race test - add not supported for single threaded env ARMmbed#4205
4187: [NCS36510] Reduce default heap size allocated by IAR to 1/4 of RAM ARMmbed#4187
4145: test - add nanostack to examples.json file ARMmbed#4145
4093: Update.py: New feature - update a branch instead of a fork, plus general improvements. ARMmbed#4093
4225: fixed missing device_name for xDot and removed progen ARMmbed#4225
4243: Config: config header file should contain new line ARMmbed#4243
4251: Fix C++11 build error w/ u-blox EVK-ODIN-W2 ARMmbed#4251
4236: STM32 Fixed warning related to __packed redefinition ARMmbed#4236
4224: Add `mbed new .` output to export ARMmbed#4224
4190: LPC4088: Enable LWIP feature ARMmbed#4190
4136: Error when bootloader is specified but does not exist ARMmbed#4136
3881: Remove debug links to printf/exit in NDEBUG builds ARMmbed#3881
4260: Inherit Xadow M0 target from LPC11U35_501 ARMmbed#4260
4249: Add consistent button names across targets ARMmbed#4249
4254: Removed unused variable in TARGET_NXP/lpc17_emac.c ARMmbed#4254
@carlosperate
Copy link

Is it a correct assessment that the docs have been updated (including instructions for the online compiler), but the online compiler has not been updated to >= 5.4.5 yet?

@theotherjimmy
Copy link
Contributor

Yes. @immunda Could your respond here too when the tools update goes live?

@carlosperate
Copy link

Thanks for the quick response! I'll keep an eye for when the update goes live online as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.