SlideShare ist ein Scribd-Unternehmen logo
1 von 23
?   (formerly known as compiler-as-a-service)
Demo
Edit and
                                       IL Emitter




   Continue
                                        Emit API




Go To Definition
Extract Method
Signature Help
                                    Binding and Flow
                                      Analysis APIs
                                         Binder




  Quick Info
    Rename
   Find All
  References
Completion List
                                  Symbol API
                                                 Metadata
                                   Symbols


                                                  Import
Object Browser
  Navigate To
                                       Syntax Tree API
   Outlining
                                           Parser
   Colorizer
   Formatter
                   Compiler API
  Language




                                   Compiler
                                   Pipeline
   Service
Editor Services    Code Actions      Classification        Completion        Outlining        …




                   Code Formatting         Find All References   Name Simplification          …
   Services
                                                 Workspace API




                  Syntax Tree     Symbol       Binding and Flow                          Scripting
  Compiler           API            API          Analysis APIs
                                                                        Emit API
                                                                                            API
Complete




Efficient
class C                                               CompilationUnit
{
    void M()
    {                                                 TypeDeclaration
    }
}// C
                                                     MethodDeclaration



                                              ParameterList        Block




var tree = SyntaxTree.ParseCompilationUnit("...");
class C                            CompilationUnit
{
    void M()
    {                      TypeDeclaration         EOF
    }
}// C
               class   C     {       MethodDeclaration       }



                            void      M      ParameterList           Block



                                               (         )       {           }
class∙C                                    CompilationUnit
{
∙∙∙∙void∙M()
∙∙∙∙{                               TypeDeclaration           EOF
∙∙∙∙}
}// C
               class    SP      C         EOL         {         EOL        MethodDeclaration        }   // C   EOL



                 SPx4    void       SP       M        ParameterList                      Block



                                                          (         )       EOL



                                                                    SPx4      {       EOL        SPx4   }      EOL
class C                            CompilationUnit
{
    void M()
    {                      TypeDeclaration         EOF
    }
}// C
               class   C     {       MethodDeclaration       }



                            void      M      ParameterList           Block



                                               (         )       {           }
class C                                              CompilationUnit
 {
     void M(int x)
     {                                        TypeDeclaration       EOF
     }
 }// C
                             class     C        {        MethodDeclaration       }



                                               void       M      ParameterList           Block


