public Unit Visit(ClassSymbol classSymbol) { _cancellationToken.ThrowIfCancellationRequested(); RegisterLocation( classSymbol, classSymbol.Declaration.tok, classSymbol.Declaration.tok.GetLspRange(), new Range(classSymbol.Declaration.tok.GetLspPosition(), classSymbol.Declaration.BodyEndTok.GetLspPosition()) ); VisitChildren(classSymbol); return(Unit.Value); }
private ClassSymbol ProcessClass(Symbol scope, ClassDecl classDeclaration) { _cancellationToken.ThrowIfCancellationRequested(); var classSymbol = new ClassSymbol(scope, classDeclaration); foreach (var member in classDeclaration.Members) { var memberSymbol = ProcessClassMember(classSymbol, member); if (memberSymbol != null) { // TODO When respecting all possible class members, this should never be null. classSymbol.Members.Add(memberSymbol); } } return(classSymbol); }
private Symbol?ProcessClassMember(ClassSymbol scope, MemberDecl memberDeclaration) { _cancellationToken.ThrowIfCancellationRequested(); switch (memberDeclaration) { case Function function: return(ProcessFunction(scope, function)); case Method method: // TODO handle the constructors explicitely? The constructor is a sub-class of Method. return(ProcessMethod(scope, method)); case Field field: return(ProcessField(scope, field)); default: // TODO The last missing member is AmbiguousMemberDecl which is created by the resolver. // When is this class exactly used? _logger.LogWarning("encountered unknown class member declaration {}", memberDeclaration.GetType()); return(null); } }
public IEnumerable <DocumentSymbol> Visit(ClassSymbol classSymbol) { return(CreateSymbolsOfEntryDocument(classSymbol, classSymbol.Declaration.tok, SymbolKind.Class)); }
public Unit Visit(ClassSymbol classSymbol) { return(VisitTypeSymbol(classSymbol)); }