Download presentation
Presentation is loading. Please wait.
1
Microsoft Ignite NZ 25-28 October 2016 SKYCITY, Auckland
2
The Power of Roslyn: Improving Your Productivity with Live Code Analyzers
Kasey Uhlenhuth Program Manager .NET & Visual Studio @kuhlenhuth
3
Agenda Introduce Roslyn Demonstrate Analyzers
4/6/ :23 AM Agenda Introduce Roslyn Demonstrate Analyzers Build an Analyzer (using in-progress IOperation) Explore Analyzer Ecosystem © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
4
http://roslyn.io @roslyn Microsoft Ignite 2016 4/6/2019 10:23 AM
© 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
5
Microsoft Ignite 2016 4/6/2019 10:23 AM
© 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
6
1 2 Write new features faster Provide open source API
Microsoft Ignite 2016 4/6/ :23 AM 1 Write new features faster 2 Provide open source API © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
7
1 Write new features faster Microsoft Ignite 2016 4/6/2019 10:23 AM
© 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
8
Tuples Easily pass around groups of values
9
Pattern matching Test the shape and content of expressions
10
Local functions Clean up classes by nesting helpers
11
2 Provide open source API Microsoft Ignite 2016 4/6/2019 10:23 AM
© 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
12
Microsoft Ignite 2016 4/6/ :23 AM Analyzers identify errors and provide fixes in your code as you type, i.e. without having to wait for a build. © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
13
Demo Microsoft Ignite 2016 4/6/2019 10:23 AM
© 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
14
Analyzer Severities Editor Treatment Build Consequence In Error List
Microsoft Ignite 2016 4/6/ :23 AM Analyzer Severities Editor Treatment Build Consequence In Error List Error Breaks Yes Warning None Suggestion No © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
15
VSIX NUGET Microsoft Ignite 2016 4/6/2019 10:23 AM
© 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
16
Teach new language features/concepts Introduce best practices for SDK
Enforce code style rules Identify errors before build 4/6/ :23 AM © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
17
Syntax and Semantic APIs
4/6/ :23 AM Syntax and Semantic APIs Syntax Tree High-fidelity representation of source code Semantic Model Answers semantic questions about syntax IOperation In-progress evolution of Roslyn APIs Provides semantic information Abstracts over common syntactic shapes Common representation for C#/VB Syntax Generator Can generate source code for both C# and VB © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
18
Let’s write an analyzer!
4/6/ :23 AM Let’s write an analyzer! var a = new int[0]; var a = Array.Empty<int>(); © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
19
Diagnostic Code Fix Microsoft Ignite 2016 4/6/2019 10:23 AM
© 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
20
Demo Microsoft Ignite 2016 4/6/2019 10:23 AM
© 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
21
4/6/ :23 AM Analyzer Ecosystem FxCopAnalyzers (MSFT): SonarLint StyleCopAnalyzers: CodeCracker Roslynator VS Refactoring Essentials: GCop: © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
22
Call to Action Write an analyzer! Explore what is in the ecosystem
4/6/ :23 AM Call to Action Write an analyzer! Explore what is in the ecosystem @kuhlenhuth © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
23
Related Sessions C# and Visual Basic Code-focused Development with Visual Studio “15” [M380]
24
4/6/ :23 AM © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.