February, 2009

  • Kirill Osenkov

    Making the XAML editor fast


    If you use WPF/Silverlight and prefer working with XAML only (i.e. no visual designer), you can significantly, I repeat, significantly speed-up the XAML editor. Check out this tip from Fabrice Marguerie: Life changer XAML tip for Visual Studio

  • Kirill Osenkov

    What's common between C# 4.0 optional parameters, object initializers, the new WPF code editor and the navigation bar comboboxes?


    I found an interesting bug recently which resulted from a pretty weird constellation of the following Visual Studio features:

    1. C# 4.0 optional parameters
    2. object initializer syntax
    3. the VS code editor rewritten from scratch in managed code and WPF
    4. the navigation bar combobox updated to show default values for optional parameters

    Here's the screenshot of the bug:


    If you pasted this code in a recent VS 2010 build, the navigation bar (two comboboxes above) would grow to accomodate the full text of the Main method. Why?

    Here's what happens:

    1. The code contains a parse error (missing closing parenthesis after new Program())
    2. The IDE parser (which is very resilient) parses the entire Main method body as the object initializer on the default value of Program
    3. Since during the parsing stage we don't apply certain compiler checks yet, the parser assumes that an object creation expression with an object initializer is a valid default value for the optional parameter
    4. it takes the entire text of the parameter (including the default value and the initializer) and passes it to the New Editor for displaying in the navigation bar as part of Main's signature
    5. the New Editor's navbar comboboxes aren't simply textboxes - they are instances of the full-blown WPF New Editor control themselves
    6. since they're so powerful, they have absolutely no problem displaying multiline content
    7. the rest of the WPF layout shifts accordingly to accomodate the growing content

    We hope to fix the bug before VS 2010 Beta 2 (probably not Beta1 because it's a low impact low priority).

  • Kirill Osenkov

    How to Debug Crashes and Hangs translated into Chinese


    Big thanks to He,YuanHui who has translated my debugging tutorial into Chinese:



  • Kirill Osenkov

    New Years resolutions v2.0.0.9


    Well, I've been tagged in a chain-letter-blogging game again. This time, Chris "I-like-to-put-ugly-monsters-on-the-frontcovers-of-my-books-to-at-least-partially-distract-readers-from-great-content" Smith tagged me in his New Years resolutions post. It's February, but I think it's better late than never. So here it goes:

    Make sure VS 2010 rocks!

    I'll try to do my part and make sure that our language service works as expected and the features are pleasant to work with. I'll also try to make sure other teams don't miss obvious bugs (yes, Editor, Shell and Project System, I'm looking at you!) Given the fact that I keep finding crashes in the XAML designer, I'll keep an eye on them as well. Oh and the debugger, of course.

    Learn MEF

    I plan to read MEF sources and actually play with it. It's 21 century out there, nowadays you *need* a dependency injection/component framework.

    Learn DLR

    Especially DLR hosting. Would be fun to build an expression evaluator/function graph plotter into my Live Geometry Silverlight app.

    Read more of the product code

    I definitely should read more of the VS source, especially since more and more of it gets rewritten in managed code. We're building a managed compiler and rewriting the language service in managed code, it would be great to follow the API design there. It's super important to get the API surface right. I'll maybe start playing with it early on and build some sample apps/add-ins to see how the API feels.

    Read more blogs

    and catch up on all those starred and flagged items. I plan to read all of Cyrus, all of Wes and all of Eric, for a start. I need to catch up on Jon's early posts as well. Also, I still hope Wes starts blogging again. Same for Dustin (although I do understand how busy Dustin is in his new role...)


    Continue ignoring it. I'll at least be honest to myself. I will still exercise regularly. Once in three months is regular, isn't it?


    Is there anything else that I've missed? :-P

Page 1 of 1 (4 items)