void ProcessCompilationUnit(CompilationUnitSyntax syntax, CancellationToken cancellationToken) {

            if (!_processAsIncludedFile) {
                foreach(var includeDirectiveSyntax in syntax.DescendantNodes().OfType<IncludeDirectiveSyntax>()) {
                    cancellationToken.ThrowIfCancellationRequested();
                    ProcessIncludeDirective(includeDirectiveSyntax, cancellationToken);
                }
                foreach (var taskDeclarationSyntax in syntax.DescendantNodes().OfType<TaskDeclarationSyntax>()) {
                    cancellationToken.ThrowIfCancellationRequested();
                    ProcessTaskDeclaration(taskDeclarationSyntax);
                }
            }
            foreach (var taskDefinitionSyntax in syntax.DescendantNodes().OfType<TaskDefinitionSyntax>()) {
                cancellationToken.ThrowIfCancellationRequested();
                ProcessTaskDefinition(taskDefinitionSyntax);
            }
        }
コード例 #2
0
        void ProcessNavLanguage(CompilationUnitSyntax syntax, CancellationToken cancellationToken) {

            cancellationToken.ThrowIfCancellationRequested();

            //====================
            // 1. TaskDeclarations 
            //====================
            var taskDeclarationResult = TaskDeclarationSymbolBuilder.FromCompilationUnit(syntax, cancellationToken);

            _diagnostics.AddRange(taskDeclarationResult.Diagnostics);
            _taskDeclarations.AddRange(taskDeclarationResult.TaskDeklarations);
            _includes.AddRange(taskDeclarationResult.Includes);

            cancellationToken.ThrowIfCancellationRequested();

            //====================
            // 2. TaskDefinitions
            //====================
            foreach (var taskDefinitionSyntax in syntax.DescendantNodes().OfType<TaskDefinitionSyntax>()) {
                ProcessTaskDefinitionSyntax(taskDefinitionSyntax, cancellationToken);
            }

            //====================
            // 3. Collect Symbols
            //====================
            // Nur Symbole von Taskdeklarationen der eigenen Datei, und auch nur solche, die aus "taskrefs task" entstanden sind
            _symbols.AddRange(_taskDeclarations.Where(td => !td.IsIncluded && 
                                                            td.Origin==TaskDeclarationOrigin.TaskDeclaration)
                                               .SelectMany(td => td.SymbolsAndSelf()));

            // Alle Symbole und deren "Kinder" der Taskdefinitionen
            _symbols.AddRange(_taskDefinitions.SelectMany(td => td.SymbolsAndSelf()));

            // Alle Includes (= taskref "filepath") hinzufügen
            _symbols.AddRange(_includes);            
        }
コード例 #3
0
        void ProcessCodeLanguage(CompilationUnitSyntax syntax, CancellationToken cancellationToken) {
            foreach (var codeUsingDeclarationSyntax in syntax.DescendantNodes().OfType<CodeUsingDeclarationSyntax>()) {

                cancellationToken.ThrowIfCancellationRequested();

                ProcessCodeUsingDeclaration(codeUsingDeclarationSyntax);
            }
        }