コード例 #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));
 }