~/talk

The Power of Roslyn

Talkat NDC Oslo 2018 · 2018-06-11..06-15· [dotnet, developer-experience]
links:none on file
slides:none on file

Shows how to build a real Roslyn analyzer and a code fix that finds every new zero‑length array and replaces it with Array.Empty<T>, using the IOperation array creation node plus the semantic model to get the element type. Uses the Visual Studio SDK templates, Syntax Visualizer, unit tests and F5-debugging to produce a VSIX. The fixer uses the SyntaxGenerator invocation API to synthesize language‑agnostic C# and VB code, checks for System.Array in the compilation, and installs and works in both languages.

AI-written summary · about

  1. 0:00Start
  2. 0:30Agenda
  3. 4:12What Is an Analyzer
  4. 7:32Syntax Tree Api
  5. 8:07The Syntax Tree Api
  6. 9:07Properties of the Syntax Tree
  7. 10:07The Semantic Model
  8. 12:47Recap
  9. 13:19Syntax Generator
  10. 15:34Syntax Trees
  11. 18:57Diagnostic Descriptor
  12. 21:35Array Creation
  13. 27:06Unit Test
  14. 29:34Write a Fix
  15. 34:33Syntax Visualizer
  16. 36:54Debugging
  17. 38:37Build Our Type Expression
  18. 40:00Generic Expression
  19. 45:53Replace Node
  20. 46:09Create a New Document
  21. 46:44Spelling Mistakes
  22. 56:05References
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.