public BottomMargin(IWpfTextView textView, IClassifierAggregatorService classifier, ITextDocumentFactoryService documentService)
        {
            _textView = textView;
            _classifier = classifier.GetClassifier(textView.TextBuffer);
            _foregroundBrush = new SolidColorBrush((Color)FindResource(VsColors.CaptionTextKey));
            _backgroundBrush = new SolidColorBrush((Color)FindResource(VsColors.ScrollBarBackgroundKey));

            this.Background = _backgroundBrush;
            this.ClipToBounds = true;

            _lblEncoding = new TextControl("Encoding");
            this.Children.Add(_lblEncoding);

            _lblContentType = new TextControl("Content type");
            this.Children.Add(_lblContentType);

            _lblClassification = new TextControl("Classification");
            this.Children.Add(_lblClassification);

            _lblSelection = new TextControl("Selection");
            this.Children.Add(_lblSelection);

            UpdateClassificationLabel();
            UpdateContentTypeLabel();
            UpdateContentSelectionLabel();

            if (documentService.TryGetTextDocument(textView.TextDataModel.DocumentBuffer, out _doc))
            {
                _doc.FileActionOccurred += FileChangedOnDisk;
                UpdateEncodingLabel(_doc);
            }

            textView.Caret.PositionChanged += CaretPositionChanged;
        }
예제 #2
0
        public BottomMargin(IWpfTextView textView, IClassifierAggregatorService classifier, ITextDocumentFactoryService documentService)
        {
            _textView        = textView;
            _classifier      = classifier.GetClassifier(textView.TextBuffer);
            _foregroundBrush = new SolidColorBrush((Color)FindResource(VsColors.CaptionTextKey));
            _backgroundBrush = new SolidColorBrush((Color)FindResource(VsColors.ScrollBarBackgroundKey));

            this.Background   = _backgroundBrush;
            this.ClipToBounds = true;

            _lblEncoding = new TextControl("Encoding");
            this.Children.Add(_lblEncoding);

            _lblContentType = new TextControl("Content type");
            this.Children.Add(_lblContentType);

            _lblClassification = new TextControl("Classification");
            this.Children.Add(_lblClassification);

            _lblSelection = new TextControl("Selection");
            this.Children.Add(_lblSelection);

            UpdateClassificationLabel();
            UpdateContentTypeLabel();
            UpdateContentSelectionLabel();

            if (documentService.TryGetTextDocument(textView.TextDataModel.DocumentBuffer, out _doc))
            {
                _doc.FileActionOccurred += FileChangedOnDisk;
                UpdateEncodingLabel(_doc);
            }

            textView.Caret.PositionChanged += CaretPositionChanged;
        }
예제 #3
0
        public AttributeScopeTagger(ITextBuffer buffer, SQLanguageService service, IClassificationTypeRegistryService typeService, IClassifierAggregatorService classifierAggregator)
        {
            _classifierAggregator = classifierAggregator;
            var classificationType = typeService.GetClassificationType(SQAtrributeFormat);

            _attribtag = new ClassificationTag(classificationType);

            classificationType = typeService.GetClassificationType(PredefinedClassificationTypeNames.Comment);
            _commenttag        = new ClassificationTag(classificationType);

            classificationType = typeService.GetClassificationType(PredefinedClassificationTypeNames.String);
            _stringtag         = new ClassificationTag(classificationType);

            classificationType = typeService.GetClassificationType("class name");
            _classtag          = new ClassificationTag(classificationType);

            classificationType = typeService.GetClassificationType("enum name");
            _enumtag           = new ClassificationTag(classificationType);

            classificationType = typeService.GetClassificationType(PredefinedClassificationTypeNames.SymbolReference);
            _subnametag        = new ClassificationTag(classificationType);

            classificationType = typeService.GetClassificationType("number");
            _numberictag       = new ClassificationTag(classificationType);

            _languangeService = service;
            _buffer           = buffer;
            //this.snapshot = buffer.CurrentSnapshot;
            filepath = SQLanguageService.GetFileName(buffer);
        }
예제 #4
0
 SignatureHelpPresenterProvider(ITextBufferFactoryService textBufferFactoryService, IContentTypeRegistryService contentTypeRegistryService, IClassifierAggregatorService classifierAggregatorService, IClassificationFormatMapService classificationFormatMapService)
 {
     this.textBufferFactoryService       = textBufferFactoryService;
     this.contentTypeRegistryService     = contentTypeRegistryService;
     this.classifierAggregatorService    = classifierAggregatorService;
     this.classificationFormatMapService = classificationFormatMapService;
 }