var oldList = method.ParameterList;
var newList = oldList.Update(                                   (            )       {           }
     openParenToken: oldList.OpenParenToken,
     parameters: Syntax.SeparatedList(
var oldList = method.ParameterList;
         Syntax.Parameter(
var newList = oldList.Update(
             typeOpt: Syntax.ParseTypeName("int "),
     openParenToken: oldList.OpenParenToken,
             identifier: Syntax.Identifier("x"))),
     parameters: Syntax.ParseParameterList("(int x)").Parameters,
     closeParenToken: oldList.CloseParenToken);

var newRoot = tree.Root.ReplaceNode(oldList, newList);
class C                                                           CompilationUnit
  {
      void M(int x)
      {                                                      TypeDeclaration         EOF
      }
  }// C
                                       class        C          {       MethodDeclaration             }



                                                             void      M        ParameterList                    Block



                                                                         (           Parameter           )   {           }



var oldList = method.ParameterList;                                     PredefinedType           x
var newList = oldList.Update(
     openParenToken: oldList.OpenParenToken,
     parameters: Syntax.ParseParameterList("(int x)").Parameters,
     closeParenToken: oldList.CloseParenToken);                                int
var newRoot = tree.Root.ReplaceNode(oldList, newList);
class C                                                           CompilationUnit
  {
      void M(int x)
      {                                                      TypeDeclaration         EOF
      }
  }// C
                                       class        C          {       MethodDeclaration             }



                                                             void      M        ParameterList                    Block



                                                                         (           Parameter           )   {           }



var oldList = method.ParameterList;                                     PredefinedType           x
var newList = oldList.Update(
     openParenToken: oldList.OpenParenToken,
     parameters: Syntax.ParseParameterList("(int x)").Parameters,
     closeParenToken: oldList.CloseParenToken);                                int
var newRoot = tree.Root.ReplaceNode(oldList, newList);
Syntax
   Trees
             Compilation
             •   Symbols
             •   Semantic Model
             •   Flow Analysis
             •   Diagnostics
             •   Emit
References
Demo
Host Environment

      Events (e.g. key presses)
                                                    Apply
                          Workspace


                                         Edit               Edit
                            Solution            Solution2          Solutionn


Compilation          Project      Project


         Document          Document


         SyntaxTree
Demo
Code Action            A representation of a code change
• Produces both an edit and a preview of that edit


        Code Issue            An interesting span of source code
• Called for every node, token or trivia in a source file
• Optional: May be squiggled in the editor and shown in the Error List
• Optional: May provide one or more Code Actions

    Code Refactoring          A contextually-available Code Action
• Operates on the current selection in the editor
• Must provide one or more Code Actions
Demo
Dev Center: http://msdn.microsoft.com/nl-be/roslyn
Forum: http://social.msdn.microsoft.com/forums/nl-be/roslyn

Email: alexturn@microsoft.com
Project Roslyn: Exposing the C# and VB compiler’s code analysis
Project Roslyn: Exposing the C# and VB compiler’s code analysis

Weitere ähnliche Inhalte

Was ist angesagt?

Reflection in Go
Reflection in GoReflection in Go
Reflection in Gostrikr .
 
김재석, C++ 프로그래머를 위한 C#, NDC2011
김재석, C++ 프로그래머를 위한 C#, NDC2011김재석, C++ 프로그래머를 위한 C#, NDC2011
김재석, C++ 프로그래머를 위한 C#, NDC2011devCAT Studio, NEXON
 
from java to c
from java to cfrom java to c
from java to cVõ Hòa
 
(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_i(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_iNico Ludwig
 
C++ idioms by example (Nov 2008)
C++ idioms by example (Nov 2008)C++ idioms by example (Nov 2008)
C++ idioms by example (Nov 2008)Olve Maudal
 
Pythia Reloaded: An Intelligent Unit Testing-Based Code Grader for Education
Pythia Reloaded: An Intelligent Unit Testing-Based Code Grader for EducationPythia Reloaded: An Intelligent Unit Testing-Based Code Grader for Education
Pythia Reloaded: An Intelligent Unit Testing-Based Code Grader for EducationECAM Brussels Engineering School
 
Whats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPontoWhats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPontoPaulo Morgado
 
C# for-java-developers
C# for-java-developersC# for-java-developers
C# for-java-developersDhaval Dalal
 
Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Ismar Silveira
 
JVM code reading -- C2
JVM code reading -- C2JVM code reading -- C2
JVM code reading -- C2ytoshima
 
Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)jeffz
 
Back to the Future with TypeScript
Back to the Future with TypeScriptBack to the Future with TypeScript
Back to the Future with TypeScriptAleš Najmann
 
Effective Java - Generics
Effective Java - GenericsEffective Java - Generics
Effective Java - GenericsRoshan Deniyage
 
Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)HamletDRC
 
Virtual Separation of Concerns
Virtual Separation of ConcernsVirtual Separation of Concerns
Virtual Separation of Concernschk49
 

Was ist angesagt? (20)

Reflection in Go
Reflection in GoReflection in Go
Reflection in Go
 
김재석, C++ 프로그래머를 위한 C#, NDC2011
김재석, C++ 프로그래머를 위한 C#, NDC2011김재석, C++ 프로그래머를 위한 C#, NDC2011
김재석, C++ 프로그래머를 위한 C#, NDC2011
 
from java to c
from java to cfrom java to c
from java to c
 
(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_i(2) c sharp introduction_basics_part_i
(2) c sharp introduction_basics_part_i
 
C++ idioms by example (Nov 2008)
C++ idioms by example (Nov 2008)C++ idioms by example (Nov 2008)
C++ idioms by example (Nov 2008)
 
Pythia Reloaded: An Intelligent Unit Testing-Based Code Grader for Education
Pythia Reloaded: An Intelligent Unit Testing-Based Code Grader for EducationPythia Reloaded: An Intelligent Unit Testing-Based Code Grader for Education
Pythia Reloaded: An Intelligent Unit Testing-Based Code Grader for Education
 
Whats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPontoWhats New In C# 4 0 - NetPonto
Whats New In C# 4 0 - NetPonto
 
Unit testing concurrent code
Unit testing concurrent codeUnit testing concurrent code
Unit testing concurrent code
 
Java generics final
Java generics finalJava generics final
Java generics final
 
Virtual Functions
Virtual FunctionsVirtual Functions
Virtual Functions
 
C# for-java-developers
C# for-java-developersC# for-java-developers
C# for-java-developers
 
Cpp reference card
Cpp reference cardCpp reference card
Cpp reference card
 
C# 6.0 Preview
C# 6.0 PreviewC# 6.0 Preview
C# 6.0 Preview
 
Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4
 
JVM code reading -- C2
JVM code reading -- C2JVM code reading -- C2
JVM code reading -- C2
 
Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)
 
Back to the Future with TypeScript
Back to the Future with TypeScriptBack to the Future with TypeScript
Back to the Future with TypeScript
 
Effective Java - Generics
Effective Java - GenericsEffective Java - Generics
Effective Java - Generics
 
Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)Groovy Ast Transformations (greach)
Groovy Ast Transformations (greach)
 
