コード例 #1
0
ファイル: SemanticTagger.cs プロジェクト: Samana/HlslTools
        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);
        }