You are on page 1of 9

The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev

January 23, 2009

Hanselminutes is a weekly audio talk show with noted web developer


and technologist Scott Hanselman and hosted by Carl Franklin. Scott
discusses utilities and tools, gives practical how-to advice, and
discusses ASP.NET or Windows issues and workarounds.

Text transcript of show #147

January 23, 2009

The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev

Scott is on campus this week and bumps into Noah Richards, a "lowly" (his word) dev on the new editor in
Visual Studio 2010. They sit down and Scott gets an education on how it's put together, built,
componentized and shared.

(Transcription services provided by PWOP Productions)

Our Sponsors

http://www.telerik.com

http://www.nsoftware.com http://dotnet.sys-con.com

Copyright © PWOP Productions Inc.

Transcription by PWOP Productions, http://www.pwop.com Page 1 of 9


The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev
January 23, 2009

Lawrence Ryan: From hanselminutes.com, i t 's


Hanselminutes, a weekly discussion with web Noah Richards: So for Visual Studio 2010, we
developer and technologist, Scott Hanselman, hosted started over and we wrote the Editor from the ground
by Carl Franklin. This is Lawrence Ryan, announcing up with extensibility in mind. So like you said the
show #147, recorded live Wednesday, January 21, Editor, it uses WPF now which is, of course, different
2009. Support for Hanselminutes is provided by and we are on managed code, we write almost
Telerik RadControls, the most comprehensive suite of entirely in C# and we used something called the
components for Windows Forms and ASP.NET web Managed Extensibility Framework, MEF...
applications, online at www.telerik.com, and by .NET
Developers Journal, the world's leading .NET Scott Hanselman: Yeah, Glenn Block's MEF.
developer magazine, online at www.sys-con.com. In
t h i s e p i s o d e , Scott talks with developer Noah Noah Richards: Yeah, Glenn Block's MEF.
Richards about the new WPF-based text editor in
Visual Studio 2010. Scott Hanselman: I love that guy.

Scott Hanselman: Hi, this is Scott Hanselman and Noah Richards: For our extensibility story. So
this is another episode of Hanselminutes. I'm up here do you just want me to sort of hop into this, maybe
hanging out for a couple of days on the Redmond talk about...
campus of Microsoft. I come up here every month or
so and wander down the hallways and every once in Scott Hanselman: I want to understand like a
a while I just pop into an office and find out what couple of things about this Editor. So we say the
someone is working on and I fit them on a load today Editor, we're talking about all of the typing of text, the
because I'm talking with software developer engineer rendering of text, the scroll bar, that whole kind of
Noah Richards who is one of the, how many area that lives inside of Visual Studio.
developers?
Noah Richards: Yes, that's what we're talking
Noah Richards: About eight developers. about.

Scott Hanselman: Eight developers working on Scott Hanselman: So somebody used to looking
the new Editor for Dev Visual Studio 2010. at a Solution Explorer and they double click on a file
and somehow Visual Studio decides that this is a file
Noah Richards: Yes. that you're going to be handling, and then what
happens? Is it Text Editor, is it a DLL, I mean I
Scott Hanselman: You call it Dev 10, we call it imagine it from the point of I've got the Visual Studio
Visual Studio 2010. IDE open, I double click on it on a CS file...

Noah Richards: We call it Dev 10. Noah Richards: Sure.

Scott Hanselman: You call it Dev 10, but you the Scott Hanselman: What happens?
listener, you don't get to call it that.
Noah Richards: So there are two pieces to the
Noah Richards: No. Editor. There's what we call the platform piece or the
rehostable piece and you might have noticed if you
Scott Hanselman: So why would I want to talk use Expression Blend or if you downloaded the new
about a Text Editor? I think this is pretty interesting Win 7.0 beta and you open up the PowerShell ISE,
and I wanted to talk to the actual -- you called yourself the Integrated Scripting Environment, you'll see that's
earlier a lowly... our Editor, in both applications that's our Editor and
we're kind of being hosted, and more than that, those
Noah Richards: Yeah, I'm just one of the lowly are just the ones on the top of my head but...
coders as they say.
Scott Hanselman: And that's just like a DLL that
Scott Hanselman: The lowly coders. So you work they've kind of like copied local...
on the WPF Editors. This means that the Editor in the
Visual Studio 2010 is different, and we've seen things Noah Richards: It's a set of DLLs. They're a
about this. If people are enthusiastic they can search couple separated for various reasons, but they are a
around, they can find Channel 9 videos, they can couple of DLLs and then inside the Visual Studio we
piece together what's going on here. have a package that takes care of loading us up and
then provides what we call a SHIM layer on top of the
Noah Richards: Yeah. hostable part that allows old native clients to continue
calling the Editor as if it was still the old Editor.
Scott Hanselman: What's happening with the
Editor, the Text Editor in Visual Studio 2010?

