示例#1
0
 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);
 }
示例#2
0
            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);
            }
示例#3
0
            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);
                }
            }
示例#4
0
 public IEnumerable <DocumentSymbol> Visit(ClassSymbol classSymbol)
 {
     return(CreateSymbolsOfEntryDocument(classSymbol, classSymbol.Declaration.tok, SymbolKind.Class));
 }
示例#5
0
 public Unit Visit(ClassSymbol classSymbol)
 {
     return(VisitTypeSymbol(classSymbol));
 }