0
현재 사용자 정의 위치 및 파일 (프로젝트 또는 솔루션 내에서) 아래에있는 모든 심볼의 파일 이름 및 정의 위치를 얻는 방법은 무엇입니까?roslyn을 사용하여 텍스트 위치에서 정의로 이동
내가 할 다음 단계 (간체 설명) :
SyntaxTrees = new List<SyntaxTree>();
foreach (var file in projectFiles)
syntaxTrees.Add(SyntaxTree.ParseText(File.ReadAllText(file));
Compilation = Compilation.Create("temp.cs", null, SyntaxTrees, new MetadataReference[] { mscorlib });
구문 트리에서 현재 토큰을 가져 오기 :
는 다음과 같은 방법에 의해 구문 트리의 수집 및 편집을 만들기
var token = currentTree.GetRoot().FindToken(textPos, false);
기호에는 정의를 얻기위한 적절한 방법이 있습니다 : DeclaringSyntaxNodes
. token
을 Symbol
에서 SemanticModel
에 어떻게 해결할 수 있습니까? 감사.