-
Notifications
You must be signed in to change notification settings - Fork 168
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
VS Code Support #78
VS Code Support #78
Conversation
r? @korken89 (rust_highfive has picked a reviewer for you, use r? to override) |
Hmm, we might need a vote on whether to include this or if we want it as Either way, could you add a |
I’m open to maintaining it myself if anyone has ideas on how to separate it, while still making it easy to get up and running. Otherwise, I’m going to end up maintaining a fork, which I’d like to avoid. I’m obviously happy to add a section to the readme as well. Will push up a commit when I get a moment. |
@thejpster I am curious what you found to be fiddly, so that I can document better. I noticed that on an initial |
I added documentation. I think I found the "fiddly"-ness you mentioned. |
The templates are kind of ment to be plentyful to cater for a lot of different needs. I agree it would be supernice to have a good template for vscode but I also have to agree with @thejpster that this might be a good candidate for a new crate which we might even host right next to the simple template. I must admit I'm not using any of those and neither am I sure what status they're in and whether people (still) find them useful in general. |
The problem with making it a different template is I can’t I’m happy to maintain the feature, whether here or in a different repo, but I don’t know how it could possibly be split into a separate repo. If anyone has an idea on how to accomplish that, I’m happy to go down that path. I personally don’t see why adding basic editor configs wouldn’t be in scope for a QuickStart template. As a user of the template, I like the convenience of |
So? Why would you need more than one?
Would need to check the implementation but it should be somehow possible to split out the common parts into a seperate crate/module and just keep the "on-top" details to the crate called into by
So whenever you generate a quickstart project you'd automatically get all possible IDE configurations (potentially even outdated/incorrect), too? Sounds like a hot mess to me. |
I’d also like to call out that I’ve seen several people claim that lack of editor support as one of the reasons they’re not adopting Rust for their embedded development. One such example here, although, I’d say the awkwardness of interrupt handling (disabling ALL interrupts) and lack of a safety certified compiler are the bigger blockers for many. https://users.rust-lang.org/t/rust-2020-growth/34956/102 This could be one small step toward showing folks that there is indeed pretty good editor support, for at least one editor. If we could then add configs for CLion & Vim, we could cover the preferences of the vast majority of devs. |
I don’t. I want a single template. That’s why I added it here.
I’m not terribly familiar with
Does it? It honestly doesn’t sound crazy to me to support a handful of the editors we know people are actually using to do CortexM dev with Rust. It’s all about reducing friction to gain further adoption. You also have a volunteer to help maintain the VS Code config. |
That's not what I meant. If you have environment specific templates, why would you want more than one at a time?
The crazy part here is throwing them all in one pot and supporting them at the same time. If you're a VSCode user, why would you want Emacs, Vim, CLion and Eclipse support in your generated crate? |
You’ve never worked on a project where different people worked with different editors? Having the extra configs doesn’t matter to a developer. I’m not using that editor, so I simply ignore their existence. I’m just trying to make the experience of getting up and running as frictionless as possible. I thought that would be a primary goal of this project. |
Listen guys, I used to maintain a successful project. 90% of my effort went into telling people a feature was out of scope. So, I understand if you decide this is out of scope. I'll maintain a fork if I have to, but I'd rather not. I really do think this is a good thing to add to the project. If I didn't, I wouldn't have taken the time to submit the PR. |
Sure, but everyone is enabling their own setup. People do not generally allow support for custom setups in their checked in code.
It does matter. It clutters up the source code and adds expectations to a project that someone will actively manage the setup. Both the upkeep and the ensuring that available configurations work and are of equal quality are not goals of this project. Those templates are meant as a one-shot bootstrap method. |
@rubberduck203 We're looking into options here. The idea of having automatic VS Code setup is very agreeable and I already told you my ideas of how we could make this work as part of a embedded WG endorsed project. If you prefer to fork and do your own thing that is fine of course. |
I certainly don't prefer to fork. I'm cool with sticking around to make sure the vscode configs continue to work into the future, as I'm actively using them, but I don't want to take on the extra burden of keeping a fork up to date with upstream if I don't have to. Unfortunately, You say you've given me your ideas on how to make this work, but all you've suggested is creating a new repository specifically for these configs, which won't actually work. |
Does |
I don't see why it wouldn't work. I was kind of hoping we could add custom code to be executed but I just checked and it's really only templating stuff. :( |
It looks like generate does support submodules. Let me see what I can do. |
Ok, so I've done some experimenting.
My first attempt was to have a repository that held the VS Code configs and submoduled in cortex-m-quickstart.
This won't work because git forces a subdirectory and what you end up with is this.
This puts the quickstart files down one directory too far. I then tried it the other way around, submoduling the editor config into cortex-m-quickstart. However, I don't think it's a good idea to have a repository containing just the configs and using a submodule to pull it into the quickstart. You had expressed concern about cluttering the generated project with editor configs, this will continue to do that (even if I disagree that it's a real problem). On top of that, it actually becomes harder to maintain the quickstart if the I'm earnestly open to suggestions here. I'm not sure what else to try that would result in a satisfactory solution for everyone. TL;DR:
|
I also would like to quickly address a comment I hadn't noticed earlier.
So are these editor configurations. I fully expect users to either delete them outright, ignore them, or modify them for their own specific needs (mcu and frequency adjustments most likely). |
So after some reflection, and given the changes to the README, I think I'm now actually happy with including the
On a semi-related note, it seems like it would be nice if there was an SVD server you could just hit with a part number (and perhaps a peripheral) to get register descriptions - saves us having to scrape them out of various IDEs and hide them in various Github repositories. A bit like the Windows debug symbol server. Thank you for persevering with this one! We're nearly there :) |
@thejpster Thanks for chiming in with another opinion. I agree with your assessment and proposed changes. |
One thing I'd point out is that if
|
I honestly considered not including it and just leaving instructions on how to obtain it, but you don't get a fully working editor without it. Moving it to the.
Good idea.
Absolutely. I think I'm also going to move the bulk of the VS Code docs to the
Technically, no, JSON files are not allowed to have comments according to the spec, but whatever parser vscode uses parses them fine.
The Also, FWIW, I stumbled across this Jetbrain's Rust survey the other day. It indicates that 42% of Rust devs are using VS Code, followed by Vim & CLion at 20% each, so I'm really happy we were able to come to a solution here. Thanks for bearing with me. TODO:
Did I miss any action items? |
Does anyone rebase against cortex-m-rt-quickstart though? If you run |
I pushed up a few more commits addressing the feedback. |
Quick summary of yesterday’s embedded WG meeting in regards to this PR:
|
Short term, how do you all feel about removing the SVD and just having instructions on how to obtain it? It may take me a while to work out the SVD pack thing. |
@rubberduck203, great work. I've been using VS Code for embedded development extensively over the last years. I'm teaching classes in embedded systems at Luleå University of Technology, where the students get to design and program embedded systems. Usually I have prepared ready made repositories so they can get stated, with pre-configured .vscode. (Using Cortex Debug). Research wise we have been developing the RTFM framework for safe and efficient concurrency. It just struck me that besides a quickstart template for I have opened an issue at rtic-rs/rfcs#26 for anyone interested in further discussing that. |
I'm quite happy with that approach. Avoids files people don't need and any weird licensing issues. |
819fb6e
to
33644f9
Compare
@thejpster I removed the SVD (including removing it from the history). |
Adds basic configuration for VS Code for QEMU and STM32F3DISCOVERY.
33644f9
to
57de818
Compare
bors r+ |
Configuration problembors.toml: not found |
Oh, we do this the old fashioned way... |
I would like to thank everyone for sticking this one out with me! I’m very happy to see this merged. |
I'm not sure if the project is interested in this, but I couldn't figure out any way to keep my VS Code template separate from the cortex-m-quickstart template.
This patchset adds VS Code debug configurations/examples for both QEMU and OpenOCD (lm3s6965evb and stm32f303vct6 respectively).
I couldn't find an SVD file for the Texas Instruments controller, so there's no in editor peripheral viewer for that one.