Transcription by PWOP Productions, http://www.pwop.com Page 2 of 9


The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev
January 23, 2009

Scott Hanselman: So the SHIM, it's just that, it's a Noah Richards: Yes, yes, it's all in proc. So
lie, it's IExtensibility too which says I'm still here, yeah, so at the level of MEF, of this extensibility
nothing has changed. framework, we have all these different subsystems
and so Classification is one of them. Things like this
Noah Richards: It's IVS Text whatever IVS. little squiggly you get in the Editor, that uses another
subsystem to do that, and basically we have these
Scott Hanselman: Yes, some COM thing. services that we provide and we use them internally
to build the application but they're all public, they're all
Noah Richards: Sure and then there's really services that you, as an extender, can come in and
two parts of that. There's the integration piece which say well, I want to provide my own squiggles so you
talks to VS and then there's the SHIM piece which, can implement this interface.
like you said, is the lie that we tell to all the native
clients but it’s there so that you'll have a more gradual Scott Hanselman: Okay.
path to move forward.
Noah Richards: So one of the things about the
Scott Hanselman: Right. So rewriting an entire new Editor, I'd like to think of this as kind of
Editor doesn't necessarily break some add-in that I democratizing it, that you can write an extension that
wrote. adds new colors to C# and plays along with the C#
language service. You could add an extension that
Noah Richards: Right, absolutely. say you want to add spell checking to comments.
You can do that. You can write an extension that's
Scott Hanselman: Okay, that's cool. So I double spell checking and then put the squiggle under the
click on the CS file, Visual Studio says hey, it’s Text misspelled words, and that would all just work.
Editor time, your package shows up and then there's
a lot involved here, there's the deciding of the view Scott Hanselman: Okay, so then maybe I wasn't
port, you know, whether this is really long file or not, thinking about this right. Let's think about it in terms
maybe this is a megabyte of texts so there's memory of a line of text.
management in text, and in Text Editor there's all the
syntax highlighting. Is that your responsibility too? Noah Richards: Sure.

Noah Richards: Part of it. So we still use the Scott Hanselman: So I've got a line of text. I've
language services that are provided, like the C# team got a four loop or something like that. How many
as a language service and the VB team. We have different things are involved in the ultimate rendering
subsystem that they talk to and that's how they of the correct colors, a couple of squiggles on a single
provide coloring and that's also new in VS 10. We what you call a span of text. What's the lifecycle of
use something called Classification where people get that span?
to provide things and they say this span of text is a
keyword, this span of text is a number. Noah Richards: There are three primary layers
to the Editor. There's the data layer which is text
Scott Hanselman: What's that word you're buffers, and then when I say with things like span
saying? there are things called Span and so on and so forth
and this refers to text in the text buffer. I'll pause for a
Noah Richards: Classification. second because I do want to say one of the cool
things about the new Editor is that all the data
Scott Hanselman: No, no, no. Is it the span of structures in the buffer level are functional or
text? immutable. So when text changes, the text that at
any point in time is what's called a Text Snapshot,
Noah Richards: Span, span of text. and you can grab this text snapshot, you can do stuff
with it like if you're a language you can build an AST,
Scott Hanselman: Span. Okay, message. you can see what's there without worrying about
anybody coming in and changing it. So one other
Noah Richards: This span of text is such and thing is there's not a lot of locking anymore. You don't
such a thing and then we have another service sitting have to lock, relock, read the thing make sure nobody
there which says oh well, keyword is equivalent to this edits. You just grab the snapshot. When somebody
WPF solid colored brush, and then that comes in on makes a change to the buffer, we generate a new
top of the UI layer and says oh, keywords are blue. snapshot and then move forward to that, and if you
ask for the current snapshot, at that point you'll get a
Scott Hanselman: These services, you call them new one. Almost all the world of the Editor talks in
services so you have kind of service oriented terms of these snapshots.
architecture, but these are all in proc though.