예제 #5
0
        public BottomMargin(IWpfTextView textView, IClassifierAggregatorService classifier, ITextDocumentFactoryService documentService)
        {
            _textView = textView;
            _classifier = classifier.GetClassifier(textView.TextBuffer);

            SetResourceReference(BackgroundProperty, EnvironmentColors.ScrollBarBackgroundBrushKey);

            ClipToBounds = true;

            _lblEncoding = new TextControl("Encoding");
            Children.Add(_lblEncoding);

            _lblContentType = new TextControl("Content type");
            Children.Add(_lblContentType);

            _lblClassification = new TextControl("Classification");
            Children.Add(_lblClassification);

            _lblSelection = new TextControl("Selection");
            Children.Add(_lblSelection);

            UpdateClassificationLabel();
            UpdateContentTypeLabel();
            UpdateContentSelectionLabel();

            if (documentService.TryGetTextDocument(textView.TextDataModel.DocumentBuffer, out _doc))
            {
                _doc.FileActionOccurred += FileChangedOnDisk;
                UpdateEncodingLabel(_doc);
            }

            textView.Caret.PositionChanged += CaretPositionChanged;
        }
 public EditorConfigCompletionSource(ITextBuffer buffer, IClassifierAggregatorService classifier, ITextStructureNavigatorSelectorService navigator, ImageSource glyph)
 {
     _buffer = buffer;
     _classifier = classifier.GetClassifier(buffer);
     _navigator = navigator;
     _glyph = glyph;
 }
예제 #7
0
#pragma warning restore 0169

		public SignatureHelpPresenter(ISignatureHelpSession session, ITextBufferFactoryService textBufferFactoryService, IContentTypeRegistryService contentTypeRegistryService, IClassifierAggregatorService classifierAggregatorService, IClassificationFormatMap classificationFormatMap) {
			if (session == null)
				throw new ArgumentNullException(nameof(session));
			if (textBufferFactoryService == null)
				throw new ArgumentNullException(nameof(textBufferFactoryService));
			if (contentTypeRegistryService == null)
				throw new ArgumentNullException(nameof(contentTypeRegistryService));
			if (classifierAggregatorService == null)
				throw new ArgumentNullException(nameof(classifierAggregatorService));
			if (classificationFormatMap == null)
				throw new ArgumentNullException(nameof(classificationFormatMap));
			this.session = session;
			control = new SignatureHelpPresenterControl { DataContext = this };
			signatureTextBuffer = textBufferFactoryService.CreateTextBuffer();
			otherTextBuffer = textBufferFactoryService.CreateTextBuffer();
			signatureTextBuffer.Properties[SignatureHelpConstants.SessionBufferKey] = session;
			otherTextBuffer.Properties[SignatureHelpConstants.SessionBufferKey] = session;
			this.contentTypeRegistryService = contentTypeRegistryService;
			this.classifierAggregatorService = classifierAggregatorService;
			this.classificationFormatMap = classificationFormatMap;
			defaultExtendedContentType = contentTypeRegistryService.GetContentType(DefaultExtendedContentTypeName);
			Debug.Assert(defaultExtendedContentType != null);
			classificationFormatMap.ClassificationFormatMappingChanged += ClassificationFormatMap_ClassificationFormatMappingChanged;
			session.Dismissed += Session_Dismissed;
			session.SelectedSignatureChanged += Session_SelectedSignatureChanged;
			control.MouseDown += Control_MouseDown;
			// This isn't exposed but ReadOnlyObservableCollection<ISignature> does implement the interface
			((INotifyCollectionChanged)session.Signatures).CollectionChanged += Signatures_CollectionChanged;
			UpdateSelectedSignature();
			UpdatePresentationSpan();
		}