Virtual Separation of Concerns
Virtual Separation of ConcernsVirtual Separation of Concerns
Virtual Separation of Concerns
 

Andere mochten auch

Roslyn API : SyntaxTree vs CodeDom, SemanticModel vs Reflection
Roslyn API: SyntaxTree vs CodeDom, SemanticModel vs ReflectionRoslyn API: SyntaxTree vs CodeDom, SemanticModel vs Reflection
Roslyn API : SyntaxTree vs CodeDom, SemanticModel vs ReflectionDenis Tsvettsih
 
Dependency parsing (2013)
Dependency parsing (2013)Dependency parsing (2013)
Dependency parsing (2013)Craig Trim
 
Deep Parsing (2012)
Deep Parsing (2012)Deep Parsing (2012)
Deep Parsing (2012)Craig Trim
 
Visula C# Programming Lecture 2
Visula C# Programming Lecture 2Visula C# Programming Lecture 2
Visula C# Programming Lecture 2Abou Bakr Ashraf
 
SAS University Edition - Getting Started
SAS University Edition - Getting StartedSAS University Edition - Getting Started
SAS University Edition - Getting StartedCraig Trim
 
C# Tutorial
C# Tutorial C# Tutorial
C# Tutorial Jm Ramos
 

Andere mochten auch (8)

Roslyn API : SyntaxTree vs CodeDom, SemanticModel vs Reflection
Roslyn API: SyntaxTree vs CodeDom, SemanticModel vs ReflectionRoslyn API: SyntaxTree vs CodeDom, SemanticModel vs Reflection
Roslyn API : SyntaxTree vs CodeDom, SemanticModel vs Reflection
 
D1 Overview of C# programming
D1 Overview of C# programmingD1 Overview of C# programming
D1 Overview of C# programming
 
Dependency parsing (2013)
Dependency parsing (2013)Dependency parsing (2013)
Dependency parsing (2013)
 
Deep Parsing (2012)
Deep Parsing (2012)Deep Parsing (2012)
Deep Parsing (2012)
 
Visula C# Programming Lecture 2
Visula C# Programming Lecture 2Visula C# Programming Lecture 2
Visula C# Programming Lecture 2
 
SAS University Edition - Getting Started
SAS University Edition - Getting StartedSAS University Edition - Getting Started
SAS University Edition - Getting Started
 
