protected HlslOptionsPreviewViewModelBase(IServiceProvider serviceProvider) : base(serviceProvider, HlslConstants.ContentTypeName) { var componentModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel)); _optionsService = componentModel.GetService <IHlslOptionsService>(); }
public SyntaxErrorTagger(ITextView textView, ITextBuffer textBuffer, BackgroundParser backgroundParser, IHlslOptionsService optionsService) : base(PredefinedErrorTypeNames.SyntaxError, textView, textBuffer, optionsService) { backgroundParser.SubscribeToThrottledSyntaxTreeAvailable(BackgroundParserSubscriptionDelay.Medium, async x => await InvalidateTags(x.Snapshot, x.CancellationToken)); }
public SemanticErrorTagger(ITextView textView, BackgroundParser backgroundParser, IHlslOptionsService optionsService) : base(PredefinedErrorTypeNames.CompilerError, textView, optionsService) { backgroundParser.SubscribeToThrottledSemanticModelAvailable(BackgroundParserSubscriptionDelay.Medium, async x => await InvalidateTags(x.Snapshot, x.CancellationToken)); }
public BraceCompletionContext( ISmartIndentationService smartIndentationService, ITextBufferUndoManagerProvider undoManager, HlslClassificationService classificationService, IHlslOptionsService optionsService) { _smartIndentationService = smartIndentationService; _undoManager = undoManager; _classificationService = classificationService; _optionsService = optionsService; }
public SyntaxErrorManager(BackgroundParser backgroundParser, ITextView textView, IHlslOptionsService optionsService, IServiceProvider serviceProvider, ITextDocumentFactoryService textDocumentFactoryService) : base(textView, optionsService, serviceProvider, textDocumentFactoryService) { backgroundParser.SubscribeToThrottledSyntaxTreeAvailable(BackgroundParserSubscriptionDelay.OnIdle, async x => await ExceptionHelper.TryCatchCancellation(() => { RefreshErrors(x.Snapshot, x.CancellationToken); return Task.FromResult(0); })); }
protected override void Initialize() { SyntaxVisualizerToolWindowCommand.Initialize(this); base.Initialize(); Instance = this; Options = this.AsVsServiceProvider().GetComponentModel().GetService <IHlslOptionsService>(); }
public static void Format(this ITextBuffer buffer, TextSpan span, IHlslOptionsService optionsService) { SyntaxTree syntaxTree; if (!TryGetSyntaxTree(buffer, out syntaxTree)) return; var edits = Formatter.GetEdits(syntaxTree, span, optionsService.FormattingOptions); ApplyEdits(buffer, edits); }
public FormatCommandTarget(IVsTextView adapter, IWpfTextView textView, IHlslOptionsService optionsService) { _textView = textView; _optionsService = optionsService; Dispatcher.CurrentDispatcher.InvokeAsync(() => { // Add the target later to make sure it makes it in before other command handlers ErrorHandler.ThrowOnFailure(adapter.AddCommandFilter(this, out _nextCommandTarget)); }, DispatcherPriority.ApplicationIdle); }
private static bool ShouldFormatOnCharacter(char ch, IHlslOptionsService optionsService) { switch (ch) { case '}': return optionsService.GeneralOptions.AutomaticallyFormatBlockOnCloseBrace; case ';': return optionsService.GeneralOptions.AutomaticallyFormatStatementOnSemicolon; } return false; }
private static bool ShouldFormatOnCharacter(char ch, IHlslOptionsService optionsService) { switch (ch) { case '}': return(optionsService.GeneralOptions.AutomaticallyFormatBlockOnCloseBrace); case ';': return(optionsService.GeneralOptions.AutomaticallyFormatStatementOnSemicolon); } return(false); }
// https://github.com/Microsoft/nodejstools/blob/master/Nodejs/Product/Nodejs/EditFilter.cs#L866 public static void FormatAfterTyping(this ITextView textView, char ch, IHlslOptionsService optionsService) { if (!ShouldFormatOnCharacter(ch, optionsService)) return; SyntaxTree syntaxTree; if (!TryGetSyntaxTree(textView.TextBuffer, out syntaxTree)) return; var edits = Formatter.GetEditsAfterKeystroke(syntaxTree, textView.Caret.Position.BufferPosition.Position, ch, optionsService.FormattingOptions); ApplyEdits(textView.TextBuffer, edits); }
public static void Format(this ITextBuffer buffer, TextSpan span, IHlslOptionsService optionsService) { SyntaxTree syntaxTree; if (!TryGetSyntaxTree(buffer, out syntaxTree)) { return; } var edits = Formatter.GetEdits(syntaxTree, span, optionsService.FormattingOptions); ApplyEdits(buffer, edits); }
// https://github.com/Microsoft/nodejstools/blob/master/Nodejs/Product/Nodejs/EditFilter.cs#L866 public static void FormatAfterTyping(this ITextView textView, char ch, IHlslOptionsService optionsService) { if (!ShouldFormatOnCharacter(ch, optionsService)) { return; } SyntaxTree syntaxTree; if (!TryGetSyntaxTree(textView.TextBuffer, out syntaxTree)) { return; } var edits = Formatter.GetEditsAfterKeystroke(syntaxTree, textView.Caret.Position.BufferPosition.Position, ch, optionsService.FormattingOptions); ApplyEdits(textView.TextBuffer, edits); }
public OutliningTagger(ITextBuffer textBuffer, BackgroundParser backgroundParser, IHlslOptionsService optionsService) { _textBuffer = textBuffer; backgroundParser.SubscribeToThrottledSyntaxTreeAvailable(BackgroundParserSubscriptionDelay.OnIdle, async x => await InvalidateTags(x.Snapshot, x.CancellationToken)); _enabled = optionsService.AdvancedOptions.EnterOutliningModeWhenFilesOpen; }
public HlslEditorFormattingService(IHlslOptionsService optionsService) { _optionsService = optionsService; }
public SyntaxErrorManager(BackgroundParser backgroundParser, ITextView textView, IHlslOptionsService optionsService, IServiceProvider serviceProvider, ITextDocumentFactoryService textDocumentFactoryService) : base(textView, optionsService, serviceProvider, textDocumentFactoryService) { backgroundParser.SubscribeToThrottledSyntaxTreeAvailable(BackgroundParserSubscriptionDelay.OnIdle, async x => await ExceptionHelper.TryCatchCancellation(() => { RefreshErrors(x.Snapshot, x.CancellationToken); return(Task.FromResult(0)); })); }
public HlslSyntaxFormattingService(IHlslOptionsService optionsService) { _optionsService = optionsService; }
protected override void Initialize() { SyntaxVisualizerToolWindowCommand.Initialize(this); base.Initialize(); Instance = this; Options = this.AsVsServiceProvider().GetComponentModel().GetService<IHlslOptionsService>(); }
protected HlslOptionsPreviewViewModelBase(IServiceProvider serviceProvider) : base(serviceProvider, HlslConstants.ContentTypeName) { var componentModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel)); _optionsService = componentModel.GetService<IHlslOptionsService>(); }