Transcription by PWOP Productions, http://www.pwop.com Page 3 of 9


The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev
January 23, 2009

Scott Hanselman: Yes, that's as you're getting Noah Richards: Right. We try to keep that
around the issues of concurrency with just the issue separate as much as possible just because it makes
of you're getting a moment in time. things cleaner and easier to work with, and yes that's
the logic layer as we call it.
Noah Richards: Right and this was a huge
problem, or rather not a huge problem, there was a Scott Hanselman: Okay. So when I heard that we
problem in Visual Studio in the past where language were writing the whole thing over again, like you said
services and consumer, like third party extenders that in the beginning this has been done from scratch, it
do this too, if you wanted to get a copy of the text, you looks the same though. You know, it’s like, oh yeah, I
will take the entire text buffer and copy it into a string saw the CTP...
and look at it yourself just so you won't block it.
Noah Richards: Yeah.
Scott Hanselman: And that's where you'd see
things like a 5-megabyte file, that might be fine, but Scott Hanselman: It's like oh we're writing, we
then as soon as you put on Fred’s third party doing all these work, it's totally written in from scratch
extension, things are just slowed down, turns out he is and looks exactly the same. There's always that joke
not dealing with that size of file. about rewriting stuff and you get exactly where you
were a couple of years ago. So here we are and
Noah Richards: And it was hard to do it. It's a looks exactly the same.
little bit easier to do now. That's the data level and
above that we have the logical level or things like Noah Richards: Yup.
classification mode. So i t ’ s something that
Classification isn't really a UI concept. It's something Scott Hanselman: And we did this so it was
that you add on top of the data. So just the fact that extensibility.
the text is a keyword has nothing to do with the fact
that it's blue, that comes... Noah Richards: Yes, so the way we look at it is
that we wanted to be extensible. It's very extensible
Scott Hanselman: All right, this is metadata. and it's built so that you can do wherever your mind
takes you. You know, you can build a visualization in
Noah Richards: This is metadata that you add WPF that does whatever you want it to do, but in
and we have basically two subsystems that kind of terms of when you talk about Dev 10 and delivering
talk in terms of this, Classification and another one and shipping in Visual Studio, we had a priority that
called Tagging which is similar. It's a way of saying we certainly didn't want to degrade the experience.
like this piece of text is a squiggle. It's a type of tag
that you get to put as an error, an error tag. On top Scott Hanselman: Sure.
of that is the UI layer and that's the layer that we have
an implementation of this layer, it's kind of agnostic so Noah Richards: So we tried very hard as best
you can UI without knowing that it's WPF. But then we could without sacrificing anything to maintain the
there's UI, the specific one, and so when you have a same type of functionality that you're used to so that a
line of text, the text view what it does is it gets the guy sits down and just got VS 2010, or no, his
current snapshot, when the snapshot is changed it company just switch to VS2010, he go type in the
goes through and it goes into WPF and renders some Editor and doesn't need to know that it's a different...
of these texts and then it asks for all the
classifications over it, it asks for all the different tags Scott Hanselman: So he's not going to notice the
over it. There is like squiggles, there is a thing called difference if he doesn't actually go looking for
a Squiggle Visual Manager that... anything.

Scott Hanselman: Okay, so at the second layer, Noah Richards: Yeah, if he doesn't h a v e
what I'm calling is this metadata layer you call it the anything else, he might notice the one thing that
data layer, that's where things like background everybody noti c e s , i t 's the selection box has a
compilation of errors that have showed up, spell gradient in it. That's one of the only visible things, like
check, that's where I hook in where I'm saying that the outlining might look a bit different, some of the
this is wrong, I want to squiggle there to indicate glyphs...
something about this, but not necessarily saying I
want a Visual Squiggle or I want to tag this with the Scott Hanselman: The graphics.
information...
Noah Richards: The graphics might look a little
Noah Richards: To say this is an error. bit different, but the functionality we're trying to
maintain.
Scott Hanselman: This is an error, and
visualization of that error is a totally separate thing. Scott Hanselman: So you're not trying to freak
people out with some dramatic changes.

Transcription by PWOP Productions, http://www.pwop.com Page 4 of 9


The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev
January 23, 2009

to being a port from Java and it's derived from