예제 #8
0
        public BottomMargin(IWpfTextView textView, IClassifierAggregatorService classifier, ITextDocumentFactoryService documentService)
        {
            _textView   = textView;
            _classifier = classifier.GetClassifier(textView.TextBuffer);

            SetResourceReference(BackgroundProperty, EnvironmentColors.ScrollBarBackgroundBrushKey);

            ClipToBounds = true;

            _lblEncoding = new TextControl("Encoding");
            Children.Add(_lblEncoding);

            _lblContentType = new TextControl("Content type");
            Children.Add(_lblContentType);

            _lblClassification = new TextControl("Classification");
            Children.Add(_lblClassification);

            _lblSelection = new TextControl("Selection");
            Children.Add(_lblSelection);

            UpdateClassificationLabel();
            UpdateContentTypeLabel();
            UpdateContentSelectionLabel();

            if (documentService.TryGetTextDocument(textView.TextDataModel.DocumentBuffer, out _doc))
            {
                _doc.FileActionOccurred += FileChangedOnDisk;
                UpdateEncodingLabel(_doc);
            }

            textView.Caret.PositionChanged += CaretPositionChanged;
        }
 public CheckTextErrorTagger(IWpfTextView view, IClassifierAggregatorService classifier, ErrorListProvider errorlist, ITextDocument document)
 {
     _view       = view;
     _classifier = classifier.GetClassifier(view.TextBuffer);
     _errorlist  = errorlist;
     _document   = document;
 }
 public EditorConfigCompletionSource(ITextBuffer buffer, IClassifierAggregatorService classifier, ITextStructureNavigatorSelectorService navigator, ImageSource glyph)
 {
     _buffer     = buffer;
     _classifier = classifier.GetClassifier(buffer);
     _navigator  = navigator;
     _glyph      = glyph;
 }
        public GoToDefinitionTextViewCreationListener(SVsServiceProvider serviceProvider, IVsEditorAdaptersFactoryService editorAdaptersFactoryService, ITextStructureNavigatorSelectorService textStructureNavigatorSelectorService, IClassifierAggregatorService classifierAggregatorService, MefProviderOptions mefProviderOptions)
        {
            if (serviceProvider == null)
            {
                throw new ArgumentNullException("serviceProvider");
            }
            if (editorAdaptersFactoryService == null)
            {
                throw new ArgumentNullException("editorAdaptersFactoryService");
            }
            if (textStructureNavigatorSelectorService == null)
            {
                throw new ArgumentNullException("textStructureNavigatorSelectorService");
            }
            if (classifierAggregatorService == null)
            {
                throw new ArgumentNullException("classifierAggregatorService");
            }
            if (mefProviderOptions == null)
            {
                throw new ArgumentNullException("mefProviderOptions");
            }

            ServiceProvider = serviceProvider;
            _editorAdaptersFactoryService         = editorAdaptersFactoryService;
            TextStructureNavigatorSelectorService = textStructureNavigatorSelectorService;
            ClassifierAggregatorService           = classifierAggregatorService;
            MefProviderOptions = mefProviderOptions;
        }
        public VsctCompletionSource(ITextBuffer buffer, IClassifierAggregatorService classifier, ITextStructureNavigatorSelectorService navigator, string file)
        {
            _classifier = classifier.GetClassifier(buffer);
            _navigator  = navigator.GetTextStructureNavigator(buffer);

            _parser = new VsctParser(this, file);
        }
예제 #13
0
 public CommandFilter(IWpfTextView textView, IClassifierAggregatorService aggregatorFactory,
                      SVsServiceProvider globalServiceProvider, IEditorOperationsFactoryService editorOperationsFactory)
 {
     this.textView = textView;
     classifier    = aggregatorFactory.GetClassifier(textView.TextBuffer);
     this.globalServiceProvider = globalServiceProvider;
     editorOperations           = editorOperationsFactory.GetEditorOperations(textView);
 }
예제 #14
0
 public CSharpDocumentationCompletionSource(ITextView textView, IClassifierAggregatorService classifier, ITextStructureNavigatorSelectorService navigator, IEditorOperationsFactoryService operationsFactory)
 {
     _textView          = textView;
     _textBuffer        = textView.TextBuffer;
     _classifier        = classifier.GetClassifier(_textBuffer);
     _navigator         = navigator.GetTextStructureNavigator(_textBuffer);
     _operationsFactory = operationsFactory;
 }
예제 #15
0
 public SpeedTypingTarget(CssSortPropertiesViewCreationListener componentContext, IVsTextView adapter, IWpfTextView textView)
 {
     this._dte = EditorExtensionsPackage.DTE;
     this._textView = textView;
     this._aggregator = componentContext.AggregatorService;
     this._broker = componentContext.CompletionBroker;
     this._QuickInfobroker = componentContext.QuickInfoBroker;
 }