C# basics
 C# basics C# basics
C# basics
 
C# Tutorial
C# Tutorial C# Tutorial
C# Tutorial
 

Ähnlich wie Project Roslyn: Exposing the C# and VB compiler’s code analysis

Pointers,virtual functions and polymorphism cpp
Pointers,virtual functions and polymorphism cppPointers,virtual functions and polymorphism cpp
Pointers,virtual functions and polymorphism cpprajshreemuthiah
 
All About ... Functions
All About ... FunctionsAll About ... Functions
All About ... FunctionsMichal Bigos
 
presentation_functions_1443207686_140676.ppt
presentation_functions_1443207686_140676.pptpresentation_functions_1443207686_140676.ppt
presentation_functions_1443207686_140676.pptSandipPradhan23
 
New features and enhancement
New features and enhancementNew features and enhancement
New features and enhancementRakesh Madugula
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingRasan Samarasinghe
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp PresentationVishwa Mohan
 
Advanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter pptAdvanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter pptMuhammad Sikandar Mustafa
 
Generic Types in Java (for ArtClub @ArtBrains Software)
Generic Types in Java (for ArtClub @ArtBrains Software)Generic Types in Java (for ArtClub @ArtBrains Software)
Generic Types in Java (for ArtClub @ArtBrains Software)Andrew Petryk
 
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHave Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHoward Lewis Ship
 
Testing for share
Testing for share Testing for share
Testing for share Rajeev Mehta
 

Ähnlich wie Project Roslyn: Exposing the C# and VB compiler’s code analysis (20)

cp05.pptx
cp05.pptxcp05.pptx
cp05.pptx
 
Notes(1).pptx
Notes(1).pptxNotes(1).pptx
Notes(1).pptx
 
Pointers,virtual functions and polymorphism cpp
Pointers,virtual functions and polymorphism cppPointers,virtual functions and polymorphism cpp
Pointers,virtual functions and polymorphism cpp
 
All About ... Functions
All About ... FunctionsAll About ... Functions
All About ... Functions
 
Java gets a closure
Java gets a closureJava gets a closure
Java gets a closure
 
Introduction to C++
Introduction to C++Introduction to C++
Introduction to C++
 
Summary of C++17 features
Summary of C++17 featuresSummary of C++17 features
Summary of C++17 features
 
presentation_functions_1443207686_140676.ppt
presentation_functions_1443207686_140676.pptpresentation_functions_1443207686_140676.ppt
presentation_functions_1443207686_140676.ppt
 
New features and enhancement
New features and enhancementNew features and enhancement
New features and enhancement
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programming
 
OOC MODULE1.pptx
OOC MODULE1.pptxOOC MODULE1.pptx
OOC MODULE1.pptx
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp Presentation
 
Csharp generics
Csharp genericsCsharp generics
Csharp generics
 
Advanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter pptAdvanced procedures in assembly language Full chapter ppt
Advanced procedures in assembly language Full chapter ppt
 
C# programming
C# programming C# programming
C# programming
 
Generic Types in Java (for ArtClub @ArtBrains Software)
Generic Types in Java (for ArtClub @ArtBrains Software)Generic Types in Java (for ArtClub @ArtBrains Software)
Generic Types in Java (for ArtClub @ArtBrains Software)
 
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for JavaHave Your Cake and Eat It Too: Meta-Programming Techniques for Java
Have Your Cake and Eat It Too: Meta-Programming Techniques for Java
 
Method parameters in c#
Method parameters in c#Method parameters in c#
Method parameters in c#
 
Testing for share
Testing for share Testing for share
Testing for share
 
C++ language
C++ languageC++ language
C++ language
 

Mehr von Microsoft Developer Network (MSDN) - Belgium and Luxembourg

Mehr von Microsoft Developer Network (MSDN) - Belgium and Luxembourg (20)