Noah Richards: Right. platform innovations since .NET 1.0. Genome has
LINQ since its CTP release in May of 2006. It offers
Scott Hanselman: But you said that earlier, several unique features such as encapsulation and
speaking of frequent people out, you said you could reuse of LINQ Query and Expressions. You can
do whatever you want as far as your imagination. really and fully harness the power of LINQ while
What are some of the other wacky stuff that people benefiting from your database platform's unique
have been writing to see how far they can push this? features, compose complex LINQ Query, decompose
the Query logic in your domain model. LINQ supports
Noah Richards: There was a guy in one of our all the major database platforms you find in enterprise
partner teams, he built Visualization, he used some of environments like SQL Server and also Oracle and
the existing Visual Studio stuff to figure out where IBM DB2. You can find out more about how Genome
methods were and then he made it so that when you integrates tightly with Visual Studio and what tools
click on the method it would highlight the method and Genome offers to reduce irrelevant time at
then pop out this rich edit control that says like who tinyurl.com/tryGenome, G-E-N-O-M-E, where you can
last edited the method and code coverage numbers also download a free and fully functional trial version.
and... I hope you enjoy it.

Scott Hanselman: Wow. So how do I get the notification? It's one thing to
describe different layers that you discern.
Noah Richards: I mean, the data for his
presentation was all made up but the idea is that at Noah Richards: Sure.
the end of the day, the view is just a WPF element, it's
just a UI element and you can hook into the Editor at Scott Hanselman: B u t i t 's another thing to be
various levels and like you said one thing you can do notified that it’s really my opportunity to jump in.
is you can provide these error tags but then on the top
you can provide any type of visualization you want. Noah Richards: So this is why we have -- so we
We have ideas for things like let's pretend every time kind of separate these MEF components into two
we say new solid colored brush, we replace whatever things. There are services that we kind of provide so
is in that constructor, a solid colored brush with a there's a find service and a search service and there
color picker, like we can do that, we can stick it right are extensions that will go and like grab over these
in the Editor, you can write that, you can write things people who provide these extensions at various
that say... points in time. So Classification is one of those.
Every time a view comes up, we'll go in and say okay,
Scott Hanselman: Oh, okay, so hang on a this is a C# file, let me find all the people who say,
second. Because we said you saw a colored brush well, I provide classification for C#. Likewise, you can
before, but you're saying that you're writing some say, well, tell me every time a view is created and the
code, you're sitting down and you're going var a = content type of the thing is VB or the content type of
new solid colored brush, open paren and at that the thing is C#, and then you can sit and you can
moment you show a color. listen to, oh, the buffers have changed, oh, the view
has changed, or I want to do, you know, my....
Noah Richards: You could write an extension
that does any of the stuff, you can write an extension Scott Hanselman: You just subscribe to Events at
that says you create a UI element, why don't we just that point?
show it in the Editor. You can write an extension...
Noah Richards: You just subscribe to Event,
Scott Hanselman: Like it actually show like you say just let me know whenever things happen
swash... and I can decide do I want to add my thing here. We
have this general idea of things called adornments
Noah Richards: Sure. You can write an which are these UI things and you can say, well, I
extension that effectively takes some piece of the want to put this adornment here, I want to put think of
Editor and says I want to represent it this way instead. like the three dots for when you have collapsed text in
an outlining region and that's just an adornment that
Scott Hanselman: Hi, this is Scott coming at you we stick in a text and you can write that. In fact, with
from another place in time. Are you looking for an the way outlining works, you can replace that if you
Object Relational Mapping Tool for mission critical don't like the three dots or you can provide your own
projects using LINQ and .NET? I want to share with outlining regions because outlining is yet another one
you Genome, it's specifically designed for developing of these things that under the covers uses these logic
.NET Enterprise Applications. Genome is a mature subsystems' tagging and I can go in and say, well, in
LINQ integrated ORM tool. It has been employed in my C# files, I want to be able to collapse such and
numerous large scale projects in the last six years. such a thing, so you write a component that whatever
Genome was created for the .NET platform as oppose

Transcription by PWOP Productions, http://www.pwop.com Page 5 of 9


The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev
January 23, 2009

C# files open up, you say this region is also Scott Hanselman: And you're not an old dude not
collapsible. just in age but in that kind of like been here for 20
years kind of old dude kind of way.
Scott Hanselman: I'm starting to think about what
kinds of things that someone could do if they were Noah Richards: Certainly.
designing like a language but they knew that an Editor
that was extensible existed ahead of time like multi- Scott Hanselman: Is your team, is that seven or
dimensional rays are no fun. eight people who work on the Editor?

