public void AddSyntacticClassifications(SyntaxTree syntaxTree, TextSpan textSpan, ArrayBuilder <ClassifiedSpan> result, CancellationToken cancellationToken)
 {
     if (ShouldRunExperiment(WellKnownExperimentNames.SyntacticExp_Local))
     {
         using (new RequestLatencyTracker(SyntacticLspLogger.RequestType.SyntacticClassifications))
         {
             _originalService.AddSyntacticClassifications(syntaxTree, textSpan, result, cancellationToken);
         }
     }
     else if (ShouldRunExperiment(WellKnownExperimentNames.SyntacticExp_Remote))
     {
         using (new RequestLatencyTracker(SyntacticLspLogger.RequestType.SyntacticClassifications))
         {
             _threadingContext.JoinableTaskFactory.Run(async() =>
             {
                 var sourceText = await syntaxTree.GetTextAsync(cancellationToken).ConfigureAwait(false);
                 await AddRemoteClassificationsAsync(SyntaxClassificationsHandler.SyntaxClassificationsMethodName, syntaxTree.FilePath, sourceText, textSpan, result.Add, cancellationToken).ConfigureAwait(false);
             });
         }
     }
     else if (ShouldRunExperiment(WellKnownExperimentNames.SyntacticExp_LiveShareTagger_Remote) ||
              ShouldRunExperiment(WellKnownExperimentNames.SyntacticExp_LiveShareTagger_TextMate))
     {
         // do nothing here so that existing RoslynSyntacticTagger return nothing in this mode
         return;
     }
     else
     {
         // Invalid experiment flight or older client.  Since this is an experiment, just fallback.
         _originalService.AddSyntacticClassifications(syntaxTree, textSpan, result, cancellationToken);
     }
 }
 public void AddSyntacticClassifications(SyntaxTree syntaxTree, TextSpan textSpan, ArrayBuilder <ClassifiedSpan> result, CancellationToken cancellationToken)
 {
     if (ShouldRunExperiment(WellKnownExperimentNames.SyntacticExp_LiveShareTagger_Remote) ||
         ShouldRunExperiment(WellKnownExperimentNames.SyntacticExp_LiveShareTagger_TextMate))
     {
         // do nothing here so that existing RoslynSyntacticTagger return nothing in this mode
         return;
     }
     else
     {
         // Invalid experiment flight or older client.  Since this is an experiment, just fallback.
         _originalService.AddSyntacticClassifications(syntaxTree, textSpan, result, cancellationToken);
     }
 }
Example #3
0
 public void AddSyntacticClassifications(SyntaxTree syntaxTree, TextSpan textSpan, ArrayBuilder <ClassifiedSpan> result, CancellationToken cancellationToken)
 {
     _originalService.AddSyntacticClassifications(syntaxTree, textSpan, result, cancellationToken);
 }