예제 #16
0
 public SpeedTypingTarget(CssSortPropertiesViewCreationListener componentContext, IVsTextView adapter, IWpfTextView textView)
 {
     this._dte             = EditorExtensionsPackage.DTE;
     this._textView        = textView;
     this._aggregator      = componentContext.AggregatorService;
     this._broker          = componentContext.CompletionBroker;
     this._QuickInfobroker = componentContext.QuickInfoBroker;
 }
 public PkgdefCompletionSource(ITextBuffer buffer, IClassifierAggregatorService classifier, ITextStructureNavigatorSelectorService navigator, IGlyphService glyphService)
 {
     _buffer       = buffer;
     _classifier   = classifier.GetClassifier(buffer);
     _navigator    = navigator;
     _glyphService = glyphService;
     _defaultGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupField, StandardGlyphItem.GlyphItemPublic);
     _snippetGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphCSharpExpansion, StandardGlyphItem.GlyphItemPublic);
 }
 public CmdCompletionSource(ITextBuffer buffer, IClassifierAggregatorService classifier, IGlyphService glyphService, ITextStructureNavigator textStructureNavigator)
 {
     _buffer = buffer;
     _classifier = classifier.GetClassifier(buffer);
     _keywordGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupVariable, StandardGlyphItem.GlyphItemPublic);
     _environmentGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphAssembly, StandardGlyphItem.GlyphItemPublic);
     _labelGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphArrow, StandardGlyphItem.GlyphItemPublic);
     _textStructureNavigator = textStructureNavigator;
 }
 public CmdCompletionSource(ITextBuffer buffer, IClassifierAggregatorService classifier, IGlyphService glyphService, ITextStructureNavigator textStructureNavigator)
 {
     _buffer                 = buffer;
     _classifier             = classifier.GetClassifier(buffer);
     _keywordGlyph           = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupVariable, StandardGlyphItem.GlyphItemPublic);
     _environmentGlyph       = glyphService.GetGlyph(StandardGlyphGroup.GlyphAssembly, StandardGlyphItem.GlyphItemPublic);
     _labelGlyph             = glyphService.GetGlyph(StandardGlyphGroup.GlyphArrow, StandardGlyphItem.GlyphItemPublic);
     _textStructureNavigator = textStructureNavigator;
 }
 public PkgdefCompletionSource(ITextBuffer buffer, IClassifierAggregatorService classifier, ITextStructureNavigatorSelectorService navigator, IGlyphService glyphService)
 {
     _buffer = buffer;
     _classifier = classifier.GetClassifier(buffer);
     _navigator = navigator;
     _glyphService = glyphService;
     _defaultGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupField, StandardGlyphItem.GlyphItemPublic);
     _snippetGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphCSharpExpansion, StandardGlyphItem.GlyphItemPublic);
 }
예제 #21
0
 SignatureHelpBroker(Lazy <IIntellisenseSessionStackMapService> intellisenseSessionStackMapService, [ImportMany] IEnumerable <Lazy <ISignatureHelpSourceProvider, IOrderableContentTypeMetadata> > signatureHelpSourceProviders, ITextBufferFactoryService textBufferFactoryService, IContentTypeRegistryService contentTypeRegistryService, IClassifierAggregatorService classifierAggregatorService, IClassificationFormatMapService classificationFormatMapService)
 {
     this.intellisenseSessionStackMapService = intellisenseSessionStackMapService;
     this.signatureHelpSourceProviders       = Orderer.Order(signatureHelpSourceProviders).ToArray();
     this.textBufferFactoryService           = textBufferFactoryService;
     this.contentTypeRegistryService         = contentTypeRegistryService;
     this.classifierAggregatorService        = classifierAggregatorService;
     this.classificationFormatMapService     = classificationFormatMapService;
 }
 public VsctCompletionSource(ITextBuffer buffer, IClassifierAggregatorService classifier, ITextStructureNavigatorSelectorService navigator, IGlyphService glyphService)
 {
     _buffer = buffer;
     _classifier = classifier.GetClassifier(buffer);
     _navigator = navigator;
     _glyphService = glyphService;
     _defaultGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupField, StandardGlyphItem.GlyphItemPublic);
     _builtInGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupProperty, StandardGlyphItem.TotalGlyphItems);
     _imageService = ExtensibilityToolsPackage.GetGlobalService(typeof(SVsImageService)) as IVsImageService2;
 }
 public VsctCompletionSource(ITextBuffer buffer, IClassifierAggregatorService classifier, ITextStructureNavigatorSelectorService navigator, IGlyphService glyphService)
 {
     _buffer       = buffer;
     _classifier   = classifier.GetClassifier(buffer);
     _navigator    = navigator;
     _glyphService = glyphService;
     _defaultGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupField, StandardGlyphItem.GlyphItemPublic);
     _builtInGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupProperty, StandardGlyphItem.TotalGlyphItems);
     _imageService = ExtensibilityToolsPackage.GetGlobalService(typeof(SVsImageService)) as IVsImageService2;
 }
