Presentation is loading. Please wait.

Presentation is loading. Please wait.

Juan Manuel Technical Evangelist.NET Conference 2015 Introducción práctica a Roslyn Y A XB.

Similar presentations


Presentation on theme: "Juan Manuel Technical Evangelist.NET Conference 2015 Introducción práctica a Roslyn Y A XB."— Presentation transcript:

1 Juan Manuel Servera @jmservera Technical Evangelist.NET Conference 2015 Introducción práctica a Roslyn Y A XB

2

3 Introducción práctica a Roslyn

4

5

6

7 Syntax Tree APISymbol API Binding and Flow Analysis APIs Emit API Parser Metadata Import Binder IL Emitter Symbols Language Service Compiler API Compiler Pipeline Formatter Colorizer Outlining Navigate To Object Browser Completion List Find All References Rename Quick Info Signature Help Extract Method Go To Definition Edit and Continue

8

9

10

11

12

13

14

15

16

17

18

19

20 Syntax Nodes class C { void M() { } }// C ▫ CompilationUnit TypeDeclaration MethodDeclaration ParameterListBlock SyntaxTree GetRoot

21 Syntax Tokens class C { void M() { } }// C ▫ CompilationUnit TypeDeclaration MethodDeclaration ParameterListBlock SyntaxTree GetRoot EOF classC{} voidM () {} EOF classC{} ) {}( EOF classC{} ) {}

22 Syntax Tokens EOF classC { } void M() { } class∙C { ∙∙∙∙void∙M() ∙∙∙∙{ ∙∙∙∙} }// C ▫

23 Syntax “Trivia” EOF classC { } void M() { } SPEOL class∙C { ∙∙∙∙void∙M() ∙∙∙∙{ ∙∙∙∙} }// C ▫ // C SPx4 SP classC { } void { }

24

25 CompilationUnit ClassDeclaration classC{MethodDeclaration} EOF voidMParameterListBlock (){} class C { void M(int x) { } }// C ▫ var oldList = method.ParameterList; var newList = oldList.WithParameters( parameters: SyntaxFactory.ParseParameterList("(int x)").Parameters); var newRoot = tree.GetRoot().ReplaceNode(oldList, newList);

26 class C { void M(int x) { } }// C ▫ CompilationUnit ClassDeclaration classC{MethodDeclaration} EOF voidMParameterListBlock (){}Parameter int xPredefinedType var oldList = method.ParameterList; var newList = oldList.WithParameters( parameters: SyntaxFactory.ParseParameterList("(int x)").Parameters); var newRoot = tree.GetRoot().ReplaceNode(oldList, newList);

27 class C { void M(int x) { } }// C ▫ CompilationUnit ClassDeclaration classC{ MethodDeclaration } EOF voidM ParameterList Block (){} Parameter int xPredefinedType var oldList = method.ParameterList; var newList = oldList.WithParameters( parameters: SyntaxFactory.ParseParameterList("(int x)").Parameters); var newRoot = tree.GetRoot().ReplaceNode(oldList, newList);

28 SyntaxTreesReferences Compilation Symbols Diagnostics Emit Compilación, Referencias y Símbolos

29 Semántica Compilation SemanticModel Binding Information Conversion Classification Flow Analysis Etc. GetSemanticModel(tree)

30 Workspace, Solutions, Projects y Documents Apply Edit SyntaxTree Compilation Events (e.g. key presses)

31 RegisterSyntaxNodeActionTriggered when a particular kind of syntax node has been parsed RegisterSymbolActionTriggered when a particular kind of symbol has been analyzed RegisterSyntaxTreeActionTriggered when the file’s whole syntax tree has been parsed RegisterSemanticModelActionTriggered when a semantic model is available for the whole file RegisterCodeBlock(Start|End)ActionTriggered before/after analysis of a method body or other code block RegisterCompilation(Start|End)ActionTriggered before/after analysis of the entire project

32

33

34

35

36

37

38 Juan Manuel Servera Technical Evangelist @jmservera ¡¡¡Si te ha gustado no olvides rellenar la encuesta!!! Thanks Y A XB


Download ppt "Juan Manuel Technical Evangelist.NET Conference 2015 Introducción práctica a Roslyn Y A XB."

Similar presentations


Ads by Google