CppCast - VS Code
Episode Date: November 16, 2017Rob and Jason are joined by Rong Lu to talk about C++ support with the Visual Studio Code Editor and some of the recent improvements made to it. Rong Lu is a Program Manager in the Visual C++ ...team at Microsoft. She has been on the Visual Studio team since she graduated with her master degree in computer science 10 years ago. She currently works on Visual Studio tools for games, C++ mobile, and the C++ experience in Visual Studio Code. Before joining the C++ team, she spent 4 years building the VS SharePoint and architecture tools. News Trip Report: Fall ISO C++ Standards meeting (Albuquerque) Pacific++ Videos Available C++/WinRT is now included in the Windows SDK Don't use C++ auto? Catch2 released London and Sweden distributed meetup writeup Rong Lu @davorabbit Links Visual Studio Code C++ for Visual Studio Code CppCon 2017: Rong Lu "C++ Development with Visual Studio Code" Visual Studio Code C/C++ extension Nov 2017 Update - Multi-root workspaces support is here! Visual C++ Team Blog Sponsors Backtrace JetBrains Hosts @robwirving @lefticus
Transcript
Discussion (0)
This episode of CppCast is sponsored by Backtrace, the turnkey debugging platform that helps you spend less time debugging and more time building.
Get to the root cause quickly with detailed information at your fingertips.
Start your free trial at backtrace.io.cppcast.
And by JetBrains, maker of intelligent development tools to simplify your challenging tasks and automate the routine ones.
JetBrains is offering a 25% discount for an
individual license on the C++ tool of your choice, CLion, ReSharper, C++, or AppCode.
Use the coupon code JetBrains for CppCast during checkout at JetBrains.com.
Episode 126 of CppCast with guest Rong Liu, recorded November 16th, 2017.
In this episode, we talk about the ISO C++ meeting in Albuquerque.
Then we talk to Rong Liu from the Microsoft Visual C++ team.
Rong Liu talks to us about C++ developers by C++ developers.
I'm your host, Rob Berger, and joined by my co-host, Jason Turner.
Jason, how are you doing today? Welcome back back i'm doing pretty good thanks rob yeah just got back from meeting c++ effectively
with my fourth conference of the year which is two times more than i usually do yeah you're
ready to take a break yeah i'm not planning to do any more conferences in 2017 yeah i think you
you're ready for some downtime as we enter the holiday season.
How was meeting C++, though?
It was great. It was fun.
It was a lot of fun to meet some of our European friends and listeners of the show
that don't make it out to the North American conferences,
so I haven't had the chance to meet them before. And I really am glad that I took the opportunity to do that.
Yeah, sounds like it was a good conference. Hopefully I'll maybe get a chance to get out
there sometime. Yeah, I know Jens is working on getting the videos up too. But I don't know,
you know, there's no guarantee when exactly they'll be coming. But as far as I know,
every session is recorded.
So as in previous years, we should expect to see them.
Awesome.
Okay, well, at the top of our episode, I'd like to read a piece of feedback.
This one, we got a tweet.
This came out last week from Brigham saying,
CBBCast, I'm at my first C++ Standard Committee meeting,
largely because I was inspired by a few interviews you guys did,
and I'm loving it.
So this is pretty cool that he decided to go to one of the standards meetings just from listening to our show.
I'm glad he had a good time.
Yeah, that's cool.
I would have liked to have gone myself.
I mean, I think the average listener who pays attention
knows that I'm in the Denver area.
So Albuquerque was theoretically the best opportunity for me.
It would be like a four or five hour drive or something.
Unfortunately, you were in Europe at the time.
Unfortunately, I was at meetings.
I don't know how to phrase.
Do you say unfortunately I was at meetings?
I don't.
Yeah, it should be fortunately.
Sure.
Right.
We'll have to keep an eye on future ISO standards meetings
to see if there's ever one that we could more easily make it to.
Yeah, they have the next few posted.
I don't know if you've gone and looked at that.
I'm looking at it now.
It looks like the next one is in Jacksonville Florida in March that is not
unreasonable I would put it as a possibility
something to think about but I think you know maybe instead
you should aim for Switzerland
be a fun trip
yeah and that'll be in
June? Yeah June
yeah
okay well we'd love to hear your thoughts about
the show as well you can always reach out to us
on Facebook, Twitter or email us at
feedback at cpcast.com and don't forget
to leave us a review on iTunes
joining us today is
Rong Liu. Rong is a program manager
in the Visual C++ team at
Microsoft. She has been on the Visual Studio team since she graduated with her master's degree in
computer science 10 years ago. She currently works on the Visual Studio tools for games,
C++ mobile, and the C++ experience in Visual Studio Code. Before joining the C++ team,
she spent four years building the VS SharePoint and architecture tools.
Rong, welcome to the show.
Thank you. It's really an honor to be here. Thanks for inviting me.
I'm curious. So conversations that came up at Meeting C++ about how people got started in C++.
And I'm curious how you got your start in C++.
Yeah, that's a great question.
I started on the team six years ago.
And before that, I wasn't doing anything related to C++, honestly.
I was building SharePoint tools and architectural tools.
So SharePoint was mostly a C Sharp and VB development tool.
Okay. And I actually have one of my previous managers who joined the C++ team,
and he happened to have an opening.
And it was a position on the IDE side
for C++ developers on the VS team.
And I was pretty interested in looking at...
We have so many
C++ developers
in the world and
Visual Studio provides really great tools
for all developers and I was really
interested in looking at how we can make
the design time experience even
better in Visual Studio for C++.
So that's how I ended up
on his team and
that's when I moved over to the C++ team.
Yeah, I was really interested on the IDE side of the things.
So I've been here since then.
So is the IDE for Visual Studio written in C++, or is that a dumb question, I guess?
So it's partially.
So it started with, when Visual Studio started, it was all native code.
And I think over the years, we redid some of the editor in C Sharp, WPF.
Some of the front-facing stuff.
Partially, the editor is still written in C++.
Okay.
Okay.
So, Rong, we got a couple of news articles to talk about,
and then we'll start talking to you more about Visual Studio Code
and the C++ experience there, okay?
Cool. Sounds good.
Okay.
So this first one, we were just talking about the ISO standards meetings.
Last week was the Albuquerque fall ISO C++ standards meeting,
and we got a trip report here from Herb Sutter,
and it sounds like it was another pretty eventful meeting.
They almost got through all of the modules TS ballot comments.
And I kind of want to hear a little bit more details from someone who was at the standards meeting to see how that went with all the talk we've had lately about modules.
Right.
Yeah.
Yeah, I was not at the meeting,
but our team, we had eight members
from the C++ team
joining that meeting over there,
including Herb.
So what I've heard is the modules TS
is really close to being done,
and we are super excited about that as well
because we, on the VS side side we actually already shipped a preview
of the implementation of modules back in vs 2015 right and we have continue continuously being
updating our implementation to match the latest in the ts and so the latest implementation is right now in 2017. So it's actually already there. So
we would love to encourage developers to give it a try and see how it works for you and give us
feedback and also give the committee feedback on the language feature itself. So we are pretty
excited about that being done and we can finally ship the feature in the product as
well yeah absolutely anything else you want to highlight about the standards meeting or the news
coming out of it um i guess the other thing is this is second meeting for c++ 20 yeah and that's
another exciting beginning of a new uh standard being. So I think a lot of things happening, good things, good discussions happened at the meeting.
Unfortunately, I was not there.
I wish I was.
But yeah, I read Herb's trip report.
It sounded really like a good meeting.
Seems like it'd be definitely an interesting experience, although it also
sounds like long days and lots of hard work.
Sure. Oh yeah, absolutely. It's a
full week of a lot of long
meetings.
Yeah, and some of these other proposals that went through
just to go through them briefly is
bitcasting, which is something I had not
heard of previously, but that was work done
by JF Bastion, who we've had
on the show a while ago.
Herb's spaceship operator is going to
make it in C++17, which is pretty cool.
Yeah.
That'll be an interesting one to see.
There's also lots of
mentions, little details
of constexpr stuff going in.
Yeah, and actually your talk from CVCon
got a call out, didn't it?
Yeah, I got a minor indirect mention,
which is, I guess, my greatest achievement as far as the standard goes so far.
It was, if this reminds you of constexpr all the things talk title,
you're exactly right.
That's what Herb said.
Yeah, and that was in reference to adding more constexpr
into the standard library, basically, right?
Yeah, and from my perspective, bug fixes.
Algorithms and utilities are going to be constexpr,
constexpr standard complex type,
and new, so
they're provisionally talking about the possibility of allowing,
as I read it, like there's a lot of caveats here, allowing constexpr new.
Okay.
Which I think that effectively must allow a constexpr delete also.
Constexpr destructors are going to need to become necessary if you allow constant expert new.
Yeah.
Something, but it does allow for some interesting possibilities.
Yeah, we'll have to pay attention to how that progresses.
Yeah.
Okay, next thing, just to briefly mention more of your travels, Jason, the Pacific Plus Plus talks are now available online.
Yep, all up now, all 10, I believe.
It is 10, although for some reason there's one listed as a private video.
I'm not sure what that's about.
If someone requested their talk be taken down or if it was just a mistake.
Nothing that I'm aware of.
Perhaps there was an error or something and Phil's working on correcting it. I'm aware of perhaps there was an error or something
and Phil's working on correcting it
I'm not sure
but as of now there's 10 talks online
so those are all available
is that 10 plus 1 private one
or 9 plus 1 private one
10 plus 1 private one
on the playlist
maybe it's an error or something
and then some more Microsoft news.
We've talked a couple times about the work Kenny Kerr has been doing with Modern C++,
aka C++ WinRT, and that is now officially included in the Windows SDK, which is pretty
cool.
I guess beforehand you would have to download his GitHub and bring in the library that way,
and now it's just included becoming like a first class citizen.
Rong, do you have anything
you wanted to mention about this one?
Yeah, the good thing about it being included
in the Windows SDK is
now it is actually part of the
Visual Studio installer because
we installed Windows SDK.
So it makes it really
convenient to acquire all the tools
from within the Visual Studio installer
all at once.
And then you can start right away
to do UWP development.
So I think this is really good news.
And there's a question right at the top,
and I'm kind of curious about it too.
Does this lead to the retirement of C++
CX with
WinRT as a replacement?
So
we don't really have a roadmap
for deprecating C++ CX
yet.
But definitely WinRT is
the recommended way
to do UWP development.
But we will have to make sure that it handles all the scenarios that CX supports
before we deprecate CX.
So that's kind of where we are right now.
Okay.
You know, I feel like this is quite the success story
because Kenny started this project on the side, as far as I understand,
when we talked to him about it years ago. Yeah, and invested
a lot of time on his own to get
it up and running. And then
got hired by Microsoft.
Yeah. And now it is
an official part of Visual Studio
effectively. Yeah, this is
really cool. That's pretty
darn awesome. There's very few
open source personal projects that make that kind of...
Translation.
Yeah.
Yeah.
Yeah, it is really impressive.
Next thing we have is this long article on C++ Auto, which I thought was pretty interesting. Kind of going over all the different use cases of auto
and some of the potential pitfalls
if you're not familiar with certain things
and kind of advocating for its usage.
Yes.
I felt like it was a little long
if your goal was to be like,
auto is awesome, you should use it.
Because then there's like 37 caveats for what you need to be like auto is awesome you should use it because then there's like 37
caveats for what you need to be careful about but but some of those caveats you know i had maybe
forgotten of or or wasn't fully aware of so it's nice to have them all laid out just so you know
about you know potential problems you might run into with auto you're right yeah i do have one picky complaint he says uh in
the section about deduction of braced initializers and a single item of being a value now in c after
c++ 14 so effectively in c++ 17 they changed the rule of that now which is true. But he says, some compilers, Clang++ and G++ in particular,
have implemented in 3.9.2.2 even when compiling with C++11 or 14 as their options
instead of C++17, which is 100% correct.
But the problem is that that's not a problem.
The standard actually specifies that it is a breaking change going back and affecting the previous 11 and 14 versions.
So they're not doing anything incorrect.
They are correctly applying the C++17 rules to C++11 and 14 builds because that's what the standard requires them to do now.
Yeah, because no one wanted the old behavior.
No one wanted auto of a braced 10 to be an initializer list.
Right.
No.
Yeah.
No,
that makes sense to me.
Uh,
next thing,
uh,
catch,
which we've talked about several times,
um,
is now catch two or rather the,
uh,
the new library,
new update is Catch 2.
And it sounds like it got some pretty significant feature improvements,
and it's now C++ 11 only.
If you are using C++ 98 with Catch,
then you have to continue using Catch 1.0,
and Catch 2 will only be for the newer compilers.
Yes.
And there's an interesting note here and a complaint that I've had many times,
that Googling for Catch is impossible.
Yeah.
So hopefully Googling Catch 2 is going to be at least slightly better.
Yeah.
So let's be clear.
The official name of it was changed to Catch 2.
Right.
No space.
Right.
Now, unfortunately,
Google will still mostly bring up Catch 22,
the movie or the book.
Yeah.
But, you're at least one step closer to getting there now.
He mentioned that he thought about calling it
Catfish.
That wouldn't really work as a library.
It doesn't sound right, no.
No, I missed that.
Yeah.
But aside from the name change and the newer compiler,
he's working on some microbenching and fixed several other things.
And it sounds like he's really opened it up to community contributions.
He's got another main administrator for the project now
who he says actually did most of the work over the past year.
Very good.
That's another success story for an open source project right there
when you've got someone else that's going to invest that much effort in it.
Yeah.
And then the last thing we have is,
and we talked about this a couple weeks ago,
the first distributed C++ meetup, or at least the first one we were aware of,
and this was between the London C++ group and the Sweden C++ group,
and they basically had a joint meetup where they each gave lightning talks,
and they talked a little bit about some of their successes,
some of their places they need to improve.
And they do have a recorded video if anyone's interested in watching the joint meetup.
Yeah, it seemed fair that since we mentioned that they were going to do it, that we go ahead and mention, here's the results of what they did.
So you should go and check it out if you're interested at all in doing a joint distributed meetup.
Although they had the advantage of only being one time zone
apart. Yeah.
I mean, there's plenty of
meetups within the US or
other European countries where you have that.
Yes. I wouldn't want to
do like a New York, California
joint meetup. That would not be fun.
Or New York, London.
Well, you could do it like at lunchtime at work or something.
I don't know.
Yeah, maybe.
Maybe.
Yeah, but I think it's pretty creative for them to think of a way
for two different user groups to meet up virtually.
Yeah, it's a cool idea.
Yeah.
Yeah, and at the risk of, like, plugging too much, like, Slack and Twitter and that kind of thing, I've noticed, like, this, like, at Meeting C++, groups of friends who only knew each other on Slack and Twitter hanging out like they've been friends for a year, even though it's the first time they've ever seen each other in person.
And I think it's interesting and it was exciting to witness that and be a part of it also.
Yeah.
Okay, so Rong, for listeners who aren't familiar with VS Code but maybe know more about Visual Studio, can you tell us a little bit about it?
Yeah, sure. So VS Code is Microsoft's lightweight, open-sourced, and cross-platform code editor.
So by being cross-platform, it actually runs on Windows, Mac, and Linux.
Okay.
And it is the fastest-growing developer tool out there.
It's got like 2.6 million developers since it first shipped 18 months ago.
So it's got great momentum out there. And just recently, GitHub ranked VS Code Project
as the number one most contributed open source project on GitHub. So we are pretty excited about
that. Lots of contributors, lots of commits.
So definitely see the community contributing to the project.
So it's going pretty well.
So, yeah, so compared with Visual Studio,
VS Code is more like a code editor.
It does include a lightweight debugger that enables basic debugging and allows you to integrate any external tasks,
like for building your code or testing or packaging your code.
But at the core, it is meant to be a lightweight code editor, and that's what it does.
And compared with Visual Studio, which is more like the full-featured IDE,
it has a lot more support in terms of programming language or platforms and features.
It's a lot more rich on the inside compared with VS Code.
But VS Code was born aiming to be a lightweight tool.
And that's what we want to keep it to be.
Okay. So what kind of languages do you support with VS Code? So VS Code in the box has support for JavaScript, TypeScript, and Node.js.
And many other languages, including C Sharp, C++, Python, etc., are supported via extensions.
Okay. I'm curious. You said in the intro that Visual Studio Code has been around 18 months.
Is that 18 months since the first release or like 1.0 or?
I think it's, I can't remember exactly.
I think it's like the first official 1.0 release, like not the point releases.
It just feels like it's been like around so long at this point. official 1.0 release, like not the point releases.
It just feels like it's been around so long at this point. I don't know, we've been talking about it
since the beginning of the show.
I think it's probably two years
since it was first announced.
Wow.
It was like two years ago at the Connect event, I think.
I think I remember it being at either Build or Connect event
because I think it was at a conference.
Yeah.
Yeah, it hasn't been that long, but yeah, it's been there.
Wow.
So what's the difference between having the C++ extension
to support it versus having the built-in support?
So yeah, that's a great question so vs code started as a
web developer tool i would say and that's why it had js support and typescript support built in
and that's what it had when it was first launched uh and then of course later on we heard lots of
feedback from our customers that they would like to use VS Code for developing other languages, including C Sharp, C++, many other languages.
That's why many of these extensions this project to support C++ in VS Code.
And that was actually around 18 months ago as well when we first shipped the extension to the C++ extension provides intelligence and debugging functionalities for C and C++ programming in VS Code.
Really, once you have the extension installed, the support across these different languages are pretty similar. The only difference is if it comes with VS Code in the box
or if you have to get it via extension.
But really, the way you get an extension VS Code is really, really easy.
You can do it from within the VS Code window.
You don't even have to leave the VS Code window.
You can get it in the Extensions tab, search for C++, and you can install it right there.
And also, VS Code actually offers recommendations on extensions based on the file types that are open in VS Code. So for example, if you open a folder that has C or C++ files,
or if you open a C or C++ CPP file in VS Code,
VS Code is going to give you a quick message that says,
hey, we recommend you to install the C++ extension for better experience.
So from there, all you have to do is to do a couple of clicks
to get that extension installed.
And it's really fast.
It only takes, I think, a few seconds for our extension to install.
And then you have the C++ support right there.
So even though it's not in the box,
the acquisition experience is quite smooth, I would say.
Okay.
Once you have the C++ extension installed,
you said Visual Studio Code is supported on all the platforms.
Do you get the same level of user experience
with the C++ extensions on Linux, Windows, and macOS?
Yeah, that's a great question.
Actually, yes.
So all the features we have done so far
works the same across different platforms.
And that's actually one of the goals for us
is to provide similar experience on different platforms.
So because we have heard developers out there
who work on multiple OSs,
when they switch between the different platforms,
they would prefer to have the same tool that they're familiar with.
So we try to keep the same level of support across platforms.
We've not done anything special like on Windows versus non-Windows.
That's not the case.
So everything we do, we support all the platforms.
That's absolutely.
And you also mentioned it's got a lightweight debugger experience. Are you trying to be
competitive as an IDE, or are you mostly just trying to be like a fairly full-featured editor,
or where do you see the distinction? Yeah, that's a good question.
Actually, what we want VS Code to be is a code editor.
So at the core of it, it's a code editor.
And we definitely invest in providing very rich language service features like IntelliSense and code browsing features.
I mean, like go to definition,
go to declaration, those features.
We definitely invest heavily there.
But then we know once you edit the code, you might want to do a quick build,
or if you run into issues, you might want to do a quick,
quickly debug your code.
So we don't feel like we want to ask you to switch over to a completely
different tool for those additional tasks. That's why VS Code has this built-in debugger
that helps you get started. It is actually pretty useful because it has all the basics.
You can set breakpoint, you can hit breakpoint and step over your code, continue to run the code by pressing F5.
And you get to watch the local variables. And we do expression evaluation as well.
And you can look at a call stack. It's got the basics enough to get you going. And of course, Visual Studio, on the other hand, would provide a much richer experience for
debugging. It has a lot more features for diagnostics in general. So VS Code, to answer
your question directly, so VS Code is definitely aimed to be a code editor, and we want to keep it
lightweight. So in terms of debugging features, that's probably where
we're going to stop for now. Everything in there, it's pretty
basic. It works. In terms of advanced debugging
features, we would recommend using VS instead
and really focusing on getting the code editing
experience really, really good in VS Code.
I wanted to interrupt this discussion for just a moment to bring you a word from our sponsors.
Backtrace is a debugging platform that improves software quality, reliability, and support
by bringing deep introspection and automation throughout the software error lifecycle.
Spend less time debugging and reduce your mean time to resolution
by using the
first and only platform to combine symbolic debugging, error aggregation, and state analysis.
At the time of error, Bactres jumps into action, capturing detailed dumps of application and
environmental state. Bactres then performs automated analysis on process memory and
executable code to classify errors and highlight important signals such as heap corruption,
malware, and much more.
This data is aggregated and archived in a centralized object store,
providing your team a single system to investigate errors across your environments.
Join industry leaders like Fastly, Message Systems, and AppNexus that use Backtrace to modernize their debugging infrastructure.
It's free to try, minutes to set up, fully featured with no commitment necessary.
Check them out at backtrace.io slash cppcast.
I watched your CppCon talk, which was pretty impressive,
where you not only did a project, you know, live-coded it,
but you kind of set up your whole environment with VS Code,
including setting up, like, the build task and the debug task.
Do you want to tell listeners a little bit about how you get this environment set up
for VS Code?
Yeah, absolutely.
So, yeah, so the demo I did at CppCon, so I tried to do something like as a challenge
just to show how easy it is to set everything up, all the way from start writing code and get IntelliSense
and get the project building and get debugging working.
I challenged.
I did it to myself.
I wanted to finish everything in 20 minutes on stage.
I think I finished within 15.
So goal achieved.
Yeah, so basically what I did was in the demo, I was on a Mac.
I was on my MacBook, and I installed the compiler.
That's separate from VS Code.
Oh, yeah, one thing to point out, VS Code does not come with any C++ compilers.
Okay.
It's meant to be a code editor.
It does not give you a compiler.
But that means you can use any C++ compiler of your choice to build your program in VS Code
because VS Code allows you to integrate any external tasks and call it as a command in VS Code.
So what you have to do for building is you would need to install your compiler separately.
In my case, I was on a Mac machine, so I just got Xcode installed on my Mac.
And then all I have to do is just in the VS Code calling g++ as a command
and passing the name of my source file and tell VS Code to run that command and that's all it
needs to be done to get your program building in there. And setting up debugging is actually pretty straightforward as well. So our C++ extension, we support multiple C++ debuggers.
So on Mac, we support LDB.
On Linux and Windows, we support GDB debugger.
And on Windows, you have one more option to use the VS debugger.
So we support all those things out of the box.
And all you have to do to get it set up is, of course, another JSON file.
And that's called the launch.json.
Basically, that JSON file is telling VS Code what program to launch for debugging.
So you need to pass in the path to the program you want to launch,
and then specify which debugger you want to use, for example, LDB in the case in my demo,
and then just set up the working directory if you need to.
And that's pretty much all I have to do in the JSON file. And the rest of it is just like VS.
All you have to do is to press F5
and the program launches and your breakpoint will hit
and then you can inspect the variable value.
You can look at the call stack.
We even have support for multi-threaded apps.
So you can watch the many threads running in the VS Code window as well.
So, yeah, I did all that in 15 minutes, like I said,
just to show how easy it is to set things up.
Because VS Code is not a full-featured IDE, unlike VS, which in the case of VS, you can pretty much rely on VS
to set everything up for you.
Because we create a project for you.
We do all this magic behind the scenes when you do F5.
On the VS Code side, you have to do a bit more work yourself.
And some developers prefer that because you know exactly what's
being built and some developers prefer a simple editor over a full IDE. So VS Code is aiming
at that scenario, but that also means you have to do some manual steps to get things
set up. So I showed that. And then I also showed a more complex project,
which is probably closer to what we deal with
in real life. We open a large code base.
You've got lots of CPP and header files in your
project. And because VS Code doesn't come
with a build system unlike VS, right? So basically
what you do in VS Code is you open a folder that contains a bunch of files. So out of
the box, VS Code doesn't really know what to do with your code. It doesn't have knowledge of your code. So the C++ extension provides basic
intelligence and browsing features out of the box without you having to configure anything. So I
think that's pretty cool. And all that is powered by a tag parser, which is really nice. I think
out of the box, you get something, you get colorization,
you get a quick info tooltip, you can do basic like go to definition. It may not have the
accurate knowledge of your code. Like the tag parser doesn't have semantic knowledge,
understanding of your source code. So sometimes it will provide you multiple results when you look at the definition of the
symbol, because it doesn't really know for sure, because the parsing is single file-based. It
doesn't have the knowledge of includes. But that's the out-of-box support, which doesn't
require you to do anything. But then we also have a more powerful
IntelliSense engine, which is compiler-based. And that engine will be able to parse your code
and really provide rich IntelliSense features for you. But the only thing is it would have to know a little bit more about
where to find those headers, where to locate those symbols, because we don't know where
to find where your include paths are because you can't reference anything, and we don't
know where the header files are.
So out of the box, we don't have that knowledge. But if you can help us understand where to locate those symbols, the IntelliSense engine
is going to kick in and provide a much better experience for you. So we have implemented
quite a few IntelliSense features using this compiler-based engine, such as parameter hints, reference highlighting, error squiggles, and
quick info, and member list as you type a dot or arrow will show the member list. So
we're adding more and more features using the compiler-based engine, which, by the way,
is the same engine that's been used to power the IntelliSense
in Visual Studio for many years.
So we are sharing the same IntelliSense engine.
We're bringing in all these rich features into Visual Studio Code as well.
And that IntelliSense engine is on Mac and Linux too then? So what we do is for the
for Linux and Mac
we actually use
the engine in clan mode
so this engine actually has
MSVC mode and clan mode
so Mac and Linux
we switch over to clan
mode to act
like as if it was
a clan compiler. So that's how it works right now.
That's pretty cool.
Yeah, I was pretty excited to be able to show these
features at CppCon, and I'm glad
it was well received.
You talked a bit about being able to open a folder of files using Visual Studio Code.
I know that's something Visual Studio can do now too,
just open a folder as opposed to opening a Visual Studio solution.
Yes.
And then there's CMake support getting built into Visual Studio as well.
Is there any CMake support in VS Code?
Oh, that's a very good question.
So first of all, Visual Studio is now able to open any folders, like you said, to support.
That's ideal for if you had a non-MSBuild project.
And it has built-in CMake support.
Basically, it provides an out-of-box F5 experience,
and everything is done for you, all the magic there.
On the VS Code side, we don't have the CMake support built into the extension yet.
So a couple of things.
That's definitely something we have heard a lot from customers.
Like CMake is really popular these days,
and developers want CMake support in there.
And we definitely have looked into that.
So right now, two things we're doing.
One is just recently, was it last month?
I think so.
We just added support for compilecommands.json file,
which is a compilation database that defines command objects
to specify one way the translation unit can be compiled in the project.
And that's something that can be auto-generated by many build systems,
including CMake.
So basically that means if you have your project set up to build with CMake,
now you can just pass in an additional flag to CMake,
and CMake knows how to generate such a file.
These files, if you open those files, you will see for each source file, it has which compiler to use to compile,
and all the includes, all the defines are in there.
So it's already generated.
You don't have to read it, but we will.
The extension will read it, and we
will use that information to tell the IntelliSense engine
these are the include paths to use.
So you don't have to set up the include path manually.
So that's one way to get IntelliSense support for CMake projects by indirect support.
You just have to generate that file and tell the IntelliSense engine, hey, this is a file to use. So that's one thing we did as one way to kind of get around
not having the CMake support inbox.
So that's shipped in our extension already.
And the second thing is we have recently started talking
with the author of the CMake tools extension.
So there's actually one extension in the marketplace for VS Code
to get CMake support in VS Code.
So that extension has got some pretty good popularity among developers.
And we felt like, hey, there's no point for us to re-implement everything that's already there.
Okay.
But instead, we started talking with the author.
We have talked quite a bit about how we can bring these two extensions together. If users have both extension installed on the box, then how our extension can make use of the information that the CMake extension has generated.
So we don't have to redo all the work.
So it's like one way rely on the API calls and all that to to bring these two things together.
So we are in the process of making that happen.
We're hoping that's going to happen soon.
But yeah, that's our CMake story for now,
is we are working on it.
Okay.
Yeah, I got the impression that you've got
some Clang tooling support.
You mentioned Clang mode on some of the things. Is there any support for Clang tooling support, and you mentioned Clang mode on some of the things.
Is there, like, any support for Clang tidy fixes being built into Visual Studio Code?
There is not yet.
So in terms of Clang tooling support, we do have support for Clang formatting.
Okay.
So our extension ships with that. And when you do a formatting or a selection on a file, we actually use the Clang formatting tool.
Do you use and use Clang format directly, not just interpreting?
OK, right. We yes, it's the one out there.
Right. Formatting tool. Yes. So on the on the Clang ID side, right now our extension does not have any, like,
linker-ish support other than the error squiggles in there that's powered by the compiler-based engine.
Okay.
But that's definitely something we have heard a lot.
Some of the other extensions have support for LinkedIn support for other languages.
We don't have that yet.
But that's definitely doable via extensions.
And if anyone out there would like to build an extension for VS Code to leverage the Client ID tool.
That's definitely doable.
Our side, we still have a long backlog to go through,
and we definitely want to get all the IntelliSense
and the cloud browsing features out there solid,
and CMake support,
and then we'll probably move on to some other features,
including LinkedIn at some point.
Can't promise anything yet.
So are there any other third-party tool integrations around the C++ ecosystem that you would like to call out?
I mean, like hypothetically CPP Check, is there anything like that?
I think if I remember correctly, there is an extension for VS Code for CPP Check.
I think that's already built by the community.
Okay.
Yeah, we haven't done anything in that area yet,
but that's definitely out there.
So if you go to the VS Code marketplace
and just search for C++,
I think there's quite a bit of extensions out there.
Okay. I'm going to extensions out there. Okay.
I'm going to look right now.
I was also going to ask,
it looks like the
C++ extension has seen a lot of updates
recently. Do you want to share any of the
more interesting ones that you've put out recently?
Yeah, sure.
I talked about
the compile commands
support.
The other thing I want to highlight is the new feature,
what we call multi-root workspaces support,
which is a new feature in VS Code itself.
And it allows users to work with multiple project folders in VS Code.
So this could be very useful if you work on multiple related projects at the same time.
So now you can open multiple folders in the same instance of VS Code without having to switch between VS Code Windows. Okay. So in the latest update of the C++ extension,
we just added support for this scenario.
That means if you have multiple folders open,
they don't have to be related.
But essentially, each folder is going to get
their own intelligence and code browsing
and debugging support
independent of the other two folders.
So like we won't mix up folder A information when you work on folder B.
So everything is independent.
So that's one feature.
The other thing I also want to mention is the light bulb suggestions,
which has been out there for a while.
This is basically a feature that we shipped to help users to config the
InCrew path.
Like I mentioned,
our IntelliSense engine needs some help to know where your symbols are.
And manually set up those in crew path could be a very tedious task,
especially if you have a large project.
So what we do is in the extension, we provide some assistance to provide suggestions for where you could potentially locate those headers.
Because of the tag parser,
which is a really a tireless hard worker that always searches in the background.
If you tell us where your root folder is, we will recursively search in all the folders in there for that header file.
So for each header file, if you click on that line and click on the light bulb,
it's going to show you options for some of the path suggestions.
And if you click on that path suggestion, we will automatically add that path to the configuration file
as one of the include path for the IntelliSense engine.
So you don't have to do that manually.
So that's another thing we're hoping to help users to set up IntelliSense easily.
And because we really want our users to get the rich IntelliSense experience and how to
whatever we could do there to help them to get there faster.
So that's another feature that we have included in the extension.
Okay.
Yeah, so those are some of the latest updates.
And there's another pretty cool thing,
which I don't know if you guys have been following the VS Connect event that's been going on like yesterday and today.
I heard about it, but I haven't been following it.
Yeah.
I missed that.
Oh, okay.
So one of the things that I was pretty excited about yesterday when I heard it is this tool called VS Live Share.
Okay. yesterday when I heard it is this tool called VS Live Share. It basically
enables real-time
collaborative development
across Visual Studio
and Visual Studio Code on
different platforms.
That support includes
co-editing,
co-debugging,
and all the language service support is there as well.
So imagine team members who work on different environments,
like one remote team member,
and if I'm a developer, I run into an issue,
and I would love to get some help from my team member who is remote.
And this VS Live share feature is going to enable you guys to,
me and my team member, to work together to do the editing,
do the debugging all together on the same session.
So it's really pretty cool.
So basically, it's pretty simple.
Either in VS or in your VS code, you can share a session URL and send that over to your team member.
And the other person opens that link on their machine.
They don't even have to have all the dependencies installed on the machine, but they can open that.
And essentially, they're looking at the same project and the same context as you are.
And on my machine, I could hit a breakpoint,
and the other person is going to see that breakpoint as well.
And you can essentially continue to do debugging on the other machine.
You can use all the debugging features in Visual Studio to do debugging from there. You can even do step
over the line. You can even do continued debugging from the other machine remotely. And the two
machines can co-edit the same code as well. And you also get full intelligence and co-browsing
as if you are working on a local project.
And it works across
different platforms, too. Like,
if I'm on Windows and the other person is on
Mac, no problem.
And we share the same session.
I thought it was really cool.
That's really impressive. I definitely see myself
using that. I work with a lot of
remote developers, so
it's pretty exciting. Yeah, you should definitely
check out the recording
of the Connect events.
Yeah, there was a demo in the
keynote in the morning
that Scott Guthrie did,
and another one
in the session did by
Julia Lewison, and there was another
demo in there that kind of
went into more details. Yeah, so we're pretty excited about this feature, and there was another demo in there that kind of went into more details.
Yeah, so we're pretty excited about this feature,
and we'll definitely start to see how VS and VS Code as two different products
to start to work together in such scenarios.
Yeah, it's pretty exciting.
I did check out this list of the VS Code C++ extensions,
and I see, like you said, there's the CMake tools.
I see there's one for Arduino, LLDB support.
So it looks like there are plenty of other extensions to choose from
in addition to the C++ one that you guys put out.
Yeah, so we provide the core C++ experience,
like IntelliSense debugging.
And the extension, for example, for Arduino is more targeting a specific scenario.
And if you're looking at the one from Microsoft, that one is actually built on top of our extension.
Okay. So, yeah, it's just a special type of C++ code
they're writing there.
So they definitely take full advantage
of all the language service that we build in our extension
to power the IntelliSense over there,
which I think is pretty cool.
Yeah.
Well, thank you so much for joining us today, Rong.
Where can people find you online and track the progress of other stuff you guys are working on?
So a couple of ways. Definitely watch our team blog.
So that's the msdnblogs.msdn.microsoft.com slash vcblog.
Every time we push out a new update, we will talk about all the new features
on our blog.
And also follow us on Twitter
at Visual C.
We will talk about all these new things
over there as well.
So, yeah, do those
two things. You will find us
either on the blog or on Twitter.
Okay, great.
Thank you so much for your time today.
Yeah, my pleasure. Thank you Thank you so much for your time today.
Yeah, my pleasure.
Thank you.
Thanks so much for listening in as we chat about C++.
I'd love to hear what you think of the podcast.
Please let me know if we're discussing the stuff you're interested in.
Or if you have a suggestion for a topic, I'd love to hear about that too.
You can email all your thoughts to feedback at cppcast.com.
I'd also appreciate if you like CppCast on Facebook and follow CppCast on Twitter.
You can also follow me at Rob W. Irving
and Jason at Leftkiss on Twitter.
And of course, you can find all that info
and the show notes on the podcast website
at cppcast.com.
Theme music for this episode
is provided by podcastthemes.com.