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); }
public int FDoIdle(uint grfidlef) { bool periodic = ((grfidlef & (uint)_OLEIDLEF.oleidlefPeriodic) != 0); SQLanguageService svc = (SQLanguageService)GetService(typeof(SQLanguageService)); if (svc != null) { svc.OnIdle(periodic); } /*if (null != libraryManager) * { * libraryManager.OnIdle(); * }*/ return(0); }
/// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initialization code that rely on services provided by VisualStudio. /// </summary> protected override void Initialize() { //ViewFilter base.Initialize(); this.RegisterProjectFactory(new SQVSProjectFactory(this)); ServiceCreatorCallback callback = new ServiceCreatorCallback(CreateService); ((IServiceContainer)this).AddService(typeof(ISQLanguageService), callback, true); //((IServiceContainer)this).AddService(typeof(ISquirrelLibraryManager), callback, true); InitializeGrammarBuilder(); _service = new SQLanguageService(this); _service.SetSite(this); RegisterForIdleTime(); IServiceContainer serviceContainer = (IServiceContainer)this; serviceContainer.AddService(typeof(SQLanguageService), _service, true); //ReloadSetting(); _service.ReloadSettings(); }
public AttributeScopeTagger(ITextSearchService textSearchService, ITextStructureNavigatorSelectorService textStructureNavigatorSelector, ITextBuffer buffer, SQLanguageService 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 = SQLanguageService.GetFileName(buffer); _buffer.Changed -= _buffer_Changed; _buffer.Changed += _buffer_Changed; }
public AttributeScopeTagger(ITextSearchService textSearchService, ITextStructureNavigatorSelectorService textStructureNavigatorSelector, 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); classificationType = typeService.GetClassificationType("keyword"); _keywordtag = new ClassificationTag(classificationType); _sqTypes = new Dictionary <string, SQTokenTypes>(); _sqTypes["function"] = SQTokenTypes.ReservedWords; _sqTypes["return"] = SQTokenTypes.ReservedWords; _sqTypes["extends"] = SQTokenTypes.ReservedWords; _sqTypes["require"] = SQTokenTypes.ReservedWords; _sqTypes["constructor"] = SQTokenTypes.ReservedWords; _sqTypes["local"] = SQTokenTypes.ReservedWords; _sqTypes["base"] = SQTokenTypes.ReservedWords; _sqTypes["bindenv"] = SQTokenTypes.ReservedWords; _sqTypes["weakref"] = SQTokenTypes.ReservedWords; _sqTypes["null"] = SQTokenTypes.ReservedWords; _sqTypes["class"] = SQTokenTypes.ReservedWords; _sqTypes["if"] = SQTokenTypes.ReservedWords; _sqTypes["else"] = SQTokenTypes.ReservedWords; _sqTypes["while"] = SQTokenTypes.ReservedWords; _sqTypes["do"] = SQTokenTypes.ReservedWords; _sqTypes["switch"] = SQTokenTypes.ReservedWords; _sqTypes["case"] = SQTokenTypes.ReservedWords; _sqTypes["default"] = SQTokenTypes.ReservedWords; _sqTypes["delete"] = SQTokenTypes.ReservedWords; _sqTypes["break;"] = SQTokenTypes.ReservedWords; _sqTypes["assert"] = SQTokenTypes.ReservedWords; _sqTypes["for"] = SQTokenTypes.ReservedWords; _sqTypes["this"] = SQTokenTypes.ReservedWords; _sqTypes["in"] = SQTokenTypes.ReservedWords; _sqTypes["foreach"] = SQTokenTypes.ReservedWords; _sqTypes["clone"] = SQTokenTypes.ReservedWords; _sqTypes["true"] = SQTokenTypes.ReservedWords; _sqTypes["false"] = SQTokenTypes.ReservedWords; _sqTypes["try"] = SQTokenTypes.ReservedWords; _sqTypes["catch"] = SQTokenTypes.ReservedWords; _sqTypes["enum"] = SQTokenTypes.ReservedWords; _sqTypes["const"] = SQTokenTypes.ReservedWords; _sqTypes["print"] = SQTokenTypes.ReservedWords; _sqTypes["yield"] = SQTokenTypes.ReservedWords; _sqTypes["continue"] = SQTokenTypes.ReservedWords; _sqTypes["resume"] = SQTokenTypes.ReservedWords; _sqTypes["throw"] = SQTokenTypes.ReservedWords; _sqTypes["static"] = SQTokenTypes.ReservedWords; _sqTypes["instanceof"] = SQTokenTypes.ReservedWords; _sqTypes["typeof"] = SQTokenTypes.ReservedWords; _sqTypes["@"] = SQTokenTypes.ReservedWords; _languangeService = service; _textStructureNavigatorSelector = textStructureNavigatorSelector; _buffer = buffer; _textSearchService = textSearchService; //this.snapshot = buffer.CurrentSnapshot; filepath = SQLanguageService.GetFileName(buffer); }