예제 #24
0
 public NavigableSymbolSourceProvider(
     [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
     IClassifierAggregatorService classifierFactory,
     ITextStructureNavigatorSelectorService navigatorService
     )
 {
     _serviceProvider   = serviceProvider;
     _classifierFactory = classifierFactory;
     _navigatorService  = navigatorService;
 }
예제 #25
0
        public AutoWrapper(SVsServiceProvider serviceProvider, IClassifierAggregatorService aggregatorService, IWpfTextView textView)
        {
            var service = serviceProvider.GetService<CommentatorService>();
            this.options = service.GetOptions();

            this.view = textView;
            this.classifier = aggregatorService.GetClassifier(this.view.TextBuffer);

            this.view.TextBuffer.Changed += this.TextBuffer_Changed;
            this.view.Closed += this.View_Closed;
        }
예제 #26
0
        public MasmOutlineTagger(ITextBuffer buffer, IClassifierAggregatorService classifierAggregator)
        {
            _classifierAggregator = classifierAggregator;

            this.buffer   = buffer;
            this.snapshot = buffer.CurrentSnapshot;
            this.regions  = new List <Region>();
            this.ReParse();
            // this makes sure outling region updated
            // but it will decrease performance
            this.buffer.ChangedLowPriority += BufferChanged;
        }
예제 #27
0
 public HighlightWordTagger(ITextView view, ITextBuffer sourceBuffer, ITextSearchService textSearchService, ITextStructureNavigator textStructureNavigator, IClassifierAggregatorService aggregator)
 {
     _aggregator                      = aggregator;
     this.View                        = view;
     this.SourceBuffer                = sourceBuffer;
     this.TextSearchService           = textSearchService;
     this.TextStructureNavigator      = textStructureNavigator;
     this.WordSpans                   = new NormalizedSnapshotSpanCollection();
     this.CurrentWord                 = null;
     this.View.Caret.PositionChanged += CaretPositionChanged;
     this.View.LayoutChanged         += ViewLayoutChanged;
 }
예제 #28
0
        internal XSharpBraceMatchingTagger(ITextView view, ITextBuffer sourceBuffer, IClassifierAggregatorService AggregatorFactory, IClassificationTypeRegistryService registry)
        {
            this.View         = view;
            this.SourceBuffer = sourceBuffer;
            this.CurrentChar  = null;
            //
            this.classifier           = AggregatorFactory.GetClassifier(sourceBuffer);
            this.xsharpBraceOpenType  = registry.GetClassificationType(XSharpColorizer.ColorizerConstants.XSharpBraceOpenFormat);
            this.xsharpBraceCloseType = registry.GetClassificationType(XSharpColorizer.ColorizerConstants.XSharpBraceCloseFormat);

            this.View.Caret.PositionChanged += CaretPositionChanged;
            this.View.LayoutChanged         += ViewLayoutChanged;
        }
예제 #29
0
        internal DevSkimProvider([Import] ITableManagerProvider provider, [Import] ITextDocumentFactoryService textDocumentFactoryService, [Import] IClassifierAggregatorService classifierAggregatorService)
        {
            this.ErrorTableManager          = provider.GetTableManager(StandardTables.ErrorsTable);
            this.TextDocumentFactoryService = textDocumentFactoryService;

            this.ClassifierAggregatorService = classifierAggregatorService;

            this.ErrorTableManager.AddSource(this, StandardTableColumnDefinitions.DetailsExpander,
                                             StandardTableColumnDefinitions.ErrorSeverity, StandardTableColumnDefinitions.ErrorCode,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.BuildTool,
                                             StandardTableColumnDefinitions.ErrorSource, StandardTableColumnDefinitions.ErrorCategory,
                                             StandardTableColumnDefinitions.Text, StandardTableColumnDefinitions.DocumentName, StandardTableColumnDefinitions.Line, StandardTableColumnDefinitions.Column);
        }
 public TextInformationManager(IServiceProvider serviceProvider, IComponentModel componentModel)
 {
     this.serviceProvider = serviceProvider;
     this.componentModel = componentModel;
     fontAndColorStorage = (IVsFontAndColorStorage) serviceProvider.GetService(typeof (SVsFontAndColorStorage));
     fontAndColorUtilities = fontAndColorStorage as IVsFontAndColorUtilities;
     fontAndColorCache = (IVsFontAndColorCacheManager)serviceProvider.GetService(typeof(SVsFontAndColorCacheManager));
     textManager = (IVsTextManager) serviceProvider.GetService(typeof (SVsTextManager));
     editorAdaptersFactoryService = componentModel.GetService<IVsEditorAdaptersFactoryService>();
     textStructureNavigatorSelectorService = componentModel.GetService<ITextStructureNavigatorSelectorService>();
     classicationFormatMapService = componentModel.GetService<IClassificationFormatMapService>();
     classificationAggregatorService = componentModel.GetService<IClassifierAggregatorService>();
 }
예제 #31
0
        public GlslCompletionSourceProvider(IClassifierAggregatorService classifierAggregatorService, IGlyphService glyphService)
        {
            if (glyphService is null)
            {
                throw new ArgumentNullException(nameof(glyphService));
            }

            this.classifierAggregatorService = classifierAggregatorService ?? throw new ArgumentNullException(nameof(classifierAggregatorService));
            identifier = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupVariable, StandardGlyphItem.GlyphItemFriend);

            var keyword  = glyphService.GetGlyph(StandardGlyphGroup.GlyphKeyword, StandardGlyphItem.GlyphItemPublic);
            var function = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupMethod, StandardGlyphItem.GlyphItemPublic);
            var variable = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupVariable, StandardGlyphItem.GlyphItemPublic);

            ImageSource ConvertReservedType(TokenType type)
            {
                switch (type)
                {
                case TokenType.Keyword: return(keyword);

                case TokenType.Function: return(function);

                case TokenType.Variable: return(variable);

                default: return(identifier);
                }
            }

            foreach (var var in GlslSpecification.ReservedWords)
            {
                staticCompletions.Add(GlslCompletionSource.NewCompletion(var.Key, ConvertReservedType(var.Value)));
            }
            //ImageSource ConvertUser(UserKeyWords.DefinedWordType type)
            //{
            //	switch (type)
            //	{
            //		case UserKeyWords.DefinedWordType.UserKeyword1:
            //		case UserKeyWords.DefinedWordType.UserKeyword2:
            //		default: return identifier;
            //	}
            //}
            //foreach (var var in UserKeyWords.DefinedWords)
            //{
            //	staticCompletions.Add(GlslCompletionSource.NewCompletion(var.Key, ConvertUser(var.Value)));
            //}
            staticCompletions.Sort((a, b) => a.DisplayText.CompareTo(b.DisplayText));
        }
예제 #32
0
        public XSharpOutliningTagger(ITextBuffer buffer, IClassifierAggregatorService AggregatorFactory, IClassificationTypeRegistryService registry)
        {
            this.buffer = buffer;
            if (buffer.Properties.ContainsProperty(typeof(XFile)))
            {
                _file = buffer.GetFile();
            }

            if (!buffer.Properties.ContainsProperty(typeof(XSharpClassifier)))
            {
                // should not happen we checked before we created the class
                return;
            }
            this.buffer.Properties.AddProperty(typeof(XSharpOutliningTagger), this);
            xsharpRegionStartType = registry.GetClassificationType(ColorizerConstants.XSharpRegionStartFormat);
            xsharpRegionStopType  = registry.GetClassificationType(ColorizerConstants.XSharpRegionStopFormat);
        }
        public XmlCompletionSource(
            XmlCompletionSourceProvider sourceProvider
            , ITextBuffer buffer
            , IClassifierAggregatorService classifier
            , ITextStructureNavigatorSelectorService navigator
            , IGlyphService glyphService
            )
        {
            _sourceProvider = sourceProvider;

            _buffer       = buffer;
            _classifier   = classifier.GetClassifier(buffer);
            _navigator    = navigator;
            _glyphService = glyphService;
            _defaultGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupField, StandardGlyphItem.GlyphItemPublic);
            _builtInGlyph = glyphService.GetGlyph(StandardGlyphGroup.GlyphGroupProperty, StandardGlyphItem.TotalGlyphItems);
        }
        public void Setup()
        {
            var aggregatorService = new Mock<IClassifierAggregatorService>();
            aggregatorService.Setup(a => a.GetClassifier(It.IsAny<ITextBuffer>()))
                             .Returns(new Mock<IClassifier>().Object);

            AggregatorService = aggregatorService.Object;

            provider = new PlayerTaggerProvider();

            var batch = new CompositionBatch();
            batch.AddPart(this);
            batch.AddPart(provider);

            var catalog = new AggregateCatalog();
            var container = new CompositionContainer(catalog);
            container.Compose(batch);
        }
        public IndentAutoConfigurator(IWpfTextView view, IClassifierAggregatorService classifierAggregatorService, IServiceProvider serviceProvider)
        {
            _view = view;
            _classifierAggregatorService = classifierAggregatorService;
            _serviceProvider = serviceProvider;

            //var mcs = ServiceProvider.GlobalProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
            _service = _serviceProvider.GetService(typeof(IndentAutoConfiguratorService)) as IndentAutoConfiguratorService;
            var cmd = _service.CmdIndentSetting;
            cmd.Visible = true;

            //_layer = view.GetAdornmentLayer("IndentAutoConfigurator");

            _view.GotAggregateFocus += OnGotAggregateFocus;
            _view.LostAggregateFocus += OnLostAggregateFocus;

            UpdateSetting();
        }
        public GoToDefinitionTextViewCreationListener(SVsServiceProvider serviceProvider, IVsEditorAdaptersFactoryService editorAdaptersFactoryService, ITextStructureNavigatorSelectorService textStructureNavigatorSelectorService, IClassifierAggregatorService classifierAggregatorService, MefProviderOptions mefProviderOptions)
        {
            if (serviceProvider == null)
                throw new ArgumentNullException("serviceProvider");
            if (editorAdaptersFactoryService == null)
                throw new ArgumentNullException("editorAdaptersFactoryService");
            if (textStructureNavigatorSelectorService == null)
                throw new ArgumentNullException("textStructureNavigatorSelectorService");
            if (classifierAggregatorService == null)
                throw new ArgumentNullException("classifierAggregatorService");
            if (mefProviderOptions == null)
                throw new ArgumentNullException("mefProviderOptions");

            ServiceProvider = serviceProvider;
            _editorAdaptersFactoryService = editorAdaptersFactoryService;
            TextStructureNavigatorSelectorService = textStructureNavigatorSelectorService;
            ClassifierAggregatorService = classifierAggregatorService;
            MefProviderOptions = mefProviderOptions;
        }
