logo
  • 教程列表
  • SO官方文檔
  • 語法樹
    • 使用 LINQ 遍歷語法樹
    • 使用 CSharpSyntaxWalker 遍歷語法樹
    • 從文件中獲取語法樹根
  1. StackOverflow 文件
  2. roslyn 教程
  3. 語法樹
  4. 從文件中獲取語法樹根

從文件中獲取語法樹根

Created: November-22, 2018

如果你已經可以從工作區( 使用工作區 ) 訪問 Document 類,則可以輕鬆訪問語法樹的根目錄。

 Document document = ... // Get document from workspace or other source 

 var syntaxRoot = await document.GetSyntaxRootAsync();
  • 使用 CSharpSyntaxWalker 遍歷語法樹

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明