├── .cr └── personal │ └── FavoritesList │ └── List.xml ├── .editorconfig ├── .github └── workflows │ └── devskim.yml ├── .gitignore ├── .nuke ├── build.schema.json └── parameters.json ├── CHANGELOG.md ├── GammaJul.ReSharper.EnhancedTooltip.sln ├── GammaJul.ReSharper.EnhancedTooltip.sln.DotSettings ├── LICENSE ├── README.md ├── SECURITY.md ├── TestCode ├── Class1.cs └── TestCode.csproj ├── build.cmd ├── build.ps1 ├── build.sh ├── build ├── Build.cs └── _build.csproj ├── global.json ├── images ├── Logo.ai ├── Logo128.png ├── Logo16.png ├── Logo32.png ├── Logo64.png ├── Options.png ├── ParameterInfo.png └── Tooltip.png ├── nuget.config └── source └── GammaJul.ReSharper.EnhancedTooltip ├── DocumentMarkup ├── IdentifierTooltipContentProvider.cs ├── ReflectionCppTooltipContentProvider.cs ├── SeverityExtensions.cs └── TextStyleHighlighterManager.cs ├── ExternalHighlightings ├── ExceptionalExtensionHighlighting.cs └── IExternalHighlighting.cs ├── GammaJul.ReSharper.EnhancedTooltip.csproj ├── GammaJul.ReSharper.EnhancedTooltip.csproj.DotSettings ├── GammaJul.ReSharper.EnhancedTooltip.csproj.user-template ├── GammaJul.ReSharper.EnhancedTooltip.nuspec ├── GenericImages ├── ThemedIcons.Generic.Generated.Xaml └── ThemedIcons.cs ├── ParameterInfo ├── EnhancedCandidate.cs ├── EnhancedContext.cs ├── EnhancedParameterInfoCandidate.cs ├── EnhancedParameterInfoContext.cs ├── EnhancedParameterInfoContextFactory.cs ├── EnhancedTypeArgumentCandidate.cs ├── EnhancedTypeArgumentContext.cs └── EnhancedTypeArgumentContextFactory.cs ├── Presentation ├── AnnotationsDisplayKindExtensions.cs ├── ArgumentRoleTooltipContent.cs ├── AttributeTargetsExtension.cs ├── AttributeUsageContent.cs ├── AutoContrastedRichTextPresenter.cs ├── CSharpColorizer.cs ├── CSharpColorizerExtensions.cs ├── CSharpPresentableNodeFinder.cs ├── ColorizerExtensions.cs ├── ColorizerPresenter.cs ├── DashedSeparator.cs ├── DescriptionSeparatorWidthConverter.cs ├── ElementKindDisplay.cs ├── ElementTypeDisplay.cs ├── ExceptionContent.cs ├── FontSizeScaleConverter.cs ├── HighlighterIdProvider.cs ├── HighlighterIdProviderFactory.cs ├── HighlighterIdSource.cs ├── Highlightings │ ├── CSharp │ │ ├── AbstractAccessorIsNotImplementedErrorEnhancer.cs │ │ ├── AbstractBaseMemberCallErrorEnhancer.cs │ │ ├── AbstractInheritedMemberIsNotImplementedErrorEnhancer.cs │ │ ├── AccessRightsErrorEnhancer.cs │ │ ├── AccessRightsForBothAccessorsErrorEnhancer.cs │ │ ├── AccessRightsInTextWarningEnhancer.cs │ │ ├── AccessorAccessRightsShouldBeMoreRestrictiveErrorEnhancer.cs │ │ ├── AccessorIsMissingInImplementationErrorEnhancer.cs │ │ ├── AddedAccessorInPrivateImplementationErrorEnhancer.cs │ │ ├── AddressOfManagedTypeErrorEnhancer.cs │ │ ├── AddressOfMarshalByRefObjectWarningEnhancer.cs │ │ ├── AllIndexersMustHaveSameNameErrorEnhancer.cs │ │ ├── AnnotateCanBeNullParameterWarningEnhancer.cs │ │ ├── AnnotateCanBeNullTypeMemberWarningEnhancer.cs │ │ ├── AnnotateNotNullParameterWarningEnhancer.cs │ │ ├── AnnotateNotNullTypeMemberWarningEnhancer.cs │ │ ├── AnnotationRedundancyAtValueTypeWarningEnhancer.cs │ │ ├── AnonymousMethodParameterParamsErrorEnhancer.cs │ │ ├── AnonymousTypePropertyCannotBeVoidErrorEnhancer.cs │ │ ├── ArglistIteratorParameterErrorEnhancer.cs │ │ ├── ArglistParameterInAsyncErrorEnhancer.cs │ │ ├── ArglistParameterInDelegateErrorEnhancer.cs │ │ ├── ArrayElementIsStaticClassErrorEnhancer.cs │ │ ├── ArrayElementTypeIsForbiddenErrorEnhancer.cs │ │ ├── AsOperatorWithUnconstrainedTypeParameterErrorEnhancer.cs │ │ ├── AsOperatorWithValueTypeErrorEnhancer.cs │ │ ├── AssignNullToNotNullAttributeWarningEnhancer.cs │ │ ├── AssignNullToTypeParameterWithoutClassConstraintErrorEnhancer.cs │ │ ├── AssignVoidToRangeVariableErrorEnhancer.cs │ │ ├── AsyncMethodInvocationWithoutAwaitWarningEnhancer.cs │ │ ├── AsyncMethodWithoutAwait2WarningEnhancer.cs │ │ ├── AsyncMethodWithoutAwaitWarningEnhancer.cs │ │ ├── AsyncMethodWithoutBodyErrorEnhancer.cs │ │ ├── AsyncModifierIsNotValidOnThisItemErrorEnhancer.cs │ │ ├── AtLeastOneParameterOfSignOperatorMustBeContainingTypeErrorEnhancer.cs │ │ ├── AttributeCannotHaveTypeParametersErrorEnhancer.cs │ │ ├── AttributeNameExpectedErrorEnhancer.cs │ │ ├── AwaitIdentifierInAsyncMethodErrorEnhancer.cs │ │ ├── AwaitNotUnderAsyncMethodErrorEnhancer.cs │ │ ├── BaseMemberHasParamsWarningEnhancer.cs │ │ ├── BaseObjectEqualsIsObjectEqualsWarningEnhancer.cs │ │ ├── BaseObjectGetHashCodeCallInGetHashCodeWarningEnhancer.cs │ │ ├── BitwiseOperatorOnEnumWithoutFlagsWarningEnhancer.cs │ │ ├── CSharpHighlightingEnhancer.cs │ │ ├── CannotAccessExplicitImplementationErrorEnhancer.cs │ │ ├── CannotApplyBinaryOperatorErrorEnhancer.cs │ │ ├── CannotApplyBinaryOperatorMultipleCandidatesErrorEnhancer.cs │ │ ├── CannotApplyEqualityOperatorToTypeWarningEnhancer.cs │ │ ├── CannotApplyUnaryOperatorErrorEnhancer.cs │ │ ├── CannotApplyUnaryOperatorMultipleCandidatesErrorEnhancer.cs │ │ ├── CannotAwaitInCatchOrFinallyErrorEnhancer.cs │ │ ├── CannotAwaitInExceptionFilterExpressionErrorEnhancer.cs │ │ ├── CannotAwaitInLockStatementErrorEnhancer.cs │ │ ├── CannotAwaitInUnsafeContextErrorEnhancer.cs │ │ ├── CannotAwaitUnderQueryExpressionErrorEnhancer.cs │ │ ├── CannotChangeReturnTypeInOverrideErrorEnhancer.cs │ │ ├── CannotConstructVoidErrorEnhancer.cs │ │ ├── CannotCreateInstanceOfAbstractClassErrorEnhancer.cs │ │ ├── CannotCreateInstanceOfInterfaceErrorEnhancer.cs │ │ ├── CannotCreateInstanceOfTypeParameterWithArgumentsErrorEnhancer.cs │ │ ├── CannotCreateInstanceOfTypeParameterWithoutNewConstraintErrorEnhancer.cs │ │ ├── CannotCreateInstanceOfTypeWithoutConstructorErrorEnhancer.cs │ │ ├── CannotDetermineTernaryExpressionType2ErrorEnhancer.cs │ │ ├── CannotDetermineTernaryExpressionTypeErrorEnhancer.cs │ │ ├── CannotHaveEventAccessorsInAbstractEventErrorEnhancer.cs │ │ ├── CannotHaveEventAccessorsInInterfacesErrorEnhancer.cs │ │ ├── CannotImplementDynamicInterfaceErrorEnhancer.cs │ │ ├── CannotImplicitlyConvertGotoCaseValueToGoverningTypeWarningEnhancer.cs │ │ ├── CannotImplicitlyConvertTypeErrorEnhancer.cs │ │ ├── CannotInheritFromSealedTypeErrorEnhancer.cs │ │ ├── CannotInheritFromSpecialTypeErrorEnhancer.cs │ │ ├── CannotInstantiateDynamicTypeErrorEnhancer.cs │ │ ├── CannotOverrideNonExistingAccessorErrorEnhancer.cs │ │ ├── CannotSpecifyConstructorConstraintForValueTypeErrorEnhancer.cs │ │ ├── CannotUseConstructorWithoutBracketsErrorEnhancer.cs │ │ ├── CannotUseDefaultMemberAttributeOnTypeWithIndexerErrorEnhancer.cs │ │ ├── CannotUseInvocableErrorEnhancer.cs │ │ ├── CannotUseThisBaseInInitializerErrorEnhancer.cs │ │ ├── CannotUseThisBaseInStaticContextErrorEnhancer.cs │ │ ├── CannotUseThisInClosureInStructErrorEnhancer.cs │ │ ├── CannotUseTypeArgumentWithElementErrorEnhancer.cs │ │ ├── CatchClauseCannotFollowGeneralCatchClauseErrorEnhancer.cs │ │ ├── CatchDoesNotExtendExceptionErrorEnhancer.cs │ │ ├── CircularDependencyInTypeParameterConstraintErrorEnhancer.cs │ │ ├── CircularTypeDependencyErrorEnhancer.cs │ │ ├── ClassIsAbstractAndSealedErrorEnhancer.cs │ │ ├── ClassTypeConstraintMustBeFirstErrorEnhancer.cs │ │ ├── ClassTypeParameterInValueTypeParameterConstraintListErrorEnhancer.cs │ │ ├── CoVariantArrayConversionWarningEnhancer.cs │ │ ├── CollectionInitializerAppliedToNonCollectionErrorEnhancer.cs │ │ ├── CompareNonConstrainedGenericWithNullWarningEnhancer.cs │ │ ├── ConditionIsAlwaysTrueOrFalseWarningEnhancer.cs │ │ ├── ConditionalAccessAlwaysNotNullWarningEnhancer.cs │ │ ├── ConditionalAccessAlwaysNullWarningEnhancer.cs │ │ ├── ConditionalLogicOperatorTypesMismatchErrorEnhancer.cs │ │ ├── ConditionalLogicTrueFalseOperatorMissingErrorEnhancer.cs │ │ ├── ConflictInheritedClassTypeParameterConstraintErrorEnhancer.cs │ │ ├── ConflictInheritedTypeParameterConstraintErrorEnhancer.cs │ │ ├── ConflictInheritedValueTypeParameterConstraintErrorEnhancer.cs │ │ ├── ConflictSuperClassesInTypeParameterConstraintErrorEnhancer.cs │ │ ├── ConstraintCannotBeDynamicTypeErrorEnhancer.cs │ │ ├── ConstructorConstraintShouldBeLastErrorEnhancer.cs │ │ ├── ConstructorInitializerMissingErrorEnhancer.cs │ │ ├── ContextValueIsProvidedWarningEnhancer.cs │ │ ├── ConversionFromObjectErrorEnhancer.cs │ │ ├── ConversionToObjectErrorEnhancer.cs │ │ ├── ConvertIfDoToWhileWarningEnhancer.cs │ │ ├── ConvertIfStatementToConditionalTernaryExpressionWarningEnhancer.cs │ │ ├── ConvertIfStatementToMethodCallWarningEnhancer.cs │ │ ├── ConvertIfStatementToMethodCallWithAssignmentWarningEnhancer.cs │ │ ├── ConvertIfStatementToNullCoalescingExpression1WarningEnhancer.cs │ │ ├── ConvertIfStatementToNullCoalescingExpression2WarningEnhancer.cs │ │ ├── ConvertIfStatementToNullCoalescingExpression3WarningEnhancer.cs │ │ ├── ConvertIfStatementToNullCoalescingInMethodCallWarningEnhancer.cs │ │ ├── ConvertIfStatementToNullCoalescingInMethodCallWithAssignmentWarningEnhancer.cs │ │ ├── ConvertIfStatementToReturnConditionalWarningEnhancer.cs │ │ ├── ConvertIfStatementToReturnMethodCallWithConditionalWarningEnhancer.cs │ │ ├── ConvertIfStatementToReturnMethodCallWithNullCoalescingWarningEnhancer.cs │ │ ├── ConvertIfStatementToReturnNullCoalescingWarningEnhancer.cs │ │ ├── ConvertIfStatementToSwitchStatementWarningEnhancer.cs │ │ ├── ConvertIfToOrExpressionWarningEnhancer.cs │ │ ├── ConvertNullableToShortFormWarningEnhancer.cs │ │ ├── ConvertToStaticClassWarningEnhancer.cs │ │ ├── CycleInStructLayoutErrorEnhancer.cs │ │ ├── ExceptionNotDocumentedHighlightingEnhancer.cs │ │ ├── ExceptionNotDocumentedOptionalHighlightingEnhancer.cs │ │ ├── IncorrectArgumentKindErrorEnhancer.cs │ │ ├── IncorrectArgumentTypeErrorEnhancer.cs │ │ ├── IncorrectArgumentsErrorEnhancer.cs │ │ ├── IncorrectArrayElementTypeErrorEnhancer.cs │ │ ├── IncorrectAssignmentTypeErrorEnhancer.cs │ │ ├── IncorrectCompoundAssignmentTypeErrorEnhancer.cs │ │ ├── IncorrectExtensionMethodArgumentType2ErrorEnhancer.cs │ │ ├── IncorrectExtensionMethodArgumentTypeErrorEnhancer.cs │ │ ├── IncorrectForeachVariableTypeErrorEnhancer.cs │ │ ├── IncorrectInitializerTypeErrorEnhancer.cs │ │ ├── IncorrectIteratorReturnTypeErrorEnhancer.cs │ │ ├── IncorrectLambdaBodyExpressionTypeError.cs │ │ ├── IncorrectPropertyAccessorNameErrorEnhancer.cs │ │ ├── IncorrectReturnTypeErrorEnhancer.cs │ │ ├── IncorrectSignatureInDelegateCreationErrorEnhancer.cs │ │ ├── IncorrectTrueOrFalseOperatorTypeErrorEnhancer.cs │ │ ├── IncorrectYieldReturnTypeErrorEnhancer.cs │ │ ├── NullReferenceArgumentWarningEnhancer.cs │ │ ├── PossibleNullReferenceExceptionWarningEnhancer.cs │ │ ├── ReturnTypeIsVoidErrorEnhancer.cs │ │ ├── RoslynDiagnosticHighlightingEnhancer.cs │ │ └── UnusedMemberLocalWarningEnhancer.cs │ ├── HighlightingEnhancerManager.cs │ └── IHighlightingEnhancer.cs ├── IColorizer.cs ├── IPresentableNodeFinder.cs ├── IReSharperTooltipContent.cs ├── IconScaling.cs ├── IdentifierContentGroup.cs ├── IdentifierPresenter.cs ├── IdentifierTooltipContent.cs ├── IssueTooltipContent.cs ├── MiscTooltipContent.cs ├── NonCSharpTooltipContent.cs ├── ParamContent.cs ├── PresentableNode.cs ├── PresentedInfo.cs ├── PresenterOptions.cs ├── QualifierDisplays.cs ├── StringToWrappedTextBlockConverter.cs ├── Styling.cs ├── TooltipContent.cs ├── UIResources.cs ├── UIResources.xaml ├── VsIdentifierContent.cs └── VsSquiggleContent.cs ├── Properties ├── AssemblyInfo.cs ├── Settings.Designer.cs ├── Settings.settings └── launchSettings.json ├── Psi ├── CSharpInvocationCandidateCountProvider.cs ├── DeclaredElementExtensions.cs ├── ExpressionTypeExtensions.cs ├── IInvocationCandidateCountProvider.cs └── TypeElementExtensions.cs ├── Settings ├── AnnotationsDisplayKindMigration.cs ├── AttributesDisplayKind.cs ├── AttributesFormattingMode.cs ├── BaseTypeAndImplementedInterfacesDisplayMigration.cs ├── BaseTypeDisplayKind.cs ├── ConstructorReferenceDisplay.cs ├── DisplaySettings.cs ├── EnhancedTooltipOptionsPage.xaml ├── EnhancedTooltipOptionsPage.xaml.cs ├── EnhancedTooltipSettingsRoot.cs ├── EnumValue.cs ├── ExternalCodeNamespaceDisplayKind.cs ├── IdentifierTooltipSettings.cs ├── ImplementedInterfacesDisplayKind.cs ├── IssueTooltipSettings.cs ├── ParameterInfoSettings.cs ├── ParametersFormattingMode.cs ├── SettingsExtensions.cs ├── SolutionCodeNamespaceDisplayKind.cs └── TooltipColorSource.cs ├── Utils └── Utils.cs ├── VisualStudio ├── MainQuickInfoSource.cs ├── MainQuickInfoSourceProvider.cs ├── MultipleTooltipContentPresenter.cs ├── QuickInfoSessionExtensions.cs ├── QuickInfoSourceBase.cs ├── QuickInfoSourceProviderBase.cs ├── QuickInfoSourceProviderNames.cs ├── SpanExtensions.cs ├── TooltipFormattingProvider.cs ├── VsFullTypeNames.cs ├── VsSquiggleCollectorQuickInfoSource.cs ├── VsSquiggleCollectorQuickInfoSourceProvider.cs └── XmlDocRichTextPresenterEx.cs └── ZoneMarker.cs /.cr/personal/FavoritesList/List.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = crlf 5 | charset = utf-8 6 | 7 | # ReSharper properties 8 | resharper_csharp_indent_size = 2 9 | resharper_csharp_indent_style = space 10 | resharper_csharp_tab_width = 2 11 | 12 | [*.cs] 13 | indent_style = space 14 | indent_size = 2 15 | tab_width = 2 16 | 17 | [*.csproj] 18 | indent_style = tab 19 | indent_size = 2 20 | 21 | [*.targets] 22 | indent_style = tab 23 | indent_size = 2 24 | 25 | [*.xaml] 26 | indent_style = tab 27 | indent_size = 2 28 | 29 | [*.nuspec] 30 | indent_style = tab 31 | indent_size = 2 32 | -------------------------------------------------------------------------------- /.github/workflows/devskim.yml: -------------------------------------------------------------------------------- 1 | # This workflow uses actions that are not certified by GitHub. 2 | # They are provided by a third-party and are governed by 3 | # separate terms of service, privacy policy, and support 4 | # documentation. 5 | 6 | name: DevSkim 7 | 8 | on: 9 | push: 10 | branches: [ "master" ] 11 | pull_request: 12 | branches: [ "master" ] 13 | schedule: 14 | - cron: '41 9 * * 3' 15 | 16 | jobs: 17 | lint: 18 | name: DevSkim 19 | runs-on: ubuntu-20.04 20 | permissions: 21 | actions: read 22 | contents: read 23 | security-events: write 24 | steps: 25 | - name: Checkout code 26 | uses: actions/checkout@v3 27 | 28 | - name: Run DevSkim scanner 29 | uses: microsoft/DevSkim-Action@v1 30 | 31 | - name: Upload DevSkim scan results to GitHub Security tab 32 | uses: github/codeql-action/upload-sarif@v2 33 | with: 34 | sarif_file: devskim-results.sarif 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.suo 2 | *.user 3 | .vs 4 | .idea 5 | temp 6 | bin 7 | obj 8 | /output 9 | /_ReSharper.Caches 10 | -------------------------------------------------------------------------------- /.nuke/parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./build.schema.json", 3 | "Solution": "GammaJul.ReSharper.EnhancedTooltip.sln" 4 | } -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | 5.1.x | :white_check_mark: | 11 | | 5.0.x | :x: | 12 | | 4.0.x | :white_check_mark: | 13 | | < 4.0 | :x: | 14 | 15 | ## Reporting a Vulnerability 16 | 17 | Use this section to tell people how to report a vulnerability. 18 | 19 | Tell them where to go, how often they can expect to get an update on a 20 | reported vulnerability, what to expect if the vulnerability is accepted or 21 | declined, etc. 22 | -------------------------------------------------------------------------------- /TestCode/Class1.cs: -------------------------------------------------------------------------------- 1 | namespace TestCode; 2 | 3 | public class Class1 { 4 | 5 | } 6 | 7 | public struct Struct1 { 8 | 9 | } 10 | 11 | public record Record1 { 12 | 13 | } 14 | 15 | public record struct RecordStruct1 { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /TestCode/TestCode.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /build.cmd: -------------------------------------------------------------------------------- 1 | :; set -eo pipefail 2 | :; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) 3 | :; ${SCRIPT_DIR}/build.sh "$@" 4 | :; exit $? 5 | 6 | @ECHO OFF 7 | powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %* 8 | -------------------------------------------------------------------------------- /build/_build.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | false 7 | 8 | False 9 | enable 10 | 1 11 | 12 | 13 | 14 | 15 | all 16 | runtime; build; native; contentfiles; analyzers; buildtransitive 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "6.0.0", 4 | "rollForward": "latestMinor", 5 | "allowPrerelease": false 6 | } 7 | } -------------------------------------------------------------------------------- /images/Logo.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrJul/ReSharper.EnhancedTooltip/3d341f7bc99bc773677bdfddaf82833022fca691/images/Logo.ai -------------------------------------------------------------------------------- /images/Logo128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrJul/ReSharper.EnhancedTooltip/3d341f7bc99bc773677bdfddaf82833022fca691/images/Logo128.png -------------------------------------------------------------------------------- /images/Logo16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrJul/ReSharper.EnhancedTooltip/3d341f7bc99bc773677bdfddaf82833022fca691/images/Logo16.png -------------------------------------------------------------------------------- /images/Logo32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrJul/ReSharper.EnhancedTooltip/3d341f7bc99bc773677bdfddaf82833022fca691/images/Logo32.png -------------------------------------------------------------------------------- /images/Logo64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrJul/ReSharper.EnhancedTooltip/3d341f7bc99bc773677bdfddaf82833022fca691/images/Logo64.png -------------------------------------------------------------------------------- /images/Options.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrJul/ReSharper.EnhancedTooltip/3d341f7bc99bc773677bdfddaf82833022fca691/images/Options.png -------------------------------------------------------------------------------- /images/ParameterInfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrJul/ReSharper.EnhancedTooltip/3d341f7bc99bc773677bdfddaf82833022fca691/images/ParameterInfo.png -------------------------------------------------------------------------------- /images/Tooltip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MrJul/ReSharper.EnhancedTooltip/3d341f7bc99bc773677bdfddaf82833022fca691/images/Tooltip.png -------------------------------------------------------------------------------- /nuget.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/DocumentMarkup/SeverityExtensions.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Annotations; 2 | using JetBrains.ReSharper.Daemon.SolutionAnalysis.Resources; 3 | using JetBrains.ReSharper.Feature.Services.Daemon; 4 | using JetBrains.UI.Icons; 5 | 6 | namespace GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup { 7 | 8 | public static class SeverityExtensions { 9 | 10 | [Pure] 11 | public static bool IsIssue(this Severity severity) { 12 | return severity switch { 13 | Severity.HINT or Severity.SUGGESTION or Severity.WARNING or Severity.ERROR => true, 14 | _ => false 15 | }; 16 | } 17 | 18 | [Pure] 19 | public static IconId? TryGetIcon(this Severity severity) { 20 | return severity switch { 21 | Severity.HINT => SolutionAnalysisThemedIcons.SolutionAnalysisHint.Id, 22 | Severity.SUGGESTION => SolutionAnalysisThemedIcons.SolutionAnalysisSuggestion.Id, 23 | Severity.WARNING => SolutionAnalysisThemedIcons.SolutionAnalysisWarning.Id, 24 | Severity.ERROR => SolutionAnalysisThemedIcons.SolutionAnalysisError.Id, 25 | _ => null 26 | }; 27 | } 28 | 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/ExternalHighlightings/ExceptionalExtensionHighlighting.cs: -------------------------------------------------------------------------------- 1 |  2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.ExceptionalHighlightings { 4 | 5 | using GammaJul.ReSharper.EnhancedTooltip.ExternalHighlightings; 6 | 7 | public interface IExceptionNotDocumentedHighlighting : IExternalHighlighting { } 8 | public interface IExceptionNotDocumentedOptionalHighlighting : IExternalHighlighting { } 9 | } 10 | -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/ExternalHighlightings/IExternalHighlighting.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.ReSharper.Feature.Services.Daemon; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.ExternalHighlightings { 4 | public interface IExternalHighlighting : IHighlighting { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/GammaJul.ReSharper.EnhancedTooltip.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | True -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/GammaJul.ReSharper.EnhancedTooltip.csproj.user-template: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ProjectFiles 5 | 6 | 7 | 8 | 9 | 16_5c6794dd 10 | RsDev 11 | _000 12 | 13 | 14 | $(LOCALAPPDATA)\JetBrains\Installations\ReSharperPlatformVs$(RsPluginVsVersion)$(RsPluginVsHive)$(RsPluginRsInstallSuffix) 15 | $(PROGRAMFILES)\Microsoft Visual Studio\2019\Professional\Common7\IDE\devenv.exe 16 | $(RsPluginVsExePath) 17 | /RootSuffix $(RsPluginVsHive) /ReSharper.Internal 18 | false 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/GammaJul.ReSharper.EnhancedTooltip.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JLebosquain.EnhancedTooltip 6 | $version$ 7 | Enhanced Tooltip 8 | Julien Lebosquain 9 | Colorizes the tooltip as well as the parameter information popup. 10 | $releasenotes$ 11 | https://github.com/MrJul/ReSharper.EnhancedTooltip/ 12 | https://raw.github.com/MrJul/ReSharper.EnhancedTooltip/master/images/Logo128.png 13 | http://www.apache.org/licenses/LICENSE-2.0 14 | Copyright © 2013-$currentyear$ Julien Lebosquain 15 | Tooltip Syntax Color Parameter 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/GenericImages/ThemedIcons.Generic.Generated.Xaml: -------------------------------------------------------------------------------- 1 |  3 | 4 | 5 | 6 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAk1BMVEX////r3OX37/P////z6vD27fL/////+vX/+/j38PT06/D+8+f/////////+vTv4un////z6vD//v3+7dr59fjx5uz48vX+8OD///+gMm3zkhemQHXMm7PkzdrAgaG1Z47YtMfGjar69vj+8eLr2uT8z5rauMv48/b+5cv02Mj0mSy6dJf3qEuwWoX8y5Tw1MfSp72q531GAAAAGHRSTlMA/OJAsuUw/KZ5av0QILrOUPvi/P3J8MaI1SH5AAAAhUlEQVR4Xo3MRw4CMRBE0bJNzpkOtoec0/1PhzxBCIkFf/nUXfhVu05VkwbQs+bKzAcSkVuzBdgVp2KCy3SAjmHWVwi0FTl1ycFG1mN6f4iQ6wOkrFm2LgAAiPPCpoDqYvW5GEbWXdrYlzAaK3P0PpxLQM1oGvHPBIXM/P0L4OYLylvin96p8xCpsjAcNwAAAABJRU5ErkJggg== 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/GenericImages/ThemedIcons.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Markup; 2 | using GammaJul.ReSharper.EnhancedTooltip; 3 | using JetBrains.Annotations; 4 | using JetBrains.UI.Icons; 5 | using JetBrains.UI.Icons.CompiledIcons; 6 | 7 | [assembly: XmlnsDefinition("urn:shemas-jetbrains-com:ui-application-icons-generic", "GammaJul.ReSharper.EnhancedTooltip")] 8 | [assembly: CompiledIconsPack( 9 | IconPackResourceIdentification = ThemedIcons.IconPackResourceName, 10 | IconNames = new[] { "Logo16" })] 11 | 12 | namespace GammaJul.ReSharper.EnhancedTooltip { 13 | 14 | [UsedImplicitly] 15 | public sealed class ThemedIcons { 16 | 17 | internal const string IconPackResourceName = "GammaJul.ReSharper.EnhancedTooltip;component/GenericImages/ThemedIcons.Generic.Generated.Xaml"; 18 | 19 | [CompiledIconClass(IconPackResourceName, 0, "Logo16")] 20 | public sealed class Logo16 : CompiledIconClass { 21 | 22 | [UsedImplicitly] public static IconId Id = new CompiledIconId(IconPackResourceName, 0, "Logo16"); 23 | 24 | } 25 | 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/ParameterInfo/EnhancedParameterInfoContext.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.Presentation; 2 | using JetBrains.Application.Settings; 3 | using JetBrains.ReSharper.Feature.Services.ParameterInfo; 4 | 5 | namespace GammaJul.ReSharper.EnhancedTooltip.ParameterInfo { 6 | 7 | /// 8 | /// Part of the override chain needed to replace a parameter info. 9 | /// for more information. 10 | /// 11 | public class EnhancedParameterInfoContext : EnhancedContext { 12 | 13 | private readonly IContextBoundSettingsStore _settings; 14 | private readonly HighlighterIdProviderFactory _highlighterIdProviderFactory; 15 | private readonly ColorizerPresenter _colorizerPresenter; 16 | 17 | protected override EnhancedCandidate Enhance(ParameterInfoCandidate candidate) 18 | => new EnhancedParameterInfoCandidate(candidate, _settings, _highlighterIdProviderFactory, _colorizerPresenter); 19 | 20 | public EnhancedParameterInfoContext( 21 | IParameterInfoContext context, 22 | IContextBoundSettingsStore settings, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory, 24 | ColorizerPresenter colorizerPresenter) 25 | : base(context) { 26 | _settings = settings; 27 | _highlighterIdProviderFactory = highlighterIdProviderFactory; 28 | _colorizerPresenter = colorizerPresenter; 29 | } 30 | 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/ParameterInfo/EnhancedTypeArgumentContext.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.Presentation; 2 | using JetBrains.Application.Settings; 3 | using JetBrains.ReSharper.Feature.Services.ParameterInfo; 4 | 5 | namespace GammaJul.ReSharper.EnhancedTooltip.ParameterInfo { 6 | 7 | /// 8 | /// Part of the override chain needed to replace a parameter info. 9 | /// for more information. 10 | /// 11 | public class EnhancedTypeArgumentContext : EnhancedContext { 12 | 13 | private readonly IContextBoundSettingsStore _settings; 14 | private readonly HighlighterIdProviderFactory _highlighterIdProviderFactory; 15 | private readonly ColorizerPresenter _colorizerPresenter; 16 | 17 | protected override EnhancedCandidate Enhance(TypeArgumentCandidate candidate) 18 | => new EnhancedTypeArgumentCandidate(candidate, _settings, _highlighterIdProviderFactory, _colorizerPresenter); 19 | 20 | public EnhancedTypeArgumentContext( 21 | IParameterInfoContext context, 22 | IContextBoundSettingsStore settings, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory, 24 | ColorizerPresenter colorizerPresenter) 25 | : base(context) { 26 | _settings = settings; 27 | _highlighterIdProviderFactory = highlighterIdProviderFactory; 28 | _colorizerPresenter = colorizerPresenter; 29 | } 30 | 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/AnnotationsDisplayKindExtensions.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.Settings; 2 | using JetBrains.Annotations; 3 | using JetBrains.ReSharper.Feature.Services.Lookup; 4 | 5 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 6 | 7 | public static class AnnotationsDisplayKindExtensions { 8 | 9 | [Pure] 10 | public static AttributesDisplayKind ToAttributesDisplayKind(this AnnotationsDisplayKind annotationsDisplayKind) 11 | => annotationsDisplayKind switch { 12 | AnnotationsDisplayKind.None => AttributesDisplayKind.Never, 13 | AnnotationsDisplayKind.Nullness => AttributesDisplayKind.NullnessAnnotations, 14 | AnnotationsDisplayKind.All => AttributesDisplayKind.AllAnnotations, 15 | _ => AttributesDisplayKind.Never 16 | }; 17 | 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/ArgumentRoleTooltipContent.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.UI.Icons; 2 | using JetBrains.UI.RichText; 3 | using JetBrains.Util; 4 | 5 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 6 | 7 | public class ArgumentRoleTooltipContent : TooltipContent { 8 | 9 | public IconId? Icon { get; set; } 10 | 11 | public RichText? Description { get; set; } 12 | 13 | public ArgumentRoleTooltipContent(RichText? text, TextRange trackingRange) 14 | : base(text, trackingRange) { 15 | } 16 | 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/AttributeUsageContent.cs: -------------------------------------------------------------------------------- 1 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 2 | 3 | public sealed class AttributeUsageContent { 4 | 5 | public string ValidOn { get; } 6 | 7 | public string AllowMultiple { get; } 8 | 9 | public string Inherited { get; } 10 | 11 | private static string ToYesNoString(bool value) 12 | => value ? "Yes" : "No"; 13 | 14 | public AttributeUsageContent(string validOn, bool allowMultiple, bool inherited) { 15 | ValidOn = validOn; 16 | AllowMultiple = ToYesNoString(allowMultiple); 17 | Inherited = ToYesNoString(inherited); 18 | } 19 | 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/AutoContrastedRichTextPresenter.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.UI.Controls; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 4 | 5 | /// 6 | /// Workaround the base which doesn't re-render its content 7 | /// when changes (it doesn't work if the text has been set first). 8 | /// 9 | public class AutoContrastedRichTextPresenter : RichTextPresenter { 10 | 11 | public AutoContrastedRichTextPresenter() 12 | => IsAutoContrasted = true; 13 | 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/ColorizerExtensions.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.ReSharper.Psi; 2 | using JetBrains.ReSharper.Psi.Resolve; 3 | using JetBrains.ReSharper.Psi.Tree; 4 | 5 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 6 | 7 | internal static class ColorizerExtensions { 8 | 9 | public static PresentedInfo TryAppendDeclaredElement( 10 | this IColorizer colorizer, 11 | IDeclaredElement? element, 12 | ISubstitution? substitution, 13 | PresenterOptions options, 14 | ITreeNode? contextualNode) { 15 | 16 | if (element is null || substitution is null) 17 | return new PresentedInfo(); 18 | 19 | return colorizer.AppendDeclaredElement(element, substitution, options, contextualNode); 20 | } 21 | 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/DescriptionSeparatorWidthConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows; 4 | using System.Windows.Data; 5 | 6 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 7 | 8 | public sealed class DescriptionSeparatorWidthConverter : IValueConverter { 9 | 10 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 11 | => value is double d ? d + 16.0 : DependencyProperty.UnsetValue; 12 | 13 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 14 | => DependencyProperty.UnsetValue; 15 | 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/ElementKindDisplay.cs: -------------------------------------------------------------------------------- 1 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 2 | 3 | public enum ElementKindDisplay { 4 | None, 5 | Standard, 6 | Stylized 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/ElementTypeDisplay.cs: -------------------------------------------------------------------------------- 1 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 2 | 3 | public enum ElementTypeDisplay { 4 | None, 5 | Before, 6 | After 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/ExceptionContent.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.UI.RichText; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 4 | 5 | public sealed class ExceptionContent { 6 | 7 | public RichText? Exception { get; } 8 | 9 | public RichText? Description { get; set; } 10 | 11 | public ExceptionContent(RichText? exception) { 12 | Exception = exception; 13 | } 14 | 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/FontSizeScaleConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows; 4 | using System.Windows.Data; 5 | 6 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 7 | 8 | public sealed class FontSizeScaleConverter : IValueConverter { 9 | 10 | public double Scale { get; set; } = 1.0; 11 | 12 | private static object ScaleDouble(object? value, double scale) 13 | => value is double d ? d * scale : DependencyProperty.UnsetValue; 14 | 15 | public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) 16 | => ScaleDouble(value, Scale); 17 | 18 | public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) 19 | => ScaleDouble(value, 1.0 / Scale); 20 | 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/HighlighterIdProviderFactory.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Application.Parts; 2 | using JetBrains.Application.Settings; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Feature.Services.Daemon; 5 | using JetBrains.Util.DevEnv; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | public class HighlighterIdProviderFactory { 11 | 12 | private readonly uint _vsMajorVersion; 13 | 14 | public HighlighterIdProvider CreateProvider(IContextBoundSettingsStore settings) 15 | => new HighlighterIdProvider(GetHighlighterIdSource(settings)); 16 | 17 | private HighlighterIdSource GetHighlighterIdSource(IContextBoundSettingsStore settings) { 18 | if (settings.GetValue(HighlightingSettingsAccessor.IdentifierHighlightingEnabled)) 19 | return HighlighterIdSource.ReSharper; 20 | if (_vsMajorVersion >= 16u) 21 | return HighlighterIdSource.VisualStudio16; 22 | if (_vsMajorVersion >= 14u) 23 | return HighlighterIdSource.VisualStudio14; 24 | return HighlighterIdSource.VisualStudioLegacy; 25 | } 26 | 27 | public HighlighterIdProviderFactory(IVsEnvironmentInformation vsEnvironment) 28 | => _vsMajorVersion = vsEnvironment.VsVersion2.Major; 29 | 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/HighlighterIdSource.cs: -------------------------------------------------------------------------------- 1 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 2 | 3 | public enum HighlighterIdSource { 4 | ReSharper, 5 | VisualStudio16, // VS 2019 6 | VisualStudio14, // VS 2015 7 | VisualStudioLegacy 8 | } 9 | 10 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AbstractAccessorIsNotImplementedErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.Resolve; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class AbstractAccessorIsNotImplementedErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(AbstractAccessorIsNotImplementedError highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("Abstract inherited member '"); 15 | colorizer.TryAppendDeclaredElement(highlighting.InheritorDeclaration.DeclaredElement, EmptySubstitution.INSTANCE, PresenterOptions.ForInterfaceMember, highlighting.InheritorDeclaration); 16 | colorizer.AppendPlainText("' is missing "); 17 | colorizer.AppendAccessorKind(highlighting.MissedAccessor.Kind); 18 | colorizer.AppendPlainText(" accessor implementation"); 19 | } 20 | 21 | public AbstractAccessorIsNotImplementedErrorEnhancer( 22 | TextStyleHighlighterManager textStyleHighlighterManager, 23 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 24 | HighlighterIdProviderFactory highlighterIdProviderFactory) 25 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 26 | } 27 | 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AbstractBaseMemberCallErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.Resolve; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class AbstractBaseMemberCallErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(AbstractBaseMemberCallError highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("Cannot call an abstract base "); 15 | colorizer.AppendElementKind(highlighting.BaseMember); 16 | colorizer.AppendPlainText(" '"); 17 | colorizer.AppendDeclaredElement(highlighting.BaseMember, EmptySubstitution.INSTANCE, PresenterOptions.QualifiedMember, highlighting.Expression); 18 | colorizer.AppendPlainText("'"); 19 | } 20 | 21 | public AbstractBaseMemberCallErrorEnhancer( 22 | TextStyleHighlighterManager textStyleHighlighterManager, 23 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 24 | HighlighterIdProviderFactory highlighterIdProviderFactory) 25 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 26 | } 27 | 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AccessRightsForBothAccessorsErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.Resolve; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class AccessRightsForBothAccessorsErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(AccessRightsForBothAccessorsError highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("Cannot specify accessibility modifiers for both accessors of the "); 15 | colorizer.AppendElementKind(highlighting.TypeMember); 16 | colorizer.AppendPlainText(" '"); 17 | colorizer.AppendDeclaredElement(highlighting.TypeMember, EmptySubstitution.INSTANCE, PresenterOptions.QualifiedName, highlighting.AccessorDeclaration); 18 | colorizer.AppendPlainText("'"); 19 | } 20 | 21 | public AccessRightsForBothAccessorsErrorEnhancer( 22 | TextStyleHighlighterManager textStyleHighlighterManager, 23 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 24 | HighlighterIdProviderFactory highlighterIdProviderFactory) 25 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 26 | } 27 | 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AccessRightsInTextWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.ExtensionsAPI.Resolve; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class AccessRightsInTextWarningEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(AccessRightsInTextWarning highlighting, CSharpColorizer colorizer) { 14 | ResolveResultWithInfo resolveResult = highlighting.Reference.Resolve(); 15 | if (resolveResult.DeclaredElement is not { } declaredElement) 16 | return; 17 | 18 | colorizer.AppendPlainText("Cannot access "); 19 | colorizer.AppendElementKind(declaredElement); 20 | colorizer.AppendPlainText(" '"); 21 | colorizer.AppendDeclaredElement(declaredElement, resolveResult.Substitution, PresenterOptions.NameOnly, highlighting.Reference.GetTreeNode()); 22 | colorizer.AppendPlainText("' here"); 23 | } 24 | 25 | public AccessRightsInTextWarningEnhancer( 26 | TextStyleHighlighterManager textStyleHighlighterManager, 27 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 28 | HighlighterIdProviderFactory highlighterIdProviderFactory) 29 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 30 | } 31 | 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AccessorAccessRightsShouldBeMoreRestrictiveErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.Resolve; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class AccessorAccessRightsShouldBeMoreRestrictiveErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(AccessorAccessRightsShouldBeMoreRestrictiveError highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("The accessibility modifier of the accessor must be more restrictive than the "); 15 | colorizer.AppendElementKind(highlighting.TypeMember); 16 | colorizer.AppendPlainText(" '"); 17 | colorizer.AppendDeclaredElement(highlighting.TypeMember, EmptySubstitution.INSTANCE, PresenterOptions.QualifiedName, highlighting.AccessorDeclaration); 18 | colorizer.AppendPlainText("'"); 19 | } 20 | 21 | public AccessorAccessRightsShouldBeMoreRestrictiveErrorEnhancer( 22 | TextStyleHighlighterManager textStyleHighlighterManager, 23 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 24 | HighlighterIdProviderFactory highlighterIdProviderFactory) 25 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 26 | } 27 | 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AddressOfManagedTypeErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class AddressOfManagedTypeErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(AddressOfManagedTypeError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Cannot take the address of a variable of a managed type '"); 14 | colorizer.AppendExpressionType(highlighting.OperandType, false, PresenterOptions.NameOnly); 15 | colorizer.AppendPlainText("'"); 16 | } 17 | 18 | public AddressOfManagedTypeErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AllIndexersMustHaveSameNameErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class AllIndexersMustHaveSameNameErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(AllIndexersMustHaveSameNameError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("The '"); 14 | colorizer.AppendClassName("IndexerName"); 15 | colorizer.AppendPlainText("' attribute must be used with the same name on every indexer within a type"); 16 | } 17 | 18 | public AllIndexersMustHaveSameNameErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AnnotateNotNullParameterWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.Resolve; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class AnnotateNotNullParameterWarningEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(AnnotateNotNullParameterWarning highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("Annotate "); 15 | colorizer.AppendElementKind(highlighting.Declaration.DeclaredElement); 16 | colorizer.AppendPlainText(" '"); 17 | colorizer.AppendDeclaredElement(highlighting.AnnotationTypeElement, EmptySubstitution.INSTANCE, PresenterOptions.NameOnly, highlighting.Declaration); 18 | colorizer.AppendPlainText("' with ["); 19 | colorizer.AppendClassName(highlighting.IsContainerAnnotation ? "ItemNotNull" : "NotNull"); 20 | colorizer.AppendPlainText("] attribute"); 21 | } 22 | 23 | public AnnotateNotNullParameterWarningEnhancer( 24 | TextStyleHighlighterManager textStyleHighlighterManager, 25 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 26 | HighlighterIdProviderFactory highlighterIdProviderFactory) 27 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 28 | } 29 | 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AnnotationRedundancyAtValueTypeWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class AnnotationRedundancyAtValueTypeWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(AnnotationRedundancyAtValueTypeWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Applying nullness annotation to "); 14 | if (highlighting.IsVoid) { 15 | colorizer.AppendPlainText("'"); 16 | colorizer.AppendKeyword("void"); 17 | colorizer.AppendPlainText("'"); 18 | } 19 | else 20 | colorizer.AppendPlainText("value"); 21 | colorizer.AppendPlainText(" type is meaningless"); 22 | } 23 | 24 | public AnnotationRedundancyAtValueTypeWarningEnhancer( 25 | TextStyleHighlighterManager textStyleHighlighterManager, 26 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 27 | HighlighterIdProviderFactory highlighterIdProviderFactory) 28 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 29 | } 30 | 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AnonymousMethodParameterParamsErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class AnonymousMethodParameterParamsErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(AnonymousMethodParameterParamsError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Anonymous method parameter cannot be '"); 14 | colorizer.AppendKeyword("params"); 15 | colorizer.AppendPlainText("'"); 16 | } 17 | 18 | public AnonymousMethodParameterParamsErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AnonymousTypePropertyCannotBeVoidErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class AnonymousTypePropertyCannotBeVoidErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(AnonymousTypePropertyCannotBeVoidError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Cannot assign '"); 14 | colorizer.AppendKeyword("void"); 15 | colorizer.AppendPlainText("' to anonymous type property"); 16 | } 17 | 18 | public AnonymousTypePropertyCannotBeVoidErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ArglistIteratorParameterErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ArglistIteratorParameterErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ArglistIteratorParameterError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("'"); 14 | colorizer.AppendKeyword("__arglist"); 15 | colorizer.AppendPlainText("' is not allowed in the parameter list of iterators"); 16 | } 17 | 18 | public ArglistIteratorParameterErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ArglistParameterInAsyncErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ArglistParameterInAsyncErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ArglistParameterInAsyncError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Async methods cannot have '"); 14 | colorizer.AppendKeyword("__arglist"); 15 | colorizer.AppendPlainText("' parameters"); 16 | } 17 | 18 | public ArglistParameterInAsyncErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ArglistParameterInDelegateErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ArglistParameterInDelegateErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ArglistParameterInDelegateError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Delegates cannot have '"); 14 | colorizer.AppendKeyword("__arglist"); 15 | colorizer.AppendPlainText("' parameters"); 16 | } 17 | 18 | public ArglistParameterInDelegateErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ArrayElementIsStaticClassErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ArrayElementIsStaticClassErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ArrayElementIsStaticClassError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("'"); 14 | colorizer.AppendExpressionType(highlighting.ScalarType, false, PresenterOptions.FullWithoutParameterNames); 15 | colorizer.AppendPlainText("': array elements cannot be of static type"); 16 | } 17 | 18 | public ArrayElementIsStaticClassErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ArrayElementTypeIsForbiddenErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ArrayElementTypeIsForbiddenErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ArrayElementTypeIsForbiddenError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Array element type cannot be '"); 14 | colorizer.AppendExpressionType(highlighting.ElementType, false, PresenterOptions.FullWithoutParameterNames); 15 | colorizer.AppendPlainText("'"); 16 | } 17 | 18 | public ArrayElementTypeIsForbiddenErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AsOperatorWithValueTypeErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class AsOperatorWithValueTypeErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(AsOperatorWithValueTypeError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("The "); 14 | colorizer.AppendKeyword("as"); 15 | colorizer.AppendPlainText(" operator must be used with a reference or nullable type ('"); 16 | colorizer.AppendExpressionType(highlighting.ValueType, false, PresenterOptions.FullWithoutParameterNames); 17 | colorizer.AppendPlainText("' is a non-nullable value type)"); 18 | } 19 | 20 | public AsOperatorWithValueTypeErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AssignNullToNotNullAttributeWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class AssignNullToNotNullAttributeWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(AssignNullToNotNullAttributeWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Possible '"); 14 | colorizer.AppendKeyword("null"); 15 | colorizer.AppendPlainText("' assignment to entity marked with '"); 16 | colorizer.AppendClassName("NotNull"); 17 | colorizer.AppendPlainText("' attribute"); 18 | } 19 | 20 | public AssignNullToNotNullAttributeWarningEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AssignVoidToRangeVariableErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class AssignVoidToRangeVariableErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(AssignVoidToRangeVariableError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Cannot assign "); 14 | colorizer.AppendKeyword("void"); 15 | colorizer.AppendPlainText(" to a range variable"); 16 | } 17 | 18 | public AssignVoidToRangeVariableErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AsyncMethodInvocationWithoutAwaitWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class AsyncMethodInvocationWithoutAwaitWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(AsyncMethodInvocationWithoutAwaitWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the '"); 14 | colorizer.AppendKeyword("await"); 15 | colorizer.AppendPlainText("' operator to the result of the call."); 16 | } 17 | 18 | public AsyncMethodInvocationWithoutAwaitWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AsyncMethodWithoutBodyErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class AsyncMethodWithoutBodyErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(AsyncMethodWithoutBodyError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("The '"); 14 | colorizer.AppendKeyword("async"); 15 | colorizer.AppendPlainText("' modifier can only be used in methods that have a body"); 16 | } 17 | 18 | public AsyncMethodWithoutBodyErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AsyncModifierIsNotValidOnThisItemErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class AsyncModifierIsNotValidOnThisItemErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(AsyncModifierIsNotValidOnThisItemError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("The modifier '"); 14 | colorizer.AppendKeyword("async"); 15 | colorizer.AppendPlainText("' is not valid for this item"); 16 | } 17 | 18 | public AsyncModifierIsNotValidOnThisItemErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AtLeastOneParameterOfSignOperatorMustBeContainingTypeErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.Resolve; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class AtLeastOneParameterOfSignOperatorMustBeContainingTypeErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(AtLeastOneParameterOfSignOperatorMustBeContainingTypeError highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("At least one parameter should be '"); 15 | colorizer.AppendDeclaredElement(highlighting.ContainingType, EmptySubstitution.INSTANCE, PresenterOptions.QualifiedName, highlighting.Declaration); 16 | colorizer.AppendPlainText("'"); 17 | } 18 | 19 | public AtLeastOneParameterOfSignOperatorMustBeContainingTypeErrorEnhancer( 20 | TextStyleHighlighterManager textStyleHighlighterManager, 21 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 22 | HighlighterIdProviderFactory highlighterIdProviderFactory) 23 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 24 | } 25 | 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AttributeCannotHaveTypeParametersErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class AttributeCannotHaveTypeParametersErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(AttributeCannotHaveTypeParametersError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("A generic type cannot derive from '"); 14 | colorizer.AppendNamespaceName("System"); 15 | colorizer.AppendOperator("."); 16 | colorizer.AppendClassName("Attribute"); 17 | colorizer.AppendPlainText("' because it is an attribute class"); 18 | } 19 | 20 | public AttributeCannotHaveTypeParametersErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AttributeNameExpectedErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.ExtensionsAPI.Resolve; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class AttributeNameExpectedErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(AttributeNameExpectedError highlighting, CSharpColorizer colorizer) { 14 | ResolveResultWithInfo resolveResult = highlighting.Reference.Resolve(); 15 | if (resolveResult.DeclaredElement is not { } declaredElement) 16 | return; 17 | 18 | colorizer.AppendPlainText("'"); 19 | colorizer.AppendDeclaredElement(declaredElement, resolveResult.Substitution, PresenterOptions.NameOnly, highlighting.Reference.GetTreeNode()); 20 | colorizer.AppendPlainText("' is not an attribute"); 21 | } 22 | 23 | public AttributeNameExpectedErrorEnhancer( 24 | TextStyleHighlighterManager textStyleHighlighterManager, 25 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 26 | HighlighterIdProviderFactory highlighterIdProviderFactory) 27 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 28 | } 29 | 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/AwaitIdentifierInAsyncMethodErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class AwaitIdentifierInAsyncMethodErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(AwaitIdentifierInAsyncMethodError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("'"); 14 | colorizer.AppendKeyword("await"); 15 | colorizer.AppendPlainText("' cannot be used as an identifier within an "); 16 | colorizer.AppendKeyword("async"); 17 | colorizer.AppendPlainText(" method or lambda expression"); 18 | } 19 | 20 | public AwaitIdentifierInAsyncMethodErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/BaseMemberHasParamsWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.Resolve; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class BaseMemberHasParamsWarningEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(BaseMemberHasParamsWarning highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("Base "); 15 | colorizer.AppendElementKind(highlighting.BaseMember); 16 | colorizer.AppendPlainText(" '"); 17 | colorizer.AppendDeclaredElement(highlighting.BaseMember, EmptySubstitution.INSTANCE, PresenterOptions.QualifiedName, highlighting.Declaration); 18 | colorizer.AppendPlainText("' last parameter has '"); 19 | colorizer.AppendKeyword("params"); 20 | colorizer.AppendPlainText("' modifier"); 21 | } 22 | 23 | public BaseMemberHasParamsWarningEnhancer( 24 | TextStyleHighlighterManager textStyleHighlighterManager, 25 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 26 | HighlighterIdProviderFactory highlighterIdProviderFactory) 27 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 28 | } 29 | 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/BaseObjectEqualsIsObjectEqualsWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class BaseObjectEqualsIsObjectEqualsWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(BaseObjectEqualsIsObjectEqualsWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Call to '"); 14 | colorizer.AppendKeyword("base"); 15 | colorizer.AppendOperator("."); 16 | colorizer.AppendMethodName("Equals"); 17 | colorizer.AppendPlainText("(...)' is reference equality"); 18 | } 19 | 20 | public BaseObjectEqualsIsObjectEqualsWarningEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/BaseObjectGetHashCodeCallInGetHashCodeWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class BaseObjectGetHashCodeCallInGetHashCodeWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(BaseObjectGetHashCodeCallInGetHashCodeWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Overriden "); 14 | colorizer.AppendMethodName("GetHashCode"); 15 | colorizer.AppendPlainText(" calls base '"); 16 | colorizer.AppendClassName("Object"); 17 | colorizer.AppendOperator("."); 18 | colorizer.AppendMethodName("GetHashCode"); 19 | colorizer.AppendPlainText("()'"); 20 | } 21 | 22 | public BaseObjectGetHashCodeCallInGetHashCodeWarningEnhancer( 23 | TextStyleHighlighterManager textStyleHighlighterManager, 24 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 25 | HighlighterIdProviderFactory highlighterIdProviderFactory) 26 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 27 | } 28 | 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/BitwiseOperatorOnEnumWithoutFlagsWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class BitwiseOperatorOnEnumWithoutFlagsWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(BitwiseOperatorOnEnumWithoutFlagsWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Bitwise operation on enum which is not marked by ["); 14 | colorizer.AppendClassName("Flags"); 15 | colorizer.AppendPlainText("] attribute"); 16 | } 17 | 18 | public BitwiseOperatorOnEnumWithoutFlagsWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotApplyBinaryOperatorErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotApplyBinaryOperatorErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotApplyBinaryOperatorError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Cannot apply operator '"); 14 | colorizer.AppendOperator(highlighting.Sign.GetText()); 15 | colorizer.AppendPlainText("' to operands of type '"); 16 | colorizer.AppendExpressionType(highlighting.LeftType, false, PresenterOptions.FullWithoutParameterNames); 17 | colorizer.AppendPlainText("' and '"); 18 | colorizer.AppendExpressionType(highlighting.RightType, false, PresenterOptions.FullWithoutParameterNames); 19 | colorizer.AppendPlainText("'"); 20 | } 21 | 22 | public CannotApplyBinaryOperatorErrorEnhancer( 23 | TextStyleHighlighterManager textStyleHighlighterManager, 24 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 25 | HighlighterIdProviderFactory highlighterIdProviderFactory) 26 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 27 | } 28 | 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotApplyEqualityOperatorToTypeWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotApplyEqualityOperatorToTypeWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotApplyEqualityOperatorToTypeWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Cannot apply equality operator to type marked by '"); 14 | colorizer.AppendClassName("CannotApplyEqualityOperator"); 15 | colorizer.AppendPlainText("' attribute"); 16 | } 17 | 18 | public CannotApplyEqualityOperatorToTypeWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotApplyUnaryOperatorErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotApplyUnaryOperatorErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotApplyUnaryOperatorError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Cannot apply operator '"); 14 | colorizer.AppendOperator(highlighting.Sign); 15 | colorizer.AppendPlainText("' to operand of type '"); 16 | colorizer.AppendExpressionType(highlighting.OperandType, false, PresenterOptions.FullWithoutParameterNames); 17 | colorizer.AppendPlainText("'"); 18 | } 19 | 20 | public CannotApplyUnaryOperatorErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotAwaitInCatchOrFinallyErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotAwaitInCatchOrFinallyErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotAwaitInCatchOrFinallyError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Cannot "); 14 | colorizer.AppendKeyword("await"); 15 | colorizer.AppendPlainText(" in the "); 16 | colorizer.AppendKeyword("catch"); 17 | colorizer.AppendPlainText(" or "); 18 | colorizer.AppendKeyword("finally"); 19 | colorizer.AppendPlainText(" clause of a "); 20 | colorizer.AppendKeyword("try"); 21 | colorizer.AppendPlainText(" statement"); 22 | } 23 | 24 | public CannotAwaitInCatchOrFinallyErrorEnhancer( 25 | TextStyleHighlighterManager textStyleHighlighterManager, 26 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 27 | HighlighterIdProviderFactory highlighterIdProviderFactory) 28 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 29 | } 30 | 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotAwaitInExceptionFilterExpressionErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotAwaitInExceptionFilterExpressionErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotAwaitInExceptionFilterExpressionError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Cannot "); 14 | colorizer.AppendKeyword("await"); 15 | colorizer.AppendPlainText(" in the filter expression of a "); 16 | colorizer.AppendKeyword("catch"); 17 | colorizer.AppendPlainText(" clause"); 18 | } 19 | 20 | public CannotAwaitInExceptionFilterExpressionErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotAwaitInLockStatementErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotAwaitInLockStatementErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotAwaitInLockStatementError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Cannot "); 14 | colorizer.AppendKeyword("await"); 15 | colorizer.AppendPlainText(" in the body of a "); 16 | colorizer.AppendKeyword("lock"); 17 | colorizer.AppendPlainText(" statement"); 18 | } 19 | 20 | public CannotAwaitInLockStatementErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotAwaitInUnsafeContextErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotAwaitInUnsafeContextErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotAwaitInUnsafeContextError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Cannot "); 14 | colorizer.AppendKeyword("await"); 15 | colorizer.AppendPlainText(" in an "); 16 | colorizer.AppendKeyword("unsafe"); 17 | colorizer.AppendPlainText(" context"); 18 | } 19 | 20 | public CannotAwaitInUnsafeContextErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotAwaitUnderQueryExpressionErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotAwaitUnderQueryExpressionErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotAwaitUnderQueryExpressionError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("The '"); 14 | colorizer.AppendKeyword("await"); 15 | colorizer.AppendPlainText("' operator may only be used in a query expression within the first collection expression of the initial '"); 16 | colorizer.AppendKeyword("from"); 17 | colorizer.AppendPlainText("' clause or within the collection expression of a '"); 18 | colorizer.AppendKeyword("join"); 19 | colorizer.AppendPlainText("' clause"); 20 | } 21 | 22 | public CannotAwaitUnderQueryExpressionErrorEnhancer( 23 | TextStyleHighlighterManager textStyleHighlighterManager, 24 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 25 | HighlighterIdProviderFactory highlighterIdProviderFactory) 26 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 27 | } 28 | 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotConstructVoidErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotConstructVoidErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotConstructVoidError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Cannot construct '"); 14 | colorizer.AppendKeyword("void"); 15 | colorizer.AppendPlainText("' type"); 16 | } 17 | 18 | public CannotConstructVoidErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotCreateInstanceOfInterfaceErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.Resolve; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class CannotCreateInstanceOfInterfaceErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(CannotCreateInstanceOfInterfaceError highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("Cannot create an instance of the interface '"); 15 | colorizer.AppendDeclaredElement(highlighting.TypeElement, EmptySubstitution.INSTANCE, PresenterOptions.QualifiedName, highlighting.ObjectCreationExpression); 16 | colorizer.AppendPlainText("'"); 17 | } 18 | 19 | public CannotCreateInstanceOfInterfaceErrorEnhancer( 20 | TextStyleHighlighterManager textStyleHighlighterManager, 21 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 22 | HighlighterIdProviderFactory highlighterIdProviderFactory) 23 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 24 | } 25 | 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotCreateInstanceOfTypeParameterWithArgumentsErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.Resolve; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class CannotCreateInstanceOfTypeParameterWithArgumentsErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(CannotCreateInstanceOfTypeParameterWithArgumentsError highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("Cannot provide arguments when creating an instance of a type parameter '"); 15 | colorizer.AppendDeclaredElement(highlighting.TypeParameter, EmptySubstitution.INSTANCE, PresenterOptions.NameOnly, highlighting.ObjectCreationExpression); 16 | colorizer.AppendPlainText("'"); 17 | } 18 | 19 | public CannotCreateInstanceOfTypeParameterWithArgumentsErrorEnhancer( 20 | TextStyleHighlighterManager textStyleHighlighterManager, 21 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 22 | HighlighterIdProviderFactory highlighterIdProviderFactory) 23 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 24 | } 25 | 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotCreateInstanceOfTypeWithoutConstructorErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.Resolve; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class CannotCreateInstanceOfTypeWithoutConstructorErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(CannotCreateInstanceOfTypeWithoutConstructorError highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("The "); 15 | colorizer.AppendElementKind(highlighting.TypeElement); 16 | colorizer.AppendPlainText(" '"); 17 | colorizer.AppendDeclaredElement(highlighting.TypeElement, EmptySubstitution.INSTANCE, PresenterOptions.QualifiedName, highlighting.ObjectCreationExpression); 18 | colorizer.AppendPlainText("' has no constructors defined"); 19 | } 20 | 21 | public CannotCreateInstanceOfTypeWithoutConstructorErrorEnhancer( 22 | TextStyleHighlighterManager textStyleHighlighterManager, 23 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 24 | HighlighterIdProviderFactory highlighterIdProviderFactory) 25 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 26 | } 27 | 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotDetermineTernaryExpressionTypeErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotDetermineTernaryExpressionTypeErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotDetermineTernaryExpressionTypeError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("There is no implicit conversion between '"); 14 | colorizer.AppendExpressionType(highlighting.ThenType, false, PresenterOptions.FullWithoutParameterNames); 15 | colorizer.AppendPlainText("' and '"); 16 | colorizer.AppendExpressionType(highlighting.ElseType, false, PresenterOptions.FullWithoutParameterNames); 17 | colorizer.AppendPlainText("'"); 18 | } 19 | 20 | public CannotDetermineTernaryExpressionTypeErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotHaveEventAccessorsInAbstractEventErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotHaveEventAccessorsInAbstractEventErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotHaveEventAccessorsInAbstractEventError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Abstract event cannot have "); 14 | colorizer.AppendAccessorName("add"); 15 | colorizer.AppendPlainText(" or "); 16 | colorizer.AppendAccessorName("remove"); 17 | colorizer.AppendPlainText(" accessors"); 18 | } 19 | 20 | public CannotHaveEventAccessorsInAbstractEventErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotHaveEventAccessorsInInterfacesErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotHaveEventAccessorsInInterfacesErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotHaveEventAccessorsInInterfacesError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Event in interface cannot have "); 14 | colorizer.AppendAccessorName("add"); 15 | colorizer.AppendPlainText(" or "); 16 | colorizer.AppendAccessorName("remove"); 17 | colorizer.AppendPlainText(" accessors"); 18 | } 19 | 20 | public CannotHaveEventAccessorsInInterfacesErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotImplementDynamicInterfaceErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotImplementDynamicInterfaceErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotImplementDynamicInterfaceError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Cannot implement a "); 14 | colorizer.AppendKeyword("dynamic"); 15 | colorizer.AppendPlainText(" interface '"); 16 | colorizer.AppendExpressionType(highlighting.SuperType, false, PresenterOptions.FullWithoutParameterNames); 17 | colorizer.AppendPlainText("'"); 18 | } 19 | 20 | public CannotImplementDynamicInterfaceErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotImplicitlyConvertGotoCaseValueToGoverningTypeWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotImplicitlyConvertGotoCaseValueToGoverningTypeWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotImplicitlyConvertGotoCaseValueToGoverningTypeWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("The '"); 14 | colorizer.AppendKeyword("goto case"); 15 | colorizer.AppendPlainText("' value is not implicitly convertible to type '"); 16 | colorizer.AppendExpressionType(highlighting.GoverningType, false, PresenterOptions.FullWithoutParameterNames); 17 | colorizer.AppendPlainText("'"); 18 | } 19 | 20 | public CannotImplicitlyConvertGotoCaseValueToGoverningTypeWarningEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotInheritFromSealedTypeErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi; 6 | using JetBrains.ReSharper.Psi.CodeAnnotations; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class CannotInheritFromSealedTypeErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(CannotInheritFromSealedTypeError highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("Cannot inherit from "); 15 | colorizer.AppendKeyword("sealed"); 16 | colorizer.AppendPlainText(" "); 17 | colorizer.AppendElementKind(highlighting.TypeElement); 18 | colorizer.AppendPlainText(" '"); 19 | colorizer.AppendExpressionType(TypeFactory.CreateType(highlighting.TypeElement), false, PresenterOptions.NameOnly); 20 | colorizer.AppendPlainText("'"); 21 | } 22 | 23 | public CannotInheritFromSealedTypeErrorEnhancer( 24 | TextStyleHighlighterManager textStyleHighlighterManager, 25 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 26 | HighlighterIdProviderFactory highlighterIdProviderFactory) 27 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 28 | } 29 | 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotInheritFromSpecialTypeErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi; 6 | using JetBrains.ReSharper.Psi.CodeAnnotations; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class CannotInheritFromSpecialTypeErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(CannotInheritFromSpecialTypeError highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("Cannot derive from special class '"); 15 | colorizer.AppendExpressionType(TypeFactory.CreateType(highlighting.TypeElement), false, PresenterOptions.QualifiedName); 16 | colorizer.AppendPlainText("'"); 17 | } 18 | 19 | public CannotInheritFromSpecialTypeErrorEnhancer( 20 | TextStyleHighlighterManager textStyleHighlighterManager, 21 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 22 | HighlighterIdProviderFactory highlighterIdProviderFactory) 23 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 24 | } 25 | 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotInstantiateDynamicTypeErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotInstantiateDynamicTypeErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotInstantiateDynamicTypeError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Cannot instantiate '"); 14 | colorizer.AppendKeyword("dynamic"); 15 | colorizer.AppendPlainText("' object"); 16 | } 17 | 18 | public CannotInstantiateDynamicTypeErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotSpecifyConstructorConstraintForValueTypeErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotSpecifyConstructorConstraintForValueTypeErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotSpecifyConstructorConstraintForValueTypeError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("The '"); 14 | colorizer.AppendKeyword("new"); 15 | colorizer.AppendPlainText("()' constraint cannot be used with the '"); 16 | colorizer.AppendKeyword("struct"); 17 | colorizer.AppendPlainText("' constraint"); 18 | } 19 | 20 | public CannotSpecifyConstructorConstraintForValueTypeErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotUseConstructorWithoutBracketsErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotUseConstructorWithoutBracketsErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotUseConstructorWithoutBracketsError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("A "); 14 | colorizer.AppendKeyword("new"); 15 | colorizer.AppendPlainText(" expression requires (), [], or {} after type"); 16 | } 17 | 18 | public CannotUseConstructorWithoutBracketsErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotUseDefaultMemberAttributeOnTypeWithIndexerErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotUseDefaultMemberAttributeOnTypeWithIndexerErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotUseDefaultMemberAttributeOnTypeWithIndexerError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Cannot specify the '"); 14 | colorizer.AppendClassName("DefaultMember"); 15 | colorizer.AppendPlainText("' attribute on type containing an indexer"); 16 | } 17 | 18 | public CannotUseDefaultMemberAttributeOnTypeWithIndexerErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotUseInvocableErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.Resolve; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class CannotUseInvocableErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(CannotUseInvocableError highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("Use of "); 15 | if (highlighting.UseElementType) 16 | colorizer.AppendElementKind(highlighting.Candidate); 17 | else 18 | colorizer.AppendPlainText("symbol"); 19 | colorizer.AppendPlainText(" '"); 20 | colorizer.AppendDeclaredElement(highlighting.Candidate, EmptySubstitution.INSTANCE, PresenterOptions.NameOnly, highlighting.Reference.GetTreeNode()); 21 | colorizer.AppendPlainText("' without ()"); 22 | } 23 | 24 | public CannotUseInvocableErrorEnhancer( 25 | TextStyleHighlighterManager textStyleHighlighterManager, 26 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 27 | HighlighterIdProviderFactory highlighterIdProviderFactory) 28 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 29 | } 30 | 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotUseThisBaseInInitializerErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.CSharp.Parsing; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class CannotUseThisBaseInInitializerErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(CannotUseThisBaseInInitializerError highlighting, CSharpColorizer colorizer) { 14 | string text = highlighting.Expression.GetText(); 15 | 16 | colorizer.AppendPlainText("Cannot use '"); 17 | if (CSharpLexer.IsKeyword(text)) 18 | colorizer.AppendKeyword(text); 19 | else 20 | colorizer.AppendPlainText(text); 21 | colorizer.AppendPlainText("' in member initializer"); 22 | } 23 | 24 | public CannotUseThisBaseInInitializerErrorEnhancer( 25 | TextStyleHighlighterManager textStyleHighlighterManager, 26 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 27 | HighlighterIdProviderFactory highlighterIdProviderFactory) 28 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 29 | } 30 | 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotUseThisBaseInStaticContextErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.CSharp.Parsing; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class CannotUseThisBaseInStaticContextErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(CannotUseThisBaseInStaticContextError highlighting, CSharpColorizer colorizer) { 14 | string text = highlighting.Expression.GetText(); 15 | 16 | colorizer.AppendPlainText("Cannot use '"); 17 | if (CSharpLexer.IsKeyword(text)) 18 | colorizer.AppendKeyword(text); 19 | else 20 | colorizer.AppendPlainText(text); 21 | colorizer.AppendPlainText("' in static member"); 22 | } 23 | 24 | public CannotUseThisBaseInStaticContextErrorEnhancer( 25 | TextStyleHighlighterManager textStyleHighlighterManager, 26 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 27 | HighlighterIdProviderFactory highlighterIdProviderFactory) 28 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 29 | } 30 | 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotUseThisInClosureInStructErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CannotUseThisInClosureInStructErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CannotUseThisInClosureInStructError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Anonymous methods, lambda expressions, local functions and query expressions inside structs cannot access instance members of '"); 14 | colorizer.AppendKeyword("this"); 15 | colorizer.AppendPlainText("'. Consider copying '"); 16 | colorizer.AppendKeyword("this"); 17 | colorizer.AppendPlainText("' to a local variable outside the anonymous method, lambda expression, local function or query expression and using the local instead."); 18 | } 19 | 20 | public CannotUseThisInClosureInStructErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CannotUseTypeArgumentWithElementErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.Resolve; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class CannotUseTypeArgumentWithElementErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(CannotUseTypeArgumentWithElementError highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("The "); 15 | colorizer.AppendElementKind(highlighting.Element); 16 | colorizer.AppendPlainText(" '"); 17 | colorizer.AppendDeclaredElement(highlighting.Element, EmptySubstitution.INSTANCE, PresenterOptions.QualifiedMember, highlighting.TypeArgumentList); 18 | colorizer.AppendPlainText("' cannot be used with type arguments"); 19 | } 20 | 21 | public CannotUseTypeArgumentWithElementErrorEnhancer( 22 | TextStyleHighlighterManager textStyleHighlighterManager, 23 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 24 | HighlighterIdProviderFactory highlighterIdProviderFactory) 25 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 26 | } 27 | 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CatchClauseCannotFollowGeneralCatchClauseErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CatchClauseCannotFollowGeneralCatchClauseErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CatchClauseCannotFollowGeneralCatchClauseError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Catch clauses cannot follow the general "); 14 | colorizer.AppendKeyword("catch"); 15 | colorizer.AppendPlainText(" clause of a "); 16 | colorizer.AppendPlainText("try"); 17 | colorizer.AppendPlainText(" statement"); 18 | } 19 | 20 | public CatchClauseCannotFollowGeneralCatchClauseErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CatchDoesNotExtendExceptionErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CatchDoesNotExtendExceptionErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CatchDoesNotExtendExceptionError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Catch type should extend '"); 14 | colorizer.AppendNamespaceName("System"); 15 | colorizer.AppendOperator("."); 16 | colorizer.AppendClassName("Exception"); 17 | colorizer.AppendPlainText("'"); 18 | } 19 | 20 | public CatchDoesNotExtendExceptionErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ClassTypeConstraintMustBeFirstErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ClassTypeConstraintMustBeFirstErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ClassTypeConstraintMustBeFirstError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("The class type constraint '"); 14 | colorizer.AppendExpressionType(highlighting.Constraint.Constraint, false, PresenterOptions.NameOnly); 15 | colorizer.AppendPlainText("' must come before any other constraints"); 16 | } 17 | 18 | public ClassTypeConstraintMustBeFirstErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CoVariantArrayConversionWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CoVariantArrayConversionWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CoVariantArrayConversionWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Co-variant array conversion from '"); 14 | colorizer.AppendExpressionType(highlighting.ExpressionType, false, PresenterOptions.NameOnly); 15 | colorizer.AppendPlainText("' to '"); 16 | colorizer.AppendExpressionType(highlighting.TargetType, false, PresenterOptions.NameOnly); 17 | colorizer.AppendPlainText("' can cause run-time exception on write operation"); 18 | } 19 | 20 | public CoVariantArrayConversionWarningEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/CompareNonConstrainedGenericWithNullWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class CompareNonConstrainedGenericWithNullWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(CompareNonConstrainedGenericWithNullWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Possible compare of value type with '"); 14 | colorizer.AppendKeyword("null"); 15 | colorizer.AppendPlainText("'"); 16 | } 17 | 18 | public CompareNonConstrainedGenericWithNullWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConditionIsAlwaysTrueOrFalseWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CSharp.ControlFlow; 6 | using JetBrains.ReSharper.Psi.CodeAnnotations; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class ConditionIsAlwaysTrueOrFalseWarningEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(ConditionIsAlwaysTrueOrFalseWarning highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("Expression is always "); 15 | if (highlighting.ExpressionConstantValue == ConstantExpressionValue.TRUE) 16 | colorizer.AppendKeyword("true"); 17 | else if (highlighting.ExpressionConstantValue == ConstantExpressionValue.FALSE) 18 | colorizer.AppendKeyword("false"); 19 | else 20 | colorizer.AppendPlainText("$unknown$"); 21 | } 22 | 23 | public ConditionIsAlwaysTrueOrFalseWarningEnhancer( 24 | TextStyleHighlighterManager textStyleHighlighterManager, 25 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 26 | HighlighterIdProviderFactory highlighterIdProviderFactory) 27 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 28 | } 29 | 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConditionalAccessAlwaysNotNullWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConditionalAccessAlwaysNotNullWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConditionalAccessAlwaysNotNullWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Conditional access qualifier expression is known to be not "); 14 | colorizer.AppendKeyword("null"); 15 | } 16 | 17 | public ConditionalAccessAlwaysNotNullWarningEnhancer( 18 | TextStyleHighlighterManager textStyleHighlighterManager, 19 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 20 | HighlighterIdProviderFactory highlighterIdProviderFactory) 21 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 22 | } 23 | 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConditionalAccessAlwaysNullWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConditionalAccessAlwaysNullWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConditionalAccessAlwaysNullWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Conditional access qualifier expression is known to be "); 14 | colorizer.AppendKeyword("null"); 15 | } 16 | 17 | public ConditionalAccessAlwaysNullWarningEnhancer( 18 | TextStyleHighlighterManager textStyleHighlighterManager, 19 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 20 | HighlighterIdProviderFactory highlighterIdProviderFactory) 21 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 22 | } 23 | 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConditionalLogicOperatorTypesMismatchErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConditionalLogicOperatorTypesMismatchErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConditionalLogicOperatorTypesMismatchError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("In order to be applicable as a short circuit operator a user-defined logical operator ('"); 14 | colorizer.AppendDeclaredElement(highlighting.SignOperator, highlighting.Substitution, PresenterOptions.QualifiedName, highlighting.Reference.GetTreeNode()); 15 | colorizer.AppendPlainText("') must have the same return type as the type of its 2 parameters"); 16 | } 17 | 18 | public ConditionalLogicOperatorTypesMismatchErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConditionalLogicTrueFalseOperatorMissingErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConditionalLogicTrueFalseOperatorMissingErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConditionalLogicTrueFalseOperatorMissingError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("The operator '"); 14 | colorizer.AppendDeclaredElement(highlighting.SignOperator, highlighting.Substitution, PresenterOptions.QualifiedName, highlighting.Reference.GetTreeNode()); 15 | colorizer.AppendPlainText("' requires a matching operator '"); 16 | colorizer.AppendKeyword("true"); 17 | colorizer.AppendPlainText("'/'"); 18 | colorizer.AppendKeyword("false"); 19 | colorizer.AppendPlainText("' to also be defined"); 20 | } 21 | 22 | public ConditionalLogicTrueFalseOperatorMissingErrorEnhancer( 23 | TextStyleHighlighterManager textStyleHighlighterManager, 24 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 25 | HighlighterIdProviderFactory highlighterIdProviderFactory) 26 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 27 | } 28 | 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConstraintCannotBeDynamicTypeErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConstraintCannotBeDynamicTypeErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConstraintCannotBeDynamicTypeError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Constraint cannot be a "); 14 | colorizer.AppendKeyword("dynamic"); 15 | colorizer.AppendPlainText(" type '"); 16 | colorizer.AppendExpressionType(highlighting.SuperType, false, PresenterOptions.FullWithoutParameterNames); 17 | colorizer.AppendPlainText("'"); 18 | } 19 | 20 | public ConstraintCannotBeDynamicTypeErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConstructorConstraintShouldBeLastErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConstructorConstraintShouldBeLastErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConstructorConstraintShouldBeLastError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("The "); 14 | colorizer.AppendKeyword("new"); 15 | colorizer.AppendPlainText("() constraint must be the last constraint specified"); 16 | } 17 | 18 | public ConstructorConstraintShouldBeLastErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConstructorInitializerMissingErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | using JetBrains.ReSharper.Psi.Resolve; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class ConstructorInitializerMissingErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(ConstructorInitializerMissingError highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("Base "); 15 | colorizer.AppendElementKind(highlighting.BaseType); 16 | colorizer.AppendPlainText(" '"); 17 | colorizer.AppendDeclaredElement(highlighting.BaseType, EmptySubstitution.INSTANCE, PresenterOptions.QualifiedName, highlighting.ConstructorDeclaration); 18 | colorizer.AppendPlainText("' doesn't contain parameterless constructor"); 19 | } 20 | 21 | public ConstructorInitializerMissingErrorEnhancer( 22 | TextStyleHighlighterManager textStyleHighlighterManager, 23 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 24 | HighlighterIdProviderFactory highlighterIdProviderFactory) 25 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 26 | } 27 | 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ContextValueIsProvidedWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ContextValueIsProvidedWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ContextValueIsProvidedWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Use value of '"); 14 | colorizer.AppendExpressionType(highlighting.ExpressionType, false, PresenterOptions.NameOnly); 15 | colorizer.AppendPlainText("' type provided by "); 16 | colorizer.AppendPlainText(highlighting.Suggestion.GetSourcePresentation()); 17 | } 18 | 19 | public ContextValueIsProvidedWarningEnhancer( 20 | TextStyleHighlighterManager textStyleHighlighterManager, 21 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 22 | HighlighterIdProviderFactory highlighterIdProviderFactory) 23 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 24 | } 25 | 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConversionFromObjectErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConversionFromObjectErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConversionFromObjectError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("User-defined conversion from '"); 14 | colorizer.AppendNamespaceName("System"); 15 | colorizer.AppendOperator("."); 16 | colorizer.AppendClassName("Object"); 17 | colorizer.AppendPlainText("'"); 18 | } 19 | 20 | public ConversionFromObjectErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConversionToObjectErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConversionToObjectErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConversionToObjectError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("User-defined conversion to '"); 14 | colorizer.AppendNamespaceName("System"); 15 | colorizer.AppendOperator("."); 16 | colorizer.AppendClassName("Object"); 17 | colorizer.AppendPlainText("'"); 18 | } 19 | 20 | public ConversionToObjectErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertIfDoToWhileWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertIfDoToWhileWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertIfDoToWhileWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Convert to '"); 14 | colorizer.AppendKeyword("while"); 15 | colorizer.AppendPlainText("' loop"); 16 | } 17 | 18 | public ConvertIfDoToWhileWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertIfStatementToConditionalTernaryExpressionWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertIfStatementToConditionalTernaryExpressionWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertIfStatementToConditionalTernaryExpressionWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Convert to '"); 14 | colorizer.AppendOperator("?:"); 15 | colorizer.AppendPlainText("' expression"); 16 | } 17 | 18 | public ConvertIfStatementToConditionalTernaryExpressionWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertIfStatementToMethodCallWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertIfStatementToMethodCallWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertIfStatementToMethodCallWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Convert to method call with '"); 14 | colorizer.AppendOperator("?:"); 15 | colorizer.AppendPlainText("' expression inside"); 16 | } 17 | 18 | public ConvertIfStatementToMethodCallWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertIfStatementToMethodCallWithAssignmentWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertIfStatementToMethodCallWithAssignmentWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertIfStatementToMethodCallWithAssignmentWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Convert to method call with '"); 14 | colorizer.AppendOperator("?:"); 15 | colorizer.AppendPlainText("' expression inside"); 16 | } 17 | 18 | public ConvertIfStatementToMethodCallWithAssignmentWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertIfStatementToNullCoalescingExpression1WarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertIfStatementToNullCoalescingExpression1WarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertIfStatementToNullCoalescingExpression1Warning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Convert to '"); 14 | colorizer.AppendOperator("??"); 15 | colorizer.AppendPlainText("' expression"); 16 | } 17 | 18 | public ConvertIfStatementToNullCoalescingExpression1WarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertIfStatementToNullCoalescingExpression2WarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertIfStatementToNullCoalescingExpression2WarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertIfStatementToNullCoalescingExpression2Warning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Convert to '"); 14 | colorizer.AppendOperator("??"); 15 | colorizer.AppendPlainText("' expression"); 16 | } 17 | 18 | public ConvertIfStatementToNullCoalescingExpression2WarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertIfStatementToNullCoalescingExpression3WarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertIfStatementToNullCoalescingExpression3WarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertIfStatementToNullCoalescingExpression3Warning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Convert to '"); 14 | colorizer.AppendOperator("??"); 15 | colorizer.AppendPlainText("' expression"); 16 | } 17 | 18 | public ConvertIfStatementToNullCoalescingExpression3WarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertIfStatementToNullCoalescingInMethodCallWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertIfStatementToNullCoalescingInMethodCallWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertIfStatementToNullCoalescingInMethodCallWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Convert to method call with '"); 14 | colorizer.AppendOperator("??"); 15 | colorizer.AppendPlainText("' expression inside"); 16 | } 17 | 18 | public ConvertIfStatementToNullCoalescingInMethodCallWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertIfStatementToNullCoalescingInMethodCallWithAssignmentWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertIfStatementToNullCoalescingInMethodCallWithAssignmentWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertIfStatementToNullCoalescingInMethodCallWithAssignmentWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Convert to method call with '"); 14 | colorizer.AppendOperator("??"); 15 | colorizer.AppendPlainText("' expression inside"); 16 | } 17 | 18 | public ConvertIfStatementToNullCoalescingInMethodCallWithAssignmentWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertIfStatementToReturnConditionalWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertIfStatementToReturnConditionalWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertIfStatementToReturnConditionalWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Convert to '"); 14 | colorizer.AppendKeyword("return"); 15 | colorizer.AppendPlainText("' statement"); 16 | } 17 | 18 | public ConvertIfStatementToReturnConditionalWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertIfStatementToReturnMethodCallWithConditionalWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertIfStatementToReturnMethodCallWithConditionalWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertIfStatementToReturnMethodCallWithConditionalWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Convert to '"); 14 | colorizer.AppendKeyword("return"); 15 | colorizer.AppendPlainText("' statement"); 16 | } 17 | 18 | public ConvertIfStatementToReturnMethodCallWithConditionalWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertIfStatementToReturnMethodCallWithNullCoalescingWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertIfStatementToReturnMethodCallWithNullCoalescingWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertIfStatementToReturnMethodCallWithNullCoalescingWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Convert to '"); 14 | colorizer.AppendKeyword("return"); 15 | colorizer.AppendPlainText("' statement"); 16 | } 17 | 18 | public ConvertIfStatementToReturnMethodCallWithNullCoalescingWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertIfStatementToReturnNullCoalescingWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertIfStatementToReturnNullCoalescingWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertIfStatementToReturnNullCoalescingWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Convert to '"); 14 | colorizer.AppendKeyword("return"); 15 | colorizer.AppendPlainText("' statement"); 16 | } 17 | 18 | public ConvertIfStatementToReturnNullCoalescingWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertIfStatementToSwitchStatementWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertIfStatementToSwitchStatementWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertIfStatementToSwitchWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Convert '"); 14 | colorizer.AppendKeyword("if"); 15 | colorizer.AppendPlainText("' statement to '"); 16 | colorizer.AppendKeyword("switch"); 17 | colorizer.AppendPlainText("' statement"); 18 | } 19 | 20 | public ConvertIfStatementToSwitchStatementWarningEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertIfToOrExpressionWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertIfToOrExpressionWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertIfToOrExpressionWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Convert to '"); 14 | colorizer.AppendOperator("||"); 15 | colorizer.AppendPlainText("' expression"); 16 | } 17 | 18 | public ConvertIfToOrExpressionWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertNullableToShortFormWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertNullableToShortFormWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertNullableToShortFormWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Rewrite as '"); 14 | colorizer.AppendExpressionType(highlighting.NullableType, false, PresenterOptions.NameOnly); 15 | colorizer.AppendPlainText("'"); 16 | } 17 | 18 | public ConvertNullableToShortFormWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ConvertToStaticClassWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ConvertToStaticClassWarningEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ConvertToStaticClassWarning highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Convert to '"); 14 | colorizer.AppendKeyword("static"); 15 | colorizer.AppendPlainText("' class"); 16 | } 17 | 18 | public ConvertToStaticClassWarningEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/IncorrectArgumentKindErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class IncorrectArgumentKindErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(IncorrectArgumentKindError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Argument is '"); 14 | colorizer.AppendParameterKind(highlighting.Argument.Kind); 15 | colorizer.AppendPlainText("' while parameter is declared as '"); 16 | colorizer.AppendParameterKind(highlighting.ParameterKind); 17 | colorizer.AppendPlainText("'"); 18 | } 19 | 20 | public IncorrectArgumentKindErrorEnhancer( 21 | TextStyleHighlighterManager textStyleHighlighterManager, 22 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 23 | HighlighterIdProviderFactory highlighterIdProviderFactory) 24 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 25 | } 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/IncorrectArgumentTypeErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using GammaJul.ReSharper.EnhancedTooltip.Psi; 3 | using JetBrains.Application.Parts; 4 | using JetBrains.ProjectModel; 5 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 6 | using JetBrains.ReSharper.Psi.CodeAnnotations; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class IncorrectArgumentTypeErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(IncorrectArgumentTypeError highlighting, CSharpColorizer colorizer) { 14 | bool appendModuleName = highlighting.ArgumentType.HasSameFullNameAs(highlighting.ParameterType); 15 | 16 | colorizer.AppendPlainText("Argument type '"); 17 | colorizer.AppendExpressionType(highlighting.ArgumentType, appendModuleName, PresenterOptions.FullWithoutParameterNames); 18 | colorizer.AppendPlainText("' is not assignable to parameter type '"); 19 | colorizer.AppendExpressionType(highlighting.ParameterType, appendModuleName, PresenterOptions.FullWithoutParameterNames); 20 | colorizer.AppendPlainText("'"); 21 | } 22 | 23 | public IncorrectArgumentTypeErrorEnhancer( 24 | TextStyleHighlighterManager textStyleHighlighterManager, 25 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 26 | HighlighterIdProviderFactory highlighterIdProviderFactory) 27 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 28 | } 29 | 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/IncorrectArgumentsErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class IncorrectArgumentsErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(IncorrectArgumentsError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Cannot resolve "); 14 | if (highlighting.UseElementType) 15 | colorizer.AppendElementKind(highlighting.Candidate); 16 | else 17 | colorizer.AppendPlainText("symbol"); 18 | colorizer.AppendPlainText(" '"); 19 | colorizer.AppendPlainText(highlighting.Candidate.ShortName); 20 | colorizer.AppendPlainText("', candidates are:"); 21 | colorizer.AppendCandidates(highlighting.Reference); 22 | } 23 | 24 | public IncorrectArgumentsErrorEnhancer( 25 | TextStyleHighlighterManager textStyleHighlighterManager, 26 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 27 | HighlighterIdProviderFactory highlighterIdProviderFactory) 28 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 29 | } 30 | 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/IncorrectAssignmentTypeErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using GammaJul.ReSharper.EnhancedTooltip.Psi; 3 | using JetBrains.Application.Parts; 4 | using JetBrains.ProjectModel; 5 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 6 | using JetBrains.ReSharper.Psi.CodeAnnotations; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class IncorrectAssignmentTypeErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(IncorrectAssignmentTypeError highlighting, CSharpColorizer colorizer) { 14 | bool appendModuleName = highlighting.SourceType.HasSameFullNameAs(highlighting.TargetType); 15 | 16 | colorizer.AppendPlainText("Cannot convert source type '"); 17 | colorizer.AppendExpressionType(highlighting.SourceType, appendModuleName, PresenterOptions.FullWithoutParameterNames); 18 | colorizer.AppendPlainText("' to target type '"); 19 | colorizer.AppendExpressionType(highlighting.TargetType, appendModuleName, PresenterOptions.FullWithoutParameterNames); 20 | colorizer.AppendPlainText("'"); 21 | } 22 | 23 | public IncorrectAssignmentTypeErrorEnhancer( 24 | TextStyleHighlighterManager textStyleHighlighterManager, 25 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 26 | HighlighterIdProviderFactory highlighterIdProviderFactory) 27 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 28 | } 29 | 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/IncorrectPropertyAccessorNameErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class IncorrectPropertyAccessorNameErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(IncorrectPropertyAccessorNameError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("'"); 14 | colorizer.AppendKeyword("get"); 15 | colorizer.AppendPlainText("', '"); 16 | colorizer.AppendKeyword("set"); 17 | colorizer.AppendPlainText("' or '"); 18 | colorizer.AppendKeyword("init"); 19 | colorizer.AppendPlainText("' expected"); 20 | } 21 | 22 | public IncorrectPropertyAccessorNameErrorEnhancer( 23 | TextStyleHighlighterManager textStyleHighlighterManager, 24 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 25 | HighlighterIdProviderFactory highlighterIdProviderFactory) 26 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 27 | } 28 | 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/IncorrectReturnTypeErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using GammaJul.ReSharper.EnhancedTooltip.Psi; 3 | using JetBrains.Application.Parts; 4 | using JetBrains.ProjectModel; 5 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 6 | using JetBrains.ReSharper.Psi.CodeAnnotations; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class IncorrectReturnTypeErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(IncorrectReturnTypeError highlighting, CSharpColorizer colorizer) { 14 | bool appendModuleName = highlighting.ValueType.HasSameFullNameAs(highlighting.ReturnType); 15 | 16 | colorizer.AppendPlainText("Cannot convert expression type '"); 17 | colorizer.AppendExpressionType(highlighting.ValueType, appendModuleName, PresenterOptions.FullWithoutParameterNames); 18 | colorizer.AppendPlainText("' to return type '"); 19 | colorizer.AppendExpressionType(highlighting.ReturnType, appendModuleName, PresenterOptions.FullWithoutParameterNames); 20 | colorizer.AppendPlainText("'"); 21 | } 22 | 23 | public IncorrectReturnTypeErrorEnhancer( 24 | TextStyleHighlighterManager textStyleHighlighterManager, 25 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 26 | HighlighterIdProviderFactory highlighterIdProviderFactory) 27 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 28 | } 29 | 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/IncorrectTrueOrFalseOperatorTypeErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class IncorrectTrueOrFalseOperatorTypeErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(IncorrectTrueOrFalseOperatorTypeError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("The return type of operator "); 14 | colorizer.AppendKeyword("true"); 15 | colorizer.AppendPlainText(" or "); 16 | colorizer.AppendKeyword("false"); 17 | colorizer.AppendPlainText(" must be '"); 18 | colorizer.AppendKeyword("bool"); 19 | colorizer.AppendPlainText("'"); 20 | } 21 | 22 | public IncorrectTrueOrFalseOperatorTypeErrorEnhancer( 23 | TextStyleHighlighterManager textStyleHighlighterManager, 24 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 25 | HighlighterIdProviderFactory highlighterIdProviderFactory) 26 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 27 | } 28 | 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/IncorrectYieldReturnTypeErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using GammaJul.ReSharper.EnhancedTooltip.Psi; 3 | using JetBrains.Application.Parts; 4 | using JetBrains.ProjectModel; 5 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 6 | using JetBrains.ReSharper.Psi.CodeAnnotations; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class IncorrectYieldReturnTypeErrorEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(IncorrectYieldReturnTypeError highlighting, CSharpColorizer colorizer) { 14 | bool appendModuleName = highlighting.ValueType.HasSameFullNameAs(highlighting.YieldType); 15 | 16 | colorizer.AppendPlainText("Cannot convert expression type '"); 17 | colorizer.AppendExpressionType(highlighting.ValueType, appendModuleName, PresenterOptions.FullWithoutParameterNames); 18 | colorizer.AppendPlainText("' to yield type '"); 19 | colorizer.AppendExpressionType(highlighting.YieldType, appendModuleName, PresenterOptions.FullWithoutParameterNames); 20 | colorizer.AppendPlainText("'"); 21 | } 22 | 23 | public IncorrectYieldReturnTypeErrorEnhancer( 24 | TextStyleHighlighterManager textStyleHighlighterManager, 25 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 26 | HighlighterIdProviderFactory highlighterIdProviderFactory) 27 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 28 | } 29 | 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/PossibleNullReferenceExceptionWarningEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi; 6 | using JetBrains.ReSharper.Psi.CodeAnnotations; 7 | 8 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 9 | 10 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 11 | internal sealed class PossibleNullReferenceExceptionWarningEnhancer : CSharpHighlightingEnhancer { 12 | 13 | protected override void AppendTooltip(PossibleNullReferenceExceptionWarning highlighting, CSharpColorizer colorizer) { 14 | colorizer.AppendPlainText("Possible '"); 15 | colorizer.AppendNamespaceName("System"); 16 | colorizer.AppendPlainText("."); 17 | colorizer.AppendClassName("NullReferenceException"); 18 | colorizer.AppendPlainText("'"); 19 | } 20 | 21 | public PossibleNullReferenceExceptionWarningEnhancer( 22 | TextStyleHighlighterManager textStyleHighlighterManager, 23 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 24 | HighlighterIdProviderFactory highlighterIdProviderFactory) 25 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 26 | } 27 | 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/CSharp/ReturnTypeIsVoidErrorEnhancer.cs: -------------------------------------------------------------------------------- 1 | using GammaJul.ReSharper.EnhancedTooltip.DocumentMarkup; 2 | using JetBrains.Application.Parts; 3 | using JetBrains.ProjectModel; 4 | using JetBrains.ReSharper.Daemon.CSharp.Errors; 5 | using JetBrains.ReSharper.Psi.CodeAnnotations; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings.CSharp { 8 | 9 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 10 | internal sealed class ReturnTypeIsVoidErrorEnhancer : CSharpHighlightingEnhancer { 11 | 12 | protected override void AppendTooltip(ReturnTypeIsVoidError highlighting, CSharpColorizer colorizer) { 13 | colorizer.AppendPlainText("Return type is '"); 14 | colorizer.AppendKeyword("void"); 15 | colorizer.AppendPlainText("'"); 16 | } 17 | 18 | public ReturnTypeIsVoidErrorEnhancer( 19 | TextStyleHighlighterManager textStyleHighlighterManager, 20 | CodeAnnotationsConfiguration codeAnnotationsConfiguration, 21 | HighlighterIdProviderFactory highlighterIdProviderFactory) 22 | : base(textStyleHighlighterManager, codeAnnotationsConfiguration, highlighterIdProviderFactory) { 23 | } 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/HighlightingEnhancerManager.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using GammaJul.ReSharper.EnhancedTooltip.ExternalHighlightings; 5 | using GammaJul.ReSharper.EnhancedTooltip.Utils; 6 | using JetBrains.Application.Parts; 7 | using JetBrains.Application.Settings; 8 | using JetBrains.ProjectModel; 9 | using JetBrains.ReSharper.Feature.Services.Daemon; 10 | using JetBrains.UI.RichText; 11 | 12 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings 13 | { 14 | 15 | [SolutionComponent(Instantiation.ContainerAsyncAnyThreadUnsafe)] 16 | public sealed class HighlightingEnhancerManager { 17 | private readonly Dictionary _HighlightingEnhancers; 18 | public RichText? TryEnhance(IHighlighting? highlighting, IContextBoundSettingsStore settings) { 19 | var highlightingType = highlighting?.GetType().GetExternalHighlightingType(); 20 | if (highlighting is null || !this._HighlightingEnhancers.TryGetValue(highlightingType ?? highlighting.GetType(), out IHighlightingEnhancer highlightingEnhancer)) { 21 | return null; 22 | } 23 | 24 | return highlightingEnhancer.TryEnhance(highlighting, settings); 25 | } 26 | 27 | public HighlightingEnhancerManager(IEnumerable highlightingEnhancers) { 28 | this._HighlightingEnhancers = highlightingEnhancers.ToDictionary(he => he.HighlightingType); 29 | } 30 | 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/Highlightings/IHighlightingEnhancer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using JetBrains.Application.Settings; 3 | using JetBrains.ReSharper.Feature.Services.Daemon; 4 | using JetBrains.UI.RichText; 5 | 6 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation.Highlightings { 7 | 8 | public interface IHighlightingEnhancer { 9 | 10 | Type HighlightingType { get; } 11 | 12 | RichText? TryEnhance(IHighlighting highlighting, IContextBoundSettingsStore settings); 13 | 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/IColorizer.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.ReSharper.Psi; 2 | using JetBrains.ReSharper.Psi.Resolve; 3 | using JetBrains.ReSharper.Psi.Tree; 4 | 5 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 6 | 7 | internal interface IColorizer { 8 | 9 | PresentedInfo AppendDeclaredElement( 10 | IDeclaredElement element, 11 | ISubstitution substitution, 12 | PresenterOptions options, 13 | ITreeNode? contextualNode); 14 | 15 | void AppendPresentableNode( 16 | ITreeNode treeNode, 17 | PresenterOptions options); 18 | 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/IPresentableNodeFinder.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.ReSharper.Psi; 2 | using JetBrains.ReSharper.Psi.Tree; 3 | using JetBrains.Util; 4 | 5 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 6 | 7 | /// 8 | /// Implement to find an or presentable that isn't coming from a reference nor a declaration. 9 | /// 10 | internal interface IPresentableNodeFinder { 11 | 12 | DeclaredElementInstance? FindDeclaredElement(ITreeNode node, IFile file, out TextRange sourceRange); 13 | 14 | PresentableNode FindPresentableNode(ITreeNode node); 15 | 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/IReSharperTooltipContent.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.UI.RichText; 2 | using JetBrains.Util; 3 | 4 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 5 | 6 | public interface IReSharperTooltipContent { 7 | 8 | RichText? Text { get; } 9 | 10 | TextRange TrackingRange { get; } 11 | 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/IconScaling.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | using System.Windows.Documents; 4 | using JetBrains.Util; 5 | 6 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 7 | 8 | public static class IconScaling { 9 | 10 | public static readonly DependencyProperty IsScalingWithFontSizeProperty = DependencyProperty.RegisterAttached( 11 | "IsScalingWithFontSize", 12 | typeof(bool), 13 | typeof(IconScaling), 14 | new FrameworkPropertyMetadata(BooleanBoxes.False, OnFontSizeForScaleChanged)); 15 | 16 | public static double GetIsScalingWithFontSize(DependencyObject owner) 17 | => (double) owner.GetValue(IsScalingWithFontSizeProperty); 18 | 19 | public static void SetIsScalingWithFontSize(DependencyObject owner, bool value) 20 | => owner.SetValue(IsScalingWithFontSizeProperty, value); 21 | 22 | private static void OnFontSizeForScaleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { 23 | if (d is not FrameworkElement element || TextElement.GetFontFamily(element) is not { } fontFamily) 24 | return; 25 | 26 | double fontSize = TextElement.GetFontSize(element); 27 | if (Double.IsNaN(fontSize)) 28 | return; 29 | 30 | double size = fontFamily.LineSpacing * fontSize; 31 | if (size < 18.0) { 32 | // Scaling isn't a real need at these small sizes, use the best looking 16x16 instead. 33 | size = 16.0; 34 | } 35 | element.Width = element.Height = size; 36 | } 37 | 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/IdentifierContentGroup.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 4 | 5 | public class IdentifierContentGroup { 6 | 7 | public List Identifiers { get; } = new(); 8 | 9 | public ArgumentRoleTooltipContent? ArgumentRole { get; set; } 10 | 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/IdentifierTooltipContent.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using JetBrains.UI.Icons; 3 | using JetBrains.UI.RichText; 4 | using JetBrains.Util; 5 | 6 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 7 | 8 | public class IdentifierTooltipContent : TooltipContent { 9 | 10 | public IconId? Icon { get; set; } 11 | 12 | public RichText? Description { get; set; } 13 | 14 | public RichText? Obsolete { get; set; } 15 | 16 | public RichText? Return { get; set; } 17 | 18 | public List Parameters { get; } = new(); 19 | 20 | public RichText? Value { get; set; } 21 | 22 | public RichText? Remarks { get; set; } 23 | 24 | public int? OverloadCount { get; set; } 25 | 26 | public List Exceptions { get; } = new(); 27 | 28 | public RichText? BaseType { get; set; } 29 | 30 | public List ImplementedInterfaces { get; } = new(); 31 | 32 | public AttributeUsageContent? AttributeUsage { get; set; } 33 | 34 | public IdentifierTooltipContent(RichText? text, TextRange trackingRange) 35 | : base(text, trackingRange) { 36 | } 37 | 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/IssueTooltipContent.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.UI.Icons; 2 | using JetBrains.UI.RichText; 3 | using JetBrains.Util; 4 | 5 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 6 | 7 | public class IssueTooltipContent : TooltipContent { 8 | 9 | public IconId? Icon { get; set; } 10 | 11 | public IssueTooltipContent(RichText? text, TextRange trackingRange) 12 | : base(text, trackingRange) { 13 | } 14 | 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/MiscTooltipContent.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.UI.RichText; 2 | using JetBrains.Util; 3 | 4 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 5 | 6 | public class MiscTooltipContent : TooltipContent { 7 | 8 | public MiscTooltipContent(RichText? text, TextRange trackingRange) 9 | : base(text, trackingRange) { 10 | } 11 | 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/NonCSharpTooltipContent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using JetBrains.UI.RichText; 3 | using JetBrains.Util; 4 | using JetBrains.VsIntegration.TextControl; 5 | 6 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 7 | 8 | public class NonCSharpTooltipContent { 9 | public Object Content { get; set; } 10 | public NonCSharpTooltipContent(Object content) { 11 | this.Content = content; 12 | } 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/ParamContent.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using JetBrains.UI.RichText; 3 | 4 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 5 | 6 | public sealed class ParamContent { 7 | 8 | public RichText Name { get; } 9 | 10 | public RichText? Description { get; set; } 11 | 12 | public Boolean IsTypeParameter { get; set; } 13 | 14 | public ParamContent(RichText name) { 15 | this.Name = name; 16 | } 17 | 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/PresentableNode.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.ReSharper.Psi.Tree; 2 | using JetBrains.UI.Icons; 3 | 4 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 5 | 6 | public readonly struct PresentableNode { 7 | 8 | public readonly ITreeNode? Node; 9 | 10 | public readonly IconId? Icon; 11 | 12 | public PresentableNode(ITreeNode? node, IconId? icon) { 13 | Node = node; 14 | Icon = icon; 15 | } 16 | 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/PresentedInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using JetBrains.Util; 3 | 4 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 5 | 6 | public sealed class PresentedInfo { 7 | 8 | public List Parameters { get; } = new(); 9 | 10 | public List TypeParameters { get; } = new(); 11 | 12 | public bool IsExtensionMethod { get; set; } 13 | 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/QualifierDisplays.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 4 | 5 | [Flags] 6 | public enum QualifierDisplays { 7 | None = 0, 8 | Member = 1 << 0, 9 | ElementType = 1 << 1, 10 | TypeParameters = 1 << 2, 11 | Parameters = 1 << 3, 12 | Everywhere = Member | ElementType | TypeParameters | Parameters 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/StringToWrappedTextBlockConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.Windows; 4 | using System.Windows.Controls; 5 | using System.Windows.Data; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 8 | 9 | public sealed class StringToWrappedTextBlockConverter : IValueConverter { 10 | 11 | public object? Convert(object value, Type targetType, object parameter, CultureInfo culture) 12 | => value switch { 13 | null => null, 14 | string stringValue => new TextBlock { Text = stringValue, TextWrapping = TextWrapping.Wrap }, 15 | _ => value 16 | }; 17 | 18 | public object? ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 19 | => value switch { 20 | null => null, 21 | TextBlock textBlock => textBlock.Text, 22 | _ => value 23 | }; 24 | 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/TooltipContent.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.UI.RichText; 2 | using JetBrains.Util; 3 | 4 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 5 | 6 | public abstract class TooltipContent : IReSharperTooltipContent { 7 | 8 | public RichText? Text { get; } 9 | 10 | public TextRange TrackingRange { get; } 11 | 12 | protected TooltipContent(RichText? text, TextRange trackingRange) { 13 | Text = text; 14 | TrackingRange = trackingRange; 15 | } 16 | 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/UIResources.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows; 3 | using System.Windows.Controls; 4 | using JetBrains.Application; 5 | using JetBrains.Application.UI.Extensions; 6 | using JetBrains.ReSharper.Resources.Shell; 7 | using JetBrains.Util; 8 | 9 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 10 | 11 | [ShellComponent] 12 | internal sealed class UIResources { 13 | 14 | public static UIResources Instance 15 | => Shell.Instance.GetComponent(); 16 | 17 | private readonly Lazy _lazyResourceDictionary = Lazy.Of(LoadResourceDictionary, true); 18 | 19 | public Style HeaderedContentControlStyle 20 | => (Style) _lazyResourceDictionary.Value["HeaderedContentControlStyle"]; 21 | 22 | public Style QuickInfoListBoxStyle 23 | => (Style) _lazyResourceDictionary.Value["QuickInfoListBoxStyle"]; 24 | 25 | public DataTemplate QuickInfoItemDataTemplate 26 | => (DataTemplate) _lazyResourceDictionary.Value["QuickInfoItemDataTemplate"]; 27 | 28 | public DataTemplate LegacyQuickInfoItemDataTemplate 29 | => (DataTemplate) _lazyResourceDictionary.Value["LegacyQuickInfoItemDataTemplate"]; 30 | 31 | public ControlTemplate QuickInfoRootControlTemplate 32 | => (ControlTemplate) _lazyResourceDictionary.Value["QuickInfoRootControlTemplate"]; 33 | 34 | private static ResourceDictionary LoadResourceDictionary() 35 | => new ResourceDictionary { 36 | Source = new Uri(string.Format("pack://application:,,,/{0};component/{1}", (object) typeof(UIResources).Assembly.FullName, (object) "Presentation/UIResources.xaml")) 37 | }; 38 | 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/VsIdentifierContent.cs: -------------------------------------------------------------------------------- 1 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 2 | 3 | public class VsIdentifierContent { 4 | 5 | public object Content { get; } 6 | 7 | public VsIdentifierContent(object content) 8 | => Content = content; 9 | 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Presentation/VsSquiggleContent.cs: -------------------------------------------------------------------------------- 1 | namespace GammaJul.ReSharper.EnhancedTooltip.Presentation { 2 | 3 | public class VsSquiggleContent { 4 | 5 | public string Content { get; } 6 | 7 | public VsSquiggleContent(string content) 8 | => Content = content; 9 | 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | [assembly: AssemblyTitle("GammaJul.ReSharper.EnhancedTooltip")] 4 | [assembly: AssemblyDescription("Enhances the tooltip and parameter information with colors.")] 5 | [assembly: AssemblyConfiguration("")] 6 | [assembly: AssemblyCompany("Julien Lebosquain, Gainedge org")] 7 | [assembly: AssemblyProduct("GammaJul.ReSharper.EnhancedTooltip")] 8 | [assembly: AssemblyCopyright("Copyright © 2013-2025 Gainedge org, Julien Lebosquain")] 9 | [assembly: AssemblyTrademark("")] 10 | [assembly: AssemblyCulture("")] 11 | 12 | [assembly: AssemblyVersion("3.28.1.0")] -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace GammaJul.ReSharper.EnhancedTooltip.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "GammaJul.ReSharper.EnhancedTooltip": { 4 | "commandName": "Executable", 5 | "executablePath": "%ProgramFiles(x86)%\\Microsoft Visual Studio\\2019\\Professional\\Common7\\IDE\\devenv.exe", 6 | "commandLineArgs": "/RootSuffix RsDev /ReSharper.Internal" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Psi/CSharpInvocationCandidateCountProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JetBrains.ReSharper.Psi; 3 | using JetBrains.ReSharper.Psi.CSharp; 4 | using JetBrains.ReSharper.Psi.CSharp.Resolve; 5 | using JetBrains.ReSharper.Psi.CSharp.Tree; 6 | using JetBrains.ReSharper.Psi.Resolve; 7 | using JetBrains.ReSharper.Psi.Tree; 8 | 9 | namespace GammaJul.ReSharper.EnhancedTooltip.Psi { 10 | 11 | [Language(typeof(CSharpLanguage))] 12 | internal sealed class CSharpInvocationCandidateCountProvider : IInvocationCandidateCountProvider { 13 | 14 | public int? TryGetInvocationCandidateCount(IReference reference) 15 | => FindInvocationReference(reference)?.GetCandidates().Count(); 16 | 17 | private static ICSharpInvocationReference? FindInvocationReference(IReference reference) { 18 | if (reference is ICSharpInvocationReference invocationReference) 19 | return invocationReference; 20 | 21 | ITreeNode treeNode = reference.GetTreeNode(); 22 | var argumentsOwner = treeNode.GetContainingNode(); 23 | if (argumentsOwner?.LBound is { } lBound && treeNode.GetTreeEndOffset() <= lBound.GetTreeStartOffset()) 24 | return argumentsOwner.Reference; 25 | 26 | return null; 27 | } 28 | 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Psi/ExpressionTypeExtensions.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.ReSharper.Psi; 2 | using JetBrains.ReSharper.Psi.CSharp; 3 | 4 | namespace GammaJul.ReSharper.EnhancedTooltip.Psi { 5 | 6 | public static class ExpressionTypeExtensions { 7 | 8 | public static bool HasSameFullNameAs(this IExpressionType? source, IExpressionType? other) 9 | => source is not null 10 | && other is not null 11 | && source.GetLongPresentableName(CSharpLanguage.Instance!) == other.GetLongPresentableName(CSharpLanguage.Instance!); 12 | 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Psi/IInvocationCandidateCountProvider.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.ReSharper.Psi.Resolve; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Psi { 4 | 5 | internal interface IInvocationCandidateCountProvider { 6 | 7 | int? TryGetInvocationCandidateCount(IReference reference); 8 | 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Psi/TypeElementExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using JetBrains.Annotations; 3 | using JetBrains.ReSharper.Psi; 4 | 5 | namespace GammaJul.ReSharper.EnhancedTooltip.Psi { 6 | 7 | public static class TypeElementExtensions { 8 | 9 | [Pure] 10 | public static bool IsInSystemLikeNamespace(this ITypeElement typeElement) 11 | => typeElement.GetClrName().NamespaceNames.FirstOrDefault() == "System"; 12 | 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Settings/AttributesDisplayKind.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Settings { 4 | 5 | public enum AttributesDisplayKind { 6 | [Description("Never")] Never = 0, 7 | [Description("Only [NotNull] and [CanBeNull]")] NullnessAnnotations = 1, 8 | [Description("Only [NotNull], [CanBeNull], [ItemNotNull] and [ItemCanBeNull]")] NullnessAndItemNullnessAnnotations = 2, 9 | [Description("Only ReSharper annotations")] AllAnnotations = 3, 10 | [Description("Always")] Always = 4 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Settings/AttributesFormattingMode.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Settings { 4 | 5 | public enum AttributesFormattingMode { 6 | [Description("All on current line")] AllOnCurrentLine = 0, 7 | [Description("All on single new line")] AllOnNewLine = 1, 8 | [Description("One per line if multiple")] OnePerLineIfMultiple = 2, 9 | [Description("One per line")] OnePerLine = 3 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Settings/BaseTypeDisplayKind.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Settings { 4 | 5 | public enum BaseTypeDisplayKind { 6 | [Description("Never")] Never = 0, 7 | [Description("Only if in solution code")] SolutionCode = 1, 8 | [Description("Only if in solution code or in non-System namespace")] SolutionCodeAndNonSystemExternalCode = 2, 9 | [Description("Only if not System.Object")] OnlyIfNotSystemObject = 3, 10 | [Description("Always")] Always = 4 11 | } 12 | 13 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Settings/ConstructorReferenceDisplay.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Settings { 4 | 5 | public enum ConstructorReferenceDisplay { 6 | [Description("Constructor")] ConstructorOnly = 0, 7 | [Description("Type")] TypeOnly = 1, 8 | [Description("Constructor and type")] Both = 2 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Settings/DisplaySettings.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Media; 2 | using JetBrains.Application.Settings; 3 | 4 | namespace GammaJul.ReSharper.EnhancedTooltip.Settings { 5 | 6 | [SettingsKey(typeof(EnhancedTooltipSettingsRoot), "Settings determining how tooltips are displayed globally")] 7 | public class DisplaySettings { 8 | 9 | [SettingsEntry(true, "Limit tooltip width to percentage of screen width")] 10 | public bool LimitTooltipWidth { get; set; } 11 | 12 | [SettingsEntry(50, "Screen width limit (%)")] 13 | public int ScreenWidthLimitPercent { get; set; } 14 | 15 | [SettingsEntry(TextFormattingMode.Ideal, "Text display mode")] 16 | public TextFormattingMode TextFormattingMode { get; set; } 17 | 18 | [SettingsEntry(TooltipColorSource.TextEditorSettings, "Tooltip background and foreground")] 19 | public TooltipColorSource TooltipColorSource { get; set; } 20 | 21 | } 22 | 23 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Settings/EnhancedTooltipSettingsRoot.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Application.Settings; 2 | using JetBrains.ReSharper.Feature.Services.CodeCompletion.Settings; 3 | 4 | namespace GammaJul.ReSharper.EnhancedTooltip.Settings { 5 | 6 | [SettingsKey(typeof(IntellisenseSettingsKey), "Settings for the plugin EnhancedTooltip.")] 7 | public class EnhancedTooltipSettingsRoot { 8 | 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Settings/EnumValue.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using JetBrains.Annotations; 3 | 4 | namespace GammaJul.ReSharper.EnhancedTooltip.Settings { 5 | 6 | internal sealed class EnumValue { 7 | 8 | [UsedImplicitly] 9 | public Enum Value { get; } 10 | 11 | [UsedImplicitly] 12 | public string? Description { get; } 13 | 14 | public EnumValue(Enum value, string? description) { 15 | Value = value; 16 | Description = description; 17 | } 18 | 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Settings/ExternalCodeNamespaceDisplayKind.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Settings { 4 | 5 | public enum ExternalCodeNamespaceDisplayKind { 6 | [Description("Always")] Always = 0, 7 | [Description("Never")] Never = 1, 8 | [Description("Only for non System-namespaces")] OnlyForNonSystem = 2 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Settings/ImplementedInterfacesDisplayKind.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Settings { 4 | 5 | public enum ImplementedInterfacesDisplayKind { 6 | [Description("Never")] Never = 0, 7 | [Description("Only if in solution code")] SolutionCode = 1, 8 | [Description("Only if in solution code or in non-System namespace")] SolutionCodeAndNonSystemExternalCode = 2, 9 | [Description("Always")] Always = 3 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Settings/IssueTooltipSettings.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Application.Settings; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Settings { 4 | 5 | [SettingsKey(typeof(EnhancedTooltipSettingsRoot), "Settings determining how tooltips are shown for issues")] 6 | public class IssueTooltipSettings { 7 | 8 | [SettingsEntry(true, "Display an icon for issues")] 9 | public bool ShowIcon { get; set; } 10 | 11 | [SettingsEntry(true, "Colorize elements in errors when possible")] 12 | public bool ColorizeElementsInErrors { get; set; } 13 | 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Settings/ParameterInfoSettings.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Application.Settings; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Settings { 4 | 5 | [SettingsKey(typeof(EnhancedTooltipSettingsRoot), "Settings determining how information about parameters are shown when writing a call")] 6 | public class ParameterInfoSettings { 7 | 8 | [SettingsEntry(true, "Enhance parameter information popups")] 9 | public bool Enabled { get; set; } 10 | 11 | [SettingsEntry(true, "Colorize C# calls")] 12 | public bool ColorizeSupportedLanguages { get; set; } 13 | 14 | [SettingsEntry(true, "Display when there are no parameters")] 15 | public bool ShowEmptyParametersText { get; set; } 16 | 17 | [SettingsEntry(true, "Use type keywords (eg. int instead of Int32)")] 18 | public bool UseTypeKeywords { get; set; } 19 | 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Settings/ParametersFormattingMode.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Settings { 4 | 5 | public enum ParametersFormattingMode { 6 | [Description("All on current line")] AllOnCurrentLine = 0, 7 | [Description("All on single new line")] AllOnNewLine = 1, 8 | [Description("One per line if multiple")] OnePerLineIfMultiple = 2, 9 | [Description("One per line")] OnePerLine = 3 10 | } 11 | 12 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Settings/SettingsExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq.Expressions; 4 | using JetBrains.Application.Settings; 5 | using JetBrains.DocumentModel; 6 | using JetBrains.DocumentModel.DataContext; 7 | using JetBrains.ReSharper.Resources.Shell; 8 | 9 | namespace GammaJul.ReSharper.EnhancedTooltip.Settings { 10 | 11 | public static class SettingsExtensions { 12 | 13 | public static IContextBoundSettingsStore GetSettings(this IDocument document) 14 | => Shell.Instance 15 | .GetComponent() 16 | .BindToContextTransient(ContextRange.Smart(document.ToDataContext())); 17 | 18 | public static IContextBoundSettingsStore? TryGetSettings(this IDocument? document) 19 | => document is not null && Shell.HasInstance ? document.GetSettings() : null; 20 | 21 | public static bool IsEntryEqualToDefault( 22 | this IContextBoundSettingsStore store, 23 | Expression> settingsExpr) 24 | where T : struct 25 | => store.Schema.GetScalarEntry(settingsExpr).GetDefaultValueInEntryMemberType() is T defaultValue 26 | && EqualityComparer.Default.Equals(store.GetValue(settingsExpr), defaultValue); 27 | 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Settings/SolutionCodeNamespaceDisplayKind.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Settings { 4 | 5 | public enum SolutionCodeNamespaceDisplayKind { 6 | [Description("Always")] Always = 0, 7 | [Description("Never")] Never = 1, 8 | [Description("Smart (removes current namespace)")] Smart = 2 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Settings/TooltipColorSource.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Settings { 4 | 5 | public enum TooltipColorSource { 6 | [Description("Use Text Editor settings")] TextEditorSettings = 0, 7 | [Description("Use Environment settings")] EnvironmentSettings = 1 8 | } 9 | 10 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/Utils/Utils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace GammaJul.ReSharper.EnhancedTooltip.Utils { 4 | 5 | using System.Linq; 6 | using System.Reflection; 7 | 8 | using GammaJul.ReSharper.EnhancedTooltip.ExternalHighlightings; 9 | 10 | using JetBrains.Reflection; 11 | using JetBrains.ReSharper.Psi; 12 | 13 | public static class Utils { 14 | 15 | public static Object? GetDynamicFieldOrPropertySafe(this Object obj, String memberName) { 16 | try { 17 | return obj.GetDynamicFieldOrProperty(memberName); 18 | } catch { 19 | return null; 20 | } 21 | } 22 | 23 | public static Type? GetExternalHighlightingType(this Type sourceType) { 24 | var typeAssembly = Assembly.GetExecutingAssembly(); 25 | return typeAssembly.GetTypes().SingleOrDefault(t => t.IsInterface && t.Name == "I" + sourceType.Name && t.GetInterfaces().Contains(typeof(IExternalHighlighting))); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/VisualStudio/MainQuickInfoSourceProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.VisualStudio.Text; 4 | using Microsoft.VisualStudio.Utilities; 5 | 6 | namespace GammaJul.ReSharper.EnhancedTooltip.VisualStudio { 7 | 8 | [Name(Name)] 9 | [Order(After = QuickInfoSourceProviderNames.VsSquiggle)] 10 | [Order(After = QuickInfoSourceProviderNames.VsDefault)] 11 | [Order(After = QuickInfoSourceProviderNames.VsDefault2)] 12 | [Order(After = QuickInfoSourceProviderNames.VsRoslyn)] 13 | [Order(After = QuickInfoSourceProviderNames.VsLightBulb)] 14 | [Order(After = QuickInfoSourceProviderNames.VsSyntactic)] 15 | [Order(After = QuickInfoSourceProviderNames.VsSemantic)] 16 | [Order(After = QuickInfoSourceProviderNames.ReSharper)] 17 | [Order(After = VsSquiggleCollectorQuickInfoSourceProvider.Name)] 18 | [ContentType("any")] 19 | [Export(typeof(IQuickInfoSourceProvider))] 20 | public sealed class MainQuickInfoSourceProvider : QuickInfoSourceProviderBase { 21 | 22 | public const string Name = "EnhancedTooltip." + nameof(MainQuickInfoSourceProvider); 23 | 24 | protected override IQuickInfoSource CreateQuickInfoSource(ITextBuffer textBuffer) 25 | => new MainQuickInfoSource(textBuffer); 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/VisualStudio/QuickInfoSessionExtensions.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Util; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | 4 | namespace GammaJul.ReSharper.EnhancedTooltip.VisualStudio { 5 | 6 | internal static class QuickInfoSessionExtensions { 7 | 8 | private static readonly object _squiggleContentsPropertyKey = new(); 9 | 10 | public static void StoreVsSquiggleContents(this IQuickInfoSession session, object?[]? squiggleContents) { 11 | session.Properties[_squiggleContentsPropertyKey] = squiggleContents; 12 | } 13 | 14 | public static object?[] RetrieveVsSquiggleContents(this IQuickInfoSession? session) { 15 | if (session?.Properties is { } properties && properties.TryGetProperty(_squiggleContentsPropertyKey, out object?[]? squiggleContents)) { 16 | properties.RemoveProperty(_squiggleContentsPropertyKey); 17 | return squiggleContents ?? EmptyArray.Instance; 18 | } 19 | return EmptyArray.Instance; 20 | } 21 | 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/VisualStudio/QuickInfoSourceProviderBase.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Util.Logging; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.VisualStudio.Text; 4 | using Microsoft.VisualStudio.Text.Projection; 5 | using System; 6 | 7 | namespace GammaJul.ReSharper.EnhancedTooltip.VisualStudio { 8 | 9 | public abstract class QuickInfoSourceProviderBase : IQuickInfoSourceProvider { 10 | 11 | public IQuickInfoSource? TryCreateQuickInfoSource(ITextBuffer textBuffer) { 12 | if (textBuffer is IProjectionBufferBase) 13 | return null; 14 | 15 | try { 16 | return CreateQuickInfoSource(textBuffer); 17 | } 18 | catch (Exception ex) { 19 | Logger.LogException($"Problem while creating a quick info source for {GetType().FullName}", ex); 20 | return null; 21 | } 22 | } 23 | 24 | protected abstract IQuickInfoSource CreateQuickInfoSource(ITextBuffer textBuffer); 25 | 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/VisualStudio/QuickInfoSourceProviderNames.cs: -------------------------------------------------------------------------------- 1 | namespace GammaJul.ReSharper.EnhancedTooltip.VisualStudio { 2 | 3 | public static class QuickInfoSourceProviderNames { 4 | 5 | public const string VsSquiggle = "squiggle"; 6 | public const string VsDefault = "default"; 7 | public const string VsDefault2 = "Default Quick Info Presenter"; 8 | public const string VsRoslyn = "Roslyn Quick Info Presenter"; 9 | public const string VsLightBulb = "Default LightBulb QuickInfo Provider"; 10 | public const string VsSemantic = "Semantic Quick Info Provider"; 11 | public const string VsSyntactic = "Syntactic Quick Info Provider"; 12 | public const string ReSharper = "ReSharper Quick Info"; 13 | 14 | } 15 | 16 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/VisualStudio/SpanExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using JetBrains.Annotations; 3 | using Microsoft.VisualStudio.Text; 4 | 5 | namespace GammaJul.ReSharper.EnhancedTooltip.VisualStudio { 6 | 7 | public static class SpanExtensions { 8 | 9 | [Pure] 10 | public static Span Union(this Span x, Span? y) { 11 | if (y is not { } other) 12 | return x; 13 | 14 | return Span.FromBounds( 15 | Math.Min(x.Start, other.Start), 16 | Math.Max(x.End, other.End)); 17 | } 18 | 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/VisualStudio/VsFullTypeNames.cs: -------------------------------------------------------------------------------- 1 | namespace GammaJul.ReSharper.EnhancedTooltip.VisualStudio { 2 | 3 | internal static class VsFullTypeNames { 4 | 5 | public const string QuickInfoDisplayPanel = "Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.QuickInfo.QuickInfoDisplayPanel"; // VS < 15.8 6 | public const string ContainerElement = "Microsoft.VisualStudio.Text.Adornments.ContainerElement"; // VS >= 15.8 7 | public const string LightBulbQuickInfoPlaceHolder = "Microsoft.VisualStudio.Language.Intellisense.Implementation.LightBulbQuickInfoPlaceHolder"; 8 | 9 | } 10 | 11 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/VisualStudio/VsSquiggleCollectorQuickInfoSource.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using JetBrains.Annotations; 3 | using JetBrains.Application.Threading; 4 | using JetBrains.ReSharper.Resources.Shell; 5 | using JetBrains.TextControl.DocumentMarkup; 6 | using JetBrains.Util; 7 | using Microsoft.VisualStudio.Language.Intellisense; 8 | using Microsoft.VisualStudio.Text; 9 | 10 | namespace GammaJul.ReSharper.EnhancedTooltip.VisualStudio { 11 | 12 | /// 13 | /// This class only stores squiggles added by Roslyn inside the session, so they can be identified easily later in . 14 | /// 15 | public class VsSquiggleCollectorQuickInfoSource : QuickInfoSourceBase { 16 | 17 | protected override void AugmentQuickInfoSessionCore( 18 | IQuickInfoSession session, 19 | IList quickInfoContent, 20 | IDocumentMarkup documentMarkup, 21 | TooltipFormattingProvider tooltipFormattingProvider, 22 | out ITrackingSpan? applicableToSpan) { 23 | 24 | applicableToSpan = null; 25 | 26 | session.StoreVsSquiggleContents(quickInfoContent.ToArray()); 27 | } 28 | 29 | public VsSquiggleCollectorQuickInfoSource(ITextBuffer textBuffer) 30 | : base(textBuffer) { 31 | } 32 | 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/VisualStudio/VsSquiggleCollectorQuickInfoSourceProvider.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.Composition; 2 | using Microsoft.VisualStudio.Language.Intellisense; 3 | using Microsoft.VisualStudio.Text; 4 | using Microsoft.VisualStudio.Utilities; 5 | 6 | namespace GammaJul.ReSharper.EnhancedTooltip.VisualStudio { 7 | 8 | [Name(Name)] 9 | [Order(After = QuickInfoSourceProviderNames.VsDefault)] 10 | [Order(After = QuickInfoSourceProviderNames.VsDefault2)] 11 | [Order(After = QuickInfoSourceProviderNames.VsRoslyn)] 12 | [Order(After = QuickInfoSourceProviderNames.VsSyntactic)] 13 | [Order(After = QuickInfoSourceProviderNames.VsSemantic)] 14 | [Order(After = QuickInfoSourceProviderNames.VsSquiggle)] 15 | [Order(After = QuickInfoSourceProviderNames.VsLightBulb)] 16 | [Order(After = QuickInfoSourceProviderNames.ReSharper)] 17 | [Order(Before = MainQuickInfoSourceProvider.Name)] 18 | [ContentType("any")] 19 | [Export(typeof(IQuickInfoSourceProvider))] 20 | public sealed class VsSquiggleCollectorQuickInfoSourceProvider : QuickInfoSourceProviderBase { 21 | 22 | public const string Name = "EnhancedTooltip." + nameof(VsSquiggleCollectorQuickInfoSourceProvider); 23 | 24 | protected override IQuickInfoSource CreateQuickInfoSource(ITextBuffer textBuffer) 25 | => new VsSquiggleCollectorQuickInfoSource(textBuffer); 26 | 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /source/GammaJul.ReSharper.EnhancedTooltip/ZoneMarker.cs: -------------------------------------------------------------------------------- 1 | using JetBrains.Application.BuildScript.Application.Zones; 2 | using JetBrains.Platform.VisualStudio.SinceVs10.Zones; 3 | 4 | 5 | namespace GammaJul.ReSharper.EnhancedTooltip { 6 | 7 | [ZoneMarker] 8 | public class ZoneMarker : IRequire { 9 | } 10 | 11 | } --------------------------------------------------------------------------------