Code in the Cloud - Ghent - 20 February 2015
Code in the Cloud - Ghent - 20 February 2015Code in the Cloud - Ghent - 20 February 2015
Code in the Cloud - Ghent - 20 February 2015
 
Executive Summit for ISV & Application builders - January 2015
Executive Summit for ISV & Application builders - January 2015Executive Summit for ISV & Application builders - January 2015
Executive Summit for ISV & Application builders - January 2015
 
Executive Summit for ISV & Application builders - Internet of Things
Executive Summit for ISV & Application builders - Internet of ThingsExecutive Summit for ISV & Application builders - Internet of Things
Executive Summit for ISV & Application builders - Internet of Things
 
Executive Summit for ISV & Application builders - January 2015
Executive Summit for ISV & Application builders - January 2015Executive Summit for ISV & Application builders - January 2015
Executive Summit for ISV & Application builders - January 2015
 
Code in the Cloud - December 8th 2014
Code in the Cloud - December 8th 2014Code in the Cloud - December 8th 2014
Code in the Cloud - December 8th 2014
 
Adam azure presentation
Adam   azure presentationAdam   azure presentation
Adam azure presentation
 
release management
release managementrelease management
release management
 
cloud value for application development
cloud value for application developmentcloud value for application development
cloud value for application development
 
Modern lifecycle management practices
Modern lifecycle management practicesModern lifecycle management practices
Modern lifecycle management practices
 
Belgian visual studio launch 2013
Belgian visual studio launch 2013Belgian visual studio launch 2013
Belgian visual studio launch 2013
 
Windows Azure Virtually Speaking
Windows Azure Virtually SpeakingWindows Azure Virtually Speaking
Windows Azure Virtually Speaking
 
Inside the Microsoft TechDays Belgium Apps
Inside the Microsoft TechDays Belgium AppsInside the Microsoft TechDays Belgium Apps
Inside the Microsoft TechDays Belgium Apps
 
TechDays 2013 Developer Keynote
TechDays 2013 Developer KeynoteTechDays 2013 Developer Keynote
TechDays 2013 Developer Keynote
 
Windows Phone 8 Security Deep Dive
Windows Phone 8 Security Deep DiveWindows Phone 8 Security Deep Dive
Windows Phone 8 Security Deep Dive
 
Deep Dive into Entity Framework 6.0
Deep Dive into Entity Framework 6.0Deep Dive into Entity Framework 6.0
Deep Dive into Entity Framework 6.0
 
Applied MVVM in Windows 8 apps: not your typical MVVM session!
Applied MVVM in Windows 8 apps: not your typical MVVM session!Applied MVVM in Windows 8 apps: not your typical MVVM session!
Applied MVVM in Windows 8 apps: not your typical MVVM session!
 
Building SPA’s (Single Page App) with Backbone.js
Building SPA’s (Single Page App) with Backbone.jsBuilding SPA’s (Single Page App) with Backbone.js
Building SPA’s (Single Page App) with Backbone.js
 
Deep Dive and Best Practices for Windows Azure Storage Services
Deep Dive and Best Practices for Windows Azure Storage ServicesDeep Dive and Best Practices for Windows Azure Storage Services
Deep Dive and Best Practices for Windows Azure Storage Services
 
Building data centric applications for web, desktop and mobile with Entity Fr...
Building data centric applications for web, desktop and mobile with Entity Fr...Building data centric applications for web, desktop and mobile with Entity Fr...
Building data centric applications for web, desktop and mobile with Entity Fr...
 
Bart De Smet Unplugged
Bart De Smet UnpluggedBart De Smet Unplugged
Bart De Smet Unplugged
 

