示例#1
0
        public SemanticTagger(HlslClassificationService classificationService, BackgroundParser backgroundParser)
        {
            _classificationService = classificationService;

            backgroundParser.SubscribeToThrottledSemanticModelAvailable(BackgroundParserSubscriptionDelay.Short,
                                                                        async x => await InvalidateTags(x.Snapshot, x.CancellationToken));
        }
示例#2
0
 public SemanticErrorTagger(ITextView textView, BackgroundParser backgroundParser,
                            IOptionsService optionsService)
     : base(PredefinedErrorTypeNames.CompilerError, textView, optionsService)
 {
     backgroundParser.SubscribeToThrottledSemanticModelAvailable(BackgroundParserSubscriptionDelay.Medium,
                                                                 async x => await InvalidateTags(x.Snapshot, x.CancellationToken));
 }
示例#3
0
 public SemanticErrorManager(BackgroundParser backgroundParser, ITextView textView, IHlslOptionsService optionsService, IServiceProvider serviceProvider, ITextDocumentFactoryService textDocumentFactoryService)
     : base(textView, optionsService, serviceProvider, textDocumentFactoryService)
 {
     backgroundParser.SubscribeToThrottledSemanticModelAvailable(BackgroundParserSubscriptionDelay.OnIdle,
                                                                 async x => await ExceptionHelper.TryCatchCancellation(() =>
     {
         RefreshErrors(x.Snapshot, x.CancellationToken);
         return(Task.FromResult(0));
     }));
 }
示例#4
0
        public HighlightingTagger(BackgroundParser backgroundParser, ITextView textView, ImmutableArray <IHighlighter> highlighters, IServiceProvider serviceProvider)
        {
            backgroundParser.SubscribeToThrottledSemanticModelAvailable(BackgroundParserSubscriptionDelay.OnIdle,
                                                                        async x => await InvalidateTags(x.Snapshot, x.CancellationToken));

            textView.Caret.PositionChanged += OnCaretPositionChanged;

            _textView     = textView;
            _highlighters = highlighters;

            var dte = serviceProvider.GetService <SDTE, DTE>();

            _vsVersion = VisualStudioVersionUtility.FromDteVersion(dte.Version);
        }