protected override void CommitHighlighters(DaemonCommitContext context) { var instance = HighlightingSettingsManager.Instance; foreach (var highlightingInfo in context.HighlightingsToAdd) { var severity = instance.GetSeverity(highlightingInfo.Highlighting, SourceFile, Solution, ContextBoundSettingsStore); if (OldMsBuildWorkarounds.RangeContains(highlightingInfo.Range, myCaretRange) && severity == Severity.INFO) { if (highlightingInfo.Highlighting is CSharpIdentifierHighlighting) { HighlightingInfo = highlightingInfo; } break; } } }
public override ISpecificCodeCompletionContext GetCompletionContext(CodeCompletionContext context) { if (!(context.File is IShaderLabFile file)) { return(null); } if (context.CodeCompletionType == CodeCompletionType.BasicCompletion && !IsIntellisenseEnabled(context)) { return(null); } var unterminatedContext = new ShaderLabReparsedCompletionContext(file, context.SelectedTreeRange, "aa"); unterminatedContext.Init(); var referenceToComplete = unterminatedContext.Reference; var elementToComplete = unterminatedContext.TreeNode; if (elementToComplete == null) { return(null); } var referenceRange = referenceToComplete?.GetTreeTextRange() ?? GetElementRange(elementToComplete); var referenceDocumentRange = unterminatedContext.ToDocumentRange(referenceRange); if (!referenceDocumentRange.IsValid()) { return(null); } if (!OldMsBuildWorkarounds.RangeContains(referenceDocumentRange, context.EffectiveCaretDocumentOffset)) { return(null); } var ranges = GetTextLookupRanges(context, referenceDocumentRange); return(new ShaderLabCodeCompletionContext(context, unterminatedContext, ranges)); }
private void RemoveFromTextualOccurrences(IRenameRefactoring executer, IFieldDeclaration fieldDeclaration) { if (!(executer.Workflow is RenameWorkflow workflow)) { return; } var attributes = fieldDeclaration.Attributes; if (attributes.Count == 0) { return; } var attribute = attributes[0]; var attributeSectionList = AttributeSectionListNavigator.GetByAttribute(attribute); if (attributeSectionList == null) { return; } var attributesRange = attributeSectionList.GetDocumentRange(); foreach (var occurrence in workflow.DataModel.ActualOccurrences ?? EmptyList <TextOccurrenceRenameMarker> .InstanceList) { if (!occurrence.Included) { continue; } var occurrenceRange = occurrence.Marker.DocumentRange; if (OldMsBuildWorkarounds.RangeContains(attributesRange, occurrenceRange)) { occurrence.Included = false; break; } } }
private static void RemoveFromTextualOccurrences(IRenameRefactoring executer, DocumentRange handledRange) { if (!(executer.Workflow is RenameWorkflow workflow)) { return; } foreach (var occurrence in workflow.DataModel.ActualOccurrences ?? EmptyList <TextOccurrenceRenameMarker> .InstanceList) { if (!occurrence.Included) { continue; } var occurrenceRange = occurrence.Marker.DocumentRange; if (OldMsBuildWorkarounds.RangeContains(handledRange, occurrenceRange)) { occurrence.Included = false; break; } } }