예제 #37
0
        public BottomMargin(IWpfTextView textView, IClassifierAggregatorService classifier, ITextDocumentFactoryService documentService)
        {
            _classifier = classifier.GetClassifier(textView.TextBuffer);

            SetResourceReference(BackgroundProperty, EnvironmentColors.ScrollBarBackgroundBrushKey);

            ClipToBounds = true;

            _labelFilePath = new InteractiveTextControl("Path");
            _labelFilePath.ValueMouseDown += OnFilePathValueMouseDown;
            _labelFilePath.SetTooltip($"Left Click to copy file path{Environment.NewLine}Right Click to show file in File Explorer");

            Children.Add(_labelFilePath);

            if (documentService.TryGetTextDocument(textView.TextDataModel.DocumentBuffer, out _doc))
            {
                _doc.FileActionOccurred += FileChangedOnDisk;
                UpdateFilePath(_doc);
            }
        }
예제 #38
0
        public AttributeScopeTagger(ITextSearchService textSearchService, ITextStructureNavigatorSelectorService textStructureNavigatorSelector, ITextBuffer buffer, SQLanguageServiceEX service, IClassificationTypeRegistryService typeService, IClassifierAggregatorService classifierAggregator)
        {
            if (_attribtag == null)
            {
                _classifierAggregator = classifierAggregator;
                var classificationType = typeService.GetClassificationType(SQAtrributeFormat);
                _attribtag = new ClassificationTag(classificationType);

                classificationType = typeService.GetClassificationType(PredefinedClassificationTypeNames.Comment);
                _commenttag        = new ClassificationTag(classificationType);

                classificationType = typeService.GetClassificationType(PredefinedClassificationTypeNames.String);
                _stringtag         = new ClassificationTag(classificationType);

                classificationType = typeService.GetClassificationType("class name");
                _classtag          = new ClassificationTag(classificationType);

                classificationType = typeService.GetClassificationType("enum name");
                _enumtag           = new ClassificationTag(classificationType);

                classificationType = typeService.GetClassificationType(PredefinedClassificationTypeNames.SymbolReference);
                _subnametag        = new ClassificationTag(classificationType);

                classificationType = typeService.GetClassificationType("number");
                _numberictag       = new ClassificationTag(classificationType);

                classificationType = typeService.GetClassificationType("keyword");
                _keywordtag        = new ClassificationTag(classificationType);
            }

            _languangeService = service;

            _textStructureNavigatorSelector = textStructureNavigatorSelector;
            _buffer            = buffer;
            _textSearchService = textSearchService;

            filepath         = SQLanguageServiceEX.GetFileName(buffer);
            _buffer.Changed -= _buffer_Changed;
            _buffer.Changed += _buffer_Changed;
            ForceNewVersion  = true;
        }
        public BottomMargin(IWpfTextView textView, IClassifierAggregatorService classifier, ITextDocumentFactoryService documentService)
        {
            OnOptionsSaved(null, MarginToggleCommand.Enabled);

            _textView   = textView;
            _classifier = classifier.GetClassifier(textView.TextBuffer);

            SetResourceReference(BackgroundProperty, EnvironmentColors.ScrollBarBackgroundBrushKey);

            ClipToBounds = true;

            _lblEncoding = new TextControl("Encoding");
            Children.Add(_lblEncoding);

            _lblContentType = new TextControl("Content type");
            Children.Add(_lblContentType);

            _lblClassification = new TextControl("Classification");
            Children.Add(_lblClassification);

            _lblSelection = new TextControl("Selection");
            Children.Add(_lblSelection);

            _lblRoles = new TextControl("Roles");
            Children.Add(_lblRoles);

            UpdateClassificationLabelAsync().FileAndForget(nameof(BottomMargin));
            UpdateContentTypeLabelAsync().FileAndForget(nameof(BottomMargin));
            UpdateContentSelectionLabelAsync().FileAndForget(nameof(BottomMargin));
            UpdateRolesLabelAsync().FileAndForget(nameof(BottomMargin));

            if (documentService.TryGetTextDocument(textView.TextDataModel.DocumentBuffer, out _doc))
            {
                _doc.FileActionOccurred += FileChangedOnDisk;
                UpdateEncodingLabelAsync(_doc).FileAndForget(nameof(BottomMargin));
            }

            textView.Caret.PositionChanged += CaretPositionChanged;
            MarginToggleCommand.Clicked    += OnOptionsSaved;
        }
예제 #40
0
 public CommentIndentationCommandTarget(IVsTextView adapter, IWpfTextView textView, IClassifierAggregatorService classifier, ICompletionBroker broker)
     : base(adapter, textView, VSConstants.VSStd2KCmdID.RETURN)
 {
     _classifier = classifier.GetClassifier(textView.TextBuffer);
     _broker     = broker;
 }
예제 #41
0
 public PackageCompletionSource(ITextBuffer textBuffer, ICompletionBroker completionBroker, IClassifierAggregatorService classifier, IPackageSearchManager searchManager)
 {
     _classifier       = classifier.GetClassifier(textBuffer);
     _searchManager    = searchManager;
     _textBuffer       = textBuffer;
     _completionBroker = completionBroker;
     textBuffer.Properties.AddProperty(typeof(PackageCompletionSource), this);
 }
 public CommentCompletionCommandTarget(IVsTextView adapter, IWpfTextView textView, IClassifierAggregatorService classifier)
     : base(adapter, textView, VSConstants.VSStd2KCmdID.TYPECHAR)
 {
     _classifier = classifier.GetClassifier(textView.TextBuffer);
 }
		SignatureHelpPresenterProvider(ITextBufferFactoryService textBufferFactoryService, IContentTypeRegistryService contentTypeRegistryService, IClassifierAggregatorService classifierAggregatorService, IClassificationFormatMapService classificationFormatMapService) {
			this.textBufferFactoryService = textBufferFactoryService;
			this.contentTypeRegistryService = contentTypeRegistryService;
			this.classifierAggregatorService = classifierAggregatorService;
			this.classificationFormatMapService = classificationFormatMapService;
		}
 public CommentCompletionCommandTarget(IVsTextView adapter, IWpfTextView textView, IClassifierAggregatorService classifier)
     : base(adapter, textView, typeof(VSConstants.VSStd2KCmdID).GUID, (uint)VSConstants.VSStd2KCmdID.TYPECHAR)
 {
     _classifier = classifier.GetClassifier(textView.TextBuffer);
 }
예제 #45
0
 public FontQuickInfo(QuickInfoSourceProvider provider, ITextBuffer subjectBuffer, IClassifierAggregatorService classifierService)
 {
     _provider = provider;
     _buffer = subjectBuffer;
     _classifierService = classifierService;
 }
 public CommentIndentationCommandTarget(IVsTextView adapter, IWpfTextView textView, IClassifierAggregatorService classifier, ICompletionBroker broker)
     : base(adapter, textView, typeof(VSConstants.VSStd2KCmdID).GUID, (uint)VSConstants.VSStd2KCmdID.RETURN)
 {
     _classifier = classifier.GetClassifier(textView.TextBuffer);
     _broker = broker;
 }