Noah Richards: Of course. Noah Richards: Dev staffs, yes.

Scott Hanselman: But tiny Excel spreadsheets Scott Hanselman: It's certainly devs rather than...
embedded in your Editor are cool.
Noah Richards: Yeah. There's probably, I'll feel
Noah Richards: Sure. bad if I give the wrong number of people...

Scott Hanselman: So why not do that. It will be Scott Hanselman: No, seven or eight is a small
interesting if third parties jump in and decide to like part, you know, a handful of devs.
make the VS super crazy power pack thing.
Remember when debugger visualizers came out and Noah Richards: There's probably 20 people
everyone went just nuts coming out with all sorts of total, project managers, developers, testers that work
visualizers, free things, they can do the same thing on the Editor.
now.
Scott Hanselman: Are they mostly new Microsoft
Noah Richards: The reason why I get so employees or are they old dudes?
excited about the new Editor is because as we talk
about the Editor is public surface area, it's not like Noah Richards: We got one guy who got his
there is this magical things that we use underneath 15th year not too long ago, but other than him it's
and those are the powerful things and then we show mostly a bunch of young guys.
you some little pieces at the top. We implement
everything like you can write a classifier, we write Scott Hanselman: Okay.
classifiers. It's all the same. You write a tagger for
something, we write a tagger for something. Noah Richards: We got one, I mean an
architect who playfully refers to me as one of those
Scott Hanselman: Because you're using MEF. Open Source communists.

Noah Richards: Right. Scott Hanselman: Yeah and this is where I'm kind
of going at. All this stuff about like, oh yeah, let them
Scott Hanselman: I mean, you can't hide it. go nuts, total extensibility seems kind of not
Microsofty.
Noah Richards: Right, right. So I mean of
course there are some things that are implementation Noah Richards: I've heard that.
details of something or other, but you can provide any
extension that we can provide. You can consume any Scott Hanselman: I want to make sure that the
service that we consume, and every one of our pieces listeners understand. When I say old dude, I'm not
are design in this way in that something that uses talking about old in age or even old in seniority. I'm
Classification, i t ’ s not part of Classification, it talking about old in mind.
consumes the Classification service and uses it so
everything is very loosely connected in that way. Noah Richards: Right.

Scott Hanselman: This is random, but how long Scott Hanselman: I've met a lot of 23-year-olds
have you worked here? that were old in their minds. Do you know what I
mean? But this seems to be a very relaxed and
Noah Richards: About a year-and-a-half. mellow like, oh yeah, let him have that as an
extensibility point.
Scott Hanselman: Okay. So let's just phrase it
this way. You're not an old dude. Noah Richards: You'd be surprised. I mean, so
people are really excited about the community that we
Noah Richards: Yes. can create from this, about letting people have the
power to create whatever they want and not
restricting them.

Transcription by PWOP Productions, http://www.pwop.com Page 6 of 9


The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev
January 23, 2009

Scott Hanselman: Yeah. Noah Richards: Comparing it against like the


new Dev, it's a bit slower start-up cost for .NET, but,
Noah Richards: I mean, our partners tell us the man, really there's now a lot of difference once you
same thing. Our partners outside of Visual Studio like get into it.
Blend, the Blend and PowerShell. They tell us they
love that they can take this Editor and mold it into Scott Hanselman: One of the other things I
whatever they want it to be. wanted to ask is that how do you develop an Editor in
the same Editor? Are you using Dev 10 to build Dev
Scott Hanselman: Well, you know, I think about 10?
my good friends at like DevExpress, like CodeRush,
and CodeRush have been doing like what I can only Noah Richards: Yeah.
describe as impossible stuff...
Scott Hanselman: Do you have like host
Noah Richards: Yes, oh. applications that host this thing or do you have two
versions of Visual Studio running at the same time?
Scott Hanselman: For like, you know, half a
decade with the old Editor and when the new Editor Noah Richards: We have test harnesses type
came out, I was like oh no, what does this mean for of things. Like I said, because it's rehostable we can
CodeRush. I'm starting to realize more and more as I run it, but because we rely on, like I said, these
dig into it that they're going to be able to go bonkers. language services that have to be in Visual Studio,
they depend on the Visual Studio ecosystem.
Noah Richards: And we've been working with
all these great companies that are making these and Scott Hanselman: Right.
like you said it really is, the things they do are really
very impossible. The hoops, the hurdles they have to Noah Richards: We do have to test a lot of our
jump over... stuff in VS. So it does get hairy when somebody
checks in the thing that breaks the whatever and now
Scott Hanselman: Yeah, to do it now. you can't use it anymore, but we try to be pretty good
about making sure that we maintain quality. So one
Noah Richards: To get to what they have to do, of the things we care a lot about is Unit Testing and
for some of them like the really cool visualization it's Code Coverage on the Editor team and we get our
painful, and you know, we shut on the stuff and daily Code Coverage build and it's important that we
personally I was wondering the same thing, are they keep it at a certain level and we get a lot of benefit out
going to be mad... of that.