Kürzlich hochgeladen

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Kürzlich hochgeladen (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Project Roslyn: Exposing the C# and VB compiler’s code analysis

  • 1.
  • 2.
  • 3. ? (formerly known as compiler-as-a-service)
  • 5. Edit and IL Emitter Continue Emit API Go To Definition Extract Method Signature Help Binding and Flow Analysis APIs Binder Quick Info Rename Find All References Completion List Symbol API Metadata Symbols Import Object Browser Navigate To Syntax Tree API Outlining Parser Colorizer Formatter Compiler API Language Compiler Pipeline Service
  • 6. Editor Services Code Actions Classification Completion Outlining … Code Formatting Find All References Name Simplification … Services Workspace API Syntax Tree Symbol Binding and Flow Scripting Compiler API API Analysis APIs Emit API API
  • 8. class C CompilationUnit { void M() { TypeDeclaration } }// C MethodDeclaration ParameterList Block var tree = SyntaxTree.ParseCompilationUnit("...");
  • 9. class C CompilationUnit { void M() { TypeDeclaration EOF } }// C class C { MethodDeclaration } void M ParameterList Block ( ) { }
  • 10. class∙C CompilationUnit { ∙∙∙∙void∙M() ∙∙∙∙{ TypeDeclaration EOF ∙∙∙∙} }// C class SP C EOL { EOL MethodDeclaration } // C EOL SPx4 void SP M ParameterList Block ( ) EOL SPx4 { EOL SPx4 } EOL
  • 11. class C CompilationUnit { void M() { TypeDeclaration EOF } }// C class C { MethodDeclaration } void M ParameterList Block ( ) { }
  • 12. class C CompilationUnit { void M(int x) { TypeDeclaration EOF } }// C class C { MethodDeclaration } void M ParameterList Block var oldList = method.ParameterList; var newList = oldList.Update( ( ) { } openParenToken: oldList.OpenParenToken, parameters: Syntax.SeparatedList( var oldList = method.ParameterList; Syntax.Parameter( var newList = oldList.Update( typeOpt: Syntax.ParseTypeName("int "), openParenToken: oldList.OpenParenToken, identifier: Syntax.Identifier("x"))), parameters: Syntax.ParseParameterList("(int x)").Parameters, closeParenToken: oldList.CloseParenToken); var newRoot = tree.Root.ReplaceNode(oldList, newList);
  • 13. class C CompilationUnit { void M(int x) { TypeDeclaration EOF } }// C class C { MethodDeclaration } void M ParameterList Block ( Parameter ) { } var oldList = method.ParameterList; PredefinedType x var newList = oldList.Update( openParenToken: oldList.OpenParenToken, parameters: Syntax.ParseParameterList("(int x)").Parameters, closeParenToken: oldList.CloseParenToken); int var newRoot = tree.Root.ReplaceNode(oldList, newList);
  • 14. class C CompilationUnit { void M(int x) { TypeDeclaration EOF } }// C class C { MethodDeclaration } void M ParameterList Block ( Parameter ) { } var oldList = method.ParameterList; PredefinedType x var newList = oldList.Update( openParenToken: oldList.OpenParenToken, parameters: Syntax.ParseParameterList("(int x)").Parameters, closeParenToken: oldList.CloseParenToken); int var newRoot = tree.Root.ReplaceNode(oldList, newList);
  • 15. Syntax Trees Compilation • Symbols • Semantic Model • Flow Analysis • Diagnostics • Emit References
  • 16. Demo
  • 17. Host Environment Events (e.g. key presses) Apply Workspace Edit Edit Solution Solution2 Solutionn Compilation Project Project Document Document SyntaxTree
  • 18. Demo
  • 19. Code Action A representation of a code change • Produces both an edit and a preview of that edit Code Issue An interesting span of source code • Called for every node, token or trivia in a source file • Optional: May be squiggled in the editor and shown in the Error List • Optional: May provide one or more Code Actions Code Refactoring A contextually-available Code Action • Operates on the current selection in the editor • Must provide one or more Code Actions
  • 20. Demo
  • 21. Dev Center: http://msdn.microsoft.com/nl-be/roslyn Forum: http://social.msdn.microsoft.com/forums/nl-be/roslyn Email: alexturn@microsoft.com