Scott Hanselman: Mad at you. Scott Hanselman: Do you do Test Driven


Development? Are you test first?
Noah Richards: That they were making it so
easy, but no, they come around in there like this is so Noah Richards: No, not...
much fun, I mean we've heard from various people it's
so much fun to work with, it's so much easier, they Scott Hanselman: Do you feel bad?
love that i t ’ s managed code, I mean that's one of
those. Noah Richards: No. Well, I was trying to think if
anybody, I mean individual people might...
Scott Hanselman: Like you said, it's as fast as it
was before. I mean people still, years and years later, Scott Hanselman: You know, the whole like watch
think that managed code can't run fast. it fail and the fix it and then watch it succeed.

Noah Richards: Oh yeah. Noah Richards: I d o n 't know in terms of


anybody individually, I don't think anybody individually
Scott Hanselman: But that's just not the case does that but we do spent a lot of time on it, and
anymore. because a lot of our stuff is functional, data search is
immutable. It makes Unit Testing a lot easier
Noah Richards: I remember one of the things because you tend to worry less. So when we get into
that I wrote when I first got here was the Differencing testing the interface, Unit Interface testing and this
Service. I generalize differencing service when we do Integration testing, it gets a little more complicated,
this text differencing in the Editor for various things but when we're testing like the buffer and snapshots
and I wrote in C# and a lot of people were saying, oh and all these other things we built on there, and
well, if it's managed code, it's going to get horrible. there's a wealth of things that we've built down in our
data level for people to discover, but it’s so easy to
Scott Hanselman: Yeah, I can't do that. test because i t ’ s just functional immutable data
structures.

Transcription by PWOP Productions, http://www.pwop.com Page 7 of 9


The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev
January 23, 2009

unit test. The Editor Unit test and the Integration test ,
Scott Hanselman: How often are your tests really we split them out separately to like we have text test
unit test versus integration test or orchestration test and language tests in various levels there, probably
so you got a bug but it only happens when you've got about 10 minutes, yeah.
these subsystems all working together and you bring
it, you know...? Scott Hanselman: I have a couple more questions
as we wrap up here. So what did you work on today,
Noah Richards: Part of the nice thing again like what code did you run today or what did you fix
above being functional and immutable is that our unit today?
tests are pretty good coverage of what's going to
happen even when you integrate. So we do have Noah Richards: Let's see, I fixed two different
integration test effectively do the make sure when the bugs and recently I've been working a lot on
selection moves here and you press delete or you performance.
press whatever, that all these things happen and all
these subsystems work together. Scott Hanselman: Okay.

Scott Hanselman: Right. Noah Richards: So a lot of profiling and trying


to figure out, making sure like I said that we maintain
Noah Richards: And make sure that this text your expectations in Visual Studio 2010.
turns blue when whatever, but we don't rely on those
heavily. We rely mostly on our unit tests to tell us Scott Hanselman: Are those expectations like
what's going on. things like I opened a 55-meg text file and it was slow.
Is it that kind of thing?
Scott Hanselman: Do you test those kinds of
things that for example, you know, hit delete this turns Noah Richards: Sure, yeah. Those large file
blue, hit delete again it turns black? Is that something scenarios are absolutely some of the things that we
that you can test at the data layer of your three layers looked at and we're very careful that the relative
or do actually have that orchestration and you watch it performance of some component isn't relative to file
happen on the screen and an invisible hand is typing size, it's either relative to what's visible or relative to
delete? what changed or relative to things like this. A lot of it
is just, you know, trying to localize and minimize the
Noah Richards: Some of our UI tests do bring impact of various actions that you've taken in the
up UI and you can see like IntelliSense, it opens up Editor.
the thing and you can see the drop down open up but
our data test, data test or data things, we can test, at Scott Hanselman: Very cool and I assume it will
the logic level we can test it, Classification does what be like a whole -- at some point in the future, it will be
it says. We can test that you have to read classifiers a whole STK and anyone who is interested in this can
and they all provide things and at the top of all these get involve and people can start writing plug-ins.
buffers it comes out the way you expect and then at
some level of the UI, on top of that is just, you know, Noah Richards: Oh absolutely, and like you
we test to make sure that the translation from said, if you get the CTP, the editor is there now.
classification type to classification format is WPF and
it works and it sticks them all together and it works. Scott Hanselman: Okay, so they can start, a n d
then with using MEF in the CTP you can start doing
Scott Hanselman: You can get like if you have that now.
thousands of tests at this point? How long does it
take to run all the tests? Noah Richards: Yeah, yeah, you can use MEF
to start building your extensions. We have some
Noah Richards: To run all of our unit tests, samples in there so they show you...
maybe 10 minutes.
Scott Hanselman: Oh really, your extensibility
Scott Hanselman: So there are a lot of tests. samples are all ready in the CTP.

Noah Richards: Yeah. Noah Richards: Yeah, yeah, yeah, we have...

Scott Hanselman: It's not like you d o n 't like to Scott Hanselman: Oh okay.
build, test, build, test, build, test because it takes 10
minutes to run them all. Noah Richards: We have various things. I
know one of the things we showed, one of the apps
Noah Richards: Right. I mean, because we built is a differencing application where it shows --
everything is very localized to make change to it's an in line difference so, you know, a difference in
classification, it's really easy to run the classification

Transcription by PWOP Productions, http://www.pwop.com Page 8 of 9


The new WPF-based Text Editor in Visual Studio 2010 - Interview with a Dev
January 23, 2009

two things and you can edit it and type in it and you into components. We're going to separate as we
get IntelliSense, you get... need to, and so MEF was kind of just the next
iteration in the stuff we have been working with for so
Scott Hanselman: Inside, in the middle of the diff. long.

Noah Richards: In the middle of your diff, you Scott Hanselman: Cool. All right, well, thanks so
get it all like that. I mean, something like that is a little much, Noah Richards, for talking to me today about
more complicated but these are all things that we new WPF-based Editor in Dev 10 in Visual Studio
absolutely want people to download and try like for 2010.
me that's the value of a platform i s how much it
enables people to build on it. Noah Richards: Thanks very much.

Scott Hanselman: Y e s , I 've always wanted to Scott Hanselman: This has been another episode
have – a buddy of mine named Travis built a thing of Hanselminutes and I'll see you again next week.
called documenter that basically takes the XML help
and shows you what it would look like if you ran it
through like end doc or scan Sandcastle. I've always
wanted to have a rich text MSDN style Editor overlaid
over my XML docs or just type it and then it will just
make the right XML underneath.

Noah Richards: Absolutely, in fact that's


something like people here have been like this is
something we need to do, it's something we should
play with. I mean people here, we have this
Application Building Week and people just get, they
get so excited like think about the cool things that you
can build now that you don't have to worry about...

Scott Hanselman: Yeah, it's nice to look at an API


and not go, oh man, I can't do that. Do you know
what I'm saying?

Noah Richards: Yeah.

Scott Hanselman: But to see a whole object


model, a series of subsystems, a nice plug-in
management system like MEF, I think I'm going to
have Glenn Block on the show next so he can talk
about methods.

Noah Richards: Neat.

Scott Hanselman: Is it fun working with MEF?

Noah Richards: Yeah, we've gone through a


few different like component systems as they've been
building MEF.

Scott Hanselman: So they've read MEF, they


push the...

Noah Richards: Yeah, they've read MEF and


we pick it up and we give them feedback and they're
all great guys.

Scott Hanselman: Was that a big deal to say


we're taking a dependency on MEF?

Noah Richards: No. From the beginning, the


Editor has said we're going to be effectively using a
component system. We're going to push ourselves

Transcription by PWOP Productions, http://www.pwop.com Page 9 of 9

You might also like