Пример #1
0
        public UnityOptionsPage(
            Lifetime lifetime,
            OptionsSettingsSmartContext optionsSettingsSmartContext,
            RunsProducts.ProductConfigurations productConfigurations)
            : base(lifetime, optionsSettingsSmartContext)
        {
            Header("General");

            CheckBox((UnitySettings s) => s.InstallUnity3DRiderPlugin, "Install or update Rider plugin automatically");

            Header("ShaderLab");

            CheckBox((UnitySettings s) => s.EnableShaderLabHippieCompletion, "Enable simple word-based completion in ShaderLab files");
            AddEmptyLine();

            CheckBox((UnitySettings s) => s.EnableShaderLabParsing,
                     "Parse ShaderLab files for syntax errors");

            AddEmptyLine();
            AddText("Disable this to avoid incorrect syntax error highlighting in .shader files.");
            AddText("The solution must be reopened when changed.");
            AddEmptyLine();
            AddText("Note that CGPROGRAM blocks are not currently checked for syntax errors.");

            if (productConfigurations.IsInternalMode())
            {
                CheckBox((UnitySettings s) => s.EnableCgErrorHighlighting, "Parse Cg files for syntax errors. Only works in internal mode.");
                AddText("Requires solution reopen, same as ShaderLab settings.");
            }

            FinishPage();
        }
Пример #2
0
        public UnityOptionsPage(
            Lifetime lifetime,
            OptionsSettingsSmartContext optionsSettingsSmartContext,
            RunsProducts.ProductConfigurations productConfigurations)
            : base(lifetime, optionsSettingsSmartContext)
        {
            Header("General");

            CheckBox((UnitySettings s) => s.InstallUnity3DRiderPlugin, "Install or update Rider plugin automatically");
            CheckBox((UnitySettings s) => s.AllowAutomaticRefreshInUnity, "Automatically refresh Assets in Unity");

            Header("UI");
            CheckBox((UnitySettings s) => s.HideSolutionConfiguration, "Hide Solution Configuration (requires solution reopen)");

            Header("ShaderLab");

            CheckBox((UnitySettings s) => s.EnableShaderLabHippieCompletion, "Enable simple word-based completion in ShaderLab files");

            if (productConfigurations.IsInternalMode())
            {
                AddEmptyLine();
                CheckBox((UnitySettings s) => s.EnableCgErrorHighlighting, "Parse Cg files for syntax errors. Only works in internal mode.");
                AddText("Requires solution reopen.");
            }

            FinishPage();
        }
Пример #3
0
        public UnityOptionsPage(Lifetime lifetime, OptionsSettingsSmartContext settingsStore,
                                RunsProducts.ProductConfigurations productConfigurations)
            : base(lifetime, settingsStore)
        {
            Header("General");

            CheckBox((UnitySettings s) => s.InstallUnity3DRiderPlugin, "Install or update Rider plugin automatically");
            CheckBox((UnitySettings s) => s.AllowAutomaticRefreshInUnity, "Automatically refresh Assets in Unity");

            AddNamingSection(lifetime, settingsStore);

            Header("ShaderLab");

            CheckBox((UnitySettings s) => s.EnableShaderLabHippieCompletion,
                     "Enable simple word-based completion in ShaderLab files");

            if (productConfigurations.IsInternalMode())
            {
                AddEmptyLine();
                CheckBox((UnitySettings s) => s.EnableCgErrorHighlighting,
                         "Parse Cg files for syntax errors. Only works in internal mode.");
                AddText("Requires solution reopen.");
            }

            Header("C# code analysis");
            CheckBox((UnitySettings s) => s.EnablePerformanceCriticalCodeHighlighting,
                     "Enable highlighting of costly methods and indirect calls for these methods in performance critical code sections");

            FinishPage();
        }
        public ShaderLabTypingAssist(
            Lifetime lifetime,
            [NotNull] ISolution solution,
            [NotNull] IPsiServices psiServices,
            [NotNull] ICommandProcessor commandProcessor,
            [NotNull] ISettingsStore settingsStore,
            [NotNull] InjectedHlslDummyFormatter injectedHlslDummyFormatter,
            [NotNull] RunsProducts.ProductConfigurations productConfigurations,
            [NotNull] CachingLexerService cachingLexerService,
            [NotNull] ITypingAssistManager typingAssistManager,
            [NotNull] IExternalIntellisenseHost externalIntellisenseHost,
            [NotNull] SkippingTypingAssist skippingTypingAssist,
            [NotNull] LastTypingAction lastTypingAssistAction,
            [NotNull] StructuralRemoveManager structuralRemoveManager)
            : base(solution, settingsStore, cachingLexerService, commandProcessor, psiServices,
                   externalIntellisenseHost,
                   skippingTypingAssist, lastTypingAssistAction, structuralRemoveManager)
        {
            myInjectedHlslDummyFormatter = injectedHlslDummyFormatter;
            myCachingLexerService        = cachingLexerService;

            typingAssistManager.AddActionHandler(lifetime, TextControlActions.ActionIds.Enter, this, HandleEnterAction, IsActionHandlerAvailable);
            typingAssistManager.AddActionHandler(lifetime, TextControlActions.ActionIds.Backspace, this, HandleBackspaceAction, IsActionHandlerAvailable);
            typingAssistManager.AddActionHandler(lifetime, TextControlActions.ActionIds.Tab, this, HandleTabPressed,
                                                 IsActionHandlerAvailable);
            typingAssistManager.AddActionHandler(lifetime, TextControlActions.ActionIds.TabLeft, this,
                                                 HandleTabLeftPressed,
                                                 IsActionHandlerAvailable);
        }
Пример #5
0
        public ReSharperOptionsPage([NotNull] Lifetime lifetime, [NotNull] OptionsSettingsSmartContext settingsStore,
                                    RunsProducts.ProductConfigurations productConfigurations)
            : base(lifetime, settingsStore)
        {
            Header("General");

            CheckBox((UnitySettings s) => s.IsYamlParsingEnabled,
                     "Parse text based asset files for implicit script usages");

            Header("C#");
            CheckBox((UnitySettings s) => s.EnablePerformanceCriticalCodeHighlighting,
                     "Highlight expensive method calls in frequently called code");

            // The default is when code vision is disabled. Let's keep this so that if/when ReSharper ever gets Code
            // Vision, we'll show the items, or if the user installs Rider, the copied settings will still be useful
            AddBoolOption((UnitySettings s) => s.GutterIconMode,
                          GutterIconMode.CodeInsightDisabled, GutterIconMode.None,
                          "Show gutter icons for implicit script usages:");

            if (productConfigurations.IsInternalMode())
            {
                Header("Internal");

                CheckBox((UnitySettings s) => s.EnableCgErrorHighlighting,
                         "Parse Cg files for syntax errors (requires internal mode, and re-opening solution)");
            }

            FinishPage();
        }
 public IdentifierHighlightingStage(ResolveHighlighterRegistrar registrar, ConfigurableIdentifierHighlightingStageService identifierHighlightingStageService,
                                    RunsProducts.ProductConfigurations productConfigurations)
 {
     myRegistrar = registrar;
     myIdentifierHighlightingStageService = identifierHighlightingStageService;
     myInternalMode = productConfigurations.IsInternalMode();
 }
Пример #7
0
        public UnityOptionsPage(Lifetime lifetime, OptionsSettingsSmartContext settingsStore,
                                RunsProducts.ProductConfigurations productConfigurations)
            : base(lifetime, settingsStore)
        {
            Header("General");
            CheckBox((UnitySettings s) => s.InstallUnity3DRiderPlugin,
                     "Automatically install and update Rider's Unity editor plugin (recommended)");
            CheckBox((UnitySettings s) => s.AllowAutomaticRefreshInUnity, "Automatically refresh assets in Unity");

            Header("C#");
            CheckBox(ourEnablePerformanceHighlightingAccessor,
                     "Enable performance analysis in frequently called code");

            BeginSection();
            {
                var option = WithIndent(AddComboOption((UnitySettings s) => s.PerformanceHighlightingMode,
                                                       "Highlight performance critical contexts:",
                                                       new RadioOptionPoint(PerformanceHighlightingMode.Always, "Always"),
                                                       new RadioOptionPoint(PerformanceHighlightingMode.CurrentMethod, "Current method only"),
                                                       new RadioOptionPoint(PerformanceHighlightingMode.Never, "Never")
                                                       ));
                AddBinding(option, BindingStyle.IsEnabledProperty, ourEnablePerformanceHighlightingAccessor,
                           enable => enable);
                option = WithIndent(CheckBox((UnitySettings s) => s.EnableIconsForPerformanceCriticalCode,
                                             "Show icons for frequently called methods"));
                AddBinding(option, BindingStyle.IsEnabledProperty, ourEnablePerformanceHighlightingAccessor,
                           enable => enable);
            }
            EndSection();

            AddComboOption((UnitySettings s) => s.GutterIconMode, "Show gutter icons for implicit script usages:",
                           new RadioOptionPoint(GutterIconMode.Always, "Always"),
                           new RadioOptionPoint(GutterIconMode.CodeInsightDisabled, "When Code Vision is disabled"),
                           new RadioOptionPoint(GutterIconMode.None, "Never")
                           );

            AddNamingSection(lifetime, settingsStore);

            Header("Text based assets");
            CheckBox((UnitySettings s) => s.IsYamlParsingEnabled,
                     "Parse text based asset files for script and event handler usages (requires re-opening solution)");
            CheckBox((UnitySettings s) => s.EnableInspectorPropertiesEditor,
                     "Show Inspector values in the editor");

            Header("ShaderLab");
            CheckBox((UnitySettings s) => s.EnableShaderLabHippieCompletion,
                     "Enable simple word-based completion in ShaderLab files");

            if (productConfigurations.IsInternalMode())
            {
                Header("Internal");

                CheckBox((UnitySettings s) => s.EnableCgErrorHighlighting,
                         "Parse Cg files for syntax errors (requires internal mode, and re-opening solution)");
            }

            FinishPage();
        }
Пример #8
0
        public InjectedHlslTypingAssist(
            Lifetime lifetime,
            [NotNull] ISolution solution,
            [NotNull] IPsiServices psiServices,
            [NotNull] ICommandProcessor commandProcessor,
            [NotNull] ISettingsStore settingsStore,
            [NotNull] RunsProducts.ProductConfigurations productConfigurations,
            [NotNull] CachingLexerService cachingLexerService,
            [NotNull] ITypingAssistManager typingAssistManager,
            [NotNull] IExternalIntellisenseHost externalIntellisenseHost,
            [NotNull] SkippingTypingAssist skippingTypingAssist,
            [NotNull] LastTypingAction lastTypingAssistAction,
            [NotNull] InjectedHlslDummyFormatter dummyFormatter,
            [NotNull] StructuralRemoveManager structuralRemoveManager)
            : base(solution, settingsStore, cachingLexerService, commandProcessor, psiServices, externalIntellisenseHost,
                   skippingTypingAssist, lastTypingAssistAction, structuralRemoveManager)
        {
            myCachingLexerService = cachingLexerService;
            myDummyFormatter      = dummyFormatter;
            var braceHandler  = new InjectedHlslBraceHandler(this, dummyFormatter, false, productConfigurations.IsInternalMode());
            var quoteHandler  = new CppQuoteHandler <ShaderLabLanguage>(this);
            var deleteHandler = new CppDeleteHandler <ShaderLabLanguage>(this, dummyFormatter);

            typingAssistManager.AddTypingHandler(lifetime, '{', this, c => ExecuteTypingInCppContextOnly(c, braceHandler.HandleLeftBraceTyped),
                                                 IsTypingHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '}', this, c => ExecuteTypingInCppContextOnly(c, braceHandler.HandleRightBraceTyped),
                                                 IsTypingHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '(', this, c => ExecuteTypingInCppContextOnly(c, braceHandler.HandleLeftBracketOrParenthTyped),
                                                 IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '<', this, c => ExecuteTypingInCppContextOnly(c, braceHandler.HandleLTTyped),
                                                 IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '>', this, c => ExecuteTypingInCppContextOnly(c, braceHandler.HandleRightBracketTyped),
                                                 IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '[', this, c => ExecuteTypingInCppContextOnly(c, braceHandler.HandleLeftBracketOrParenthTyped),
                                                 IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, ']', this, c => ExecuteTypingInCppContextOnly(c, braceHandler.HandleRightBracketTyped),
                                                 IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, ')', this, c => ExecuteTypingInCppContextOnly(c, braceHandler.HandleRightBracketTyped),
                                                 IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '"', this, c => ExecuteTypingInCppContextOnly(c, quoteHandler.HandleQuoteTyped),
                                                 IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '\'', this, c => ExecuteTypingInCppContextOnly(c, quoteHandler.HandleQuoteTyped),
                                                 IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, ';', this, c => ExecuteTypingInCppContextOnly(c, braceHandler.HandleSemicolonTyped),
                                                 IsCorrectCommonTyposAvailable);
            typingAssistManager.AddTypingHandler(lifetime, ':', this, c => ExecuteTypingInCppContextOnly(c, braceHandler.HandleColonTyped),
                                                 IsTypingHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '*', this, c => ExecuteTypingInCppContextOnly(c, braceHandler.HandleStarTyped),
                                                 IsCorrectCommonTyposAvailable);

            typingAssistManager.AddActionHandler(lifetime, TextControlActions.ActionIds.Backspace, this,
                                                 c => ExecuteActionInCppContextOnly(c, deleteHandler.HandleBackspacePressed), IsActionHandlerAvailable);
            typingAssistManager.AddActionHandler(lifetime, TextControlActions.ActionIds.Enter, this,
                                                 c => ExecuteActionInCppContextOnly(c, braceHandler.HandleEnterTyped), IsActionHandlerAvailable);
            typingAssistManager.AddActionHandler(lifetime, EditorStartNewLineBeforeAction.ACTION_ID, this,
                                                 c => ExecuteActionInCppContextOnly(c, braceHandler.HandleStartNewLineBeforePressed), IsActionHandlerAvailable);
        }
Пример #9
0
        public CgSupportSettings(Lifetime lifetime, ISettingsStore settingsStore, RunsProducts.ProductConfigurations productConfigurations)
        {
            var boundStore = settingsStore.BindToContextLive(lifetime, ContextRange.ApplicationWide);

            IsErrorHighlightingEnabled = boundStore.GetValueProperty(lifetime, (UnitySettings s) => s.EnableCgErrorHighlighting);

            if (!productConfigurations.IsInternalMode())
            {
                IsErrorHighlightingEnabled.SetValue(lifetime, false);
            }
        }
Пример #10
0
        public CgSupportSettings(Lifetime lifetime, IApplicationWideContextBoundSettingStore settingsStore,
                                 RunsProducts.ProductConfigurations productConfigurations)
        {
            IsErrorHighlightingEnabled = settingsStore.BoundSettingsStore
                                         .GetValueProperty(lifetime, (UnitySettings s) => s.EnableCgErrorHighlighting);

            if (!productConfigurations.IsInternalMode())
            {
                IsErrorHighlightingEnabled.SetValue(lifetime, false);
            }
        }
Пример #11
0
        public ReSharperOptionsPage(Lifetime lifetime, OptionsPageContext pageContext,
                                    [NotNull] OptionsSettingsSmartContext settingsStore,
                                    RunsProducts.ProductConfigurations productConfigurations)
            : base(lifetime, pageContext, settingsStore)
        {
            AddHeader("C#");
            AddBoolOption(ourEnableBurstHighlightingAccessor, "Enable analysis for Burst compiler issues");
            AddBoolOption(ourEnablePerformanceHighlightingAccessor,
                          "Enable performance analysis in frequently called code");

            using (Indent())
            {
                var option = AddComboOption((UnitySettings s) => s.PerformanceHighlightingMode,
                                            "Highlight performance critical contexts:", string.Empty, string.Empty,
                                            new RadioOptionPoint(PerformanceHighlightingMode.Always, "Always"),
                                            new RadioOptionPoint(PerformanceHighlightingMode.CurrentMethod, "Current method only"),
                                            new RadioOptionPoint(PerformanceHighlightingMode.Never, "Never")
                                            );
                AddBinding(option, BindingStyle.IsEnabledProperty, ourEnablePerformanceHighlightingAccessor,
                           enable => enable);
                option = AddBoolOption((UnitySettings s) => s.EnableIconsForPerformanceCriticalCode,
                                       "Show icons for frequently called methods");
                AddBinding(option, BindingStyle.IsEnabledProperty, ourEnablePerformanceHighlightingAccessor,
                           enable => enable);
            }

            // The default is when code vision is disabled. Let's keep this so that if/when ReSharper ever gets Code
            // Vision, we'll show the items, or if the user installs Rider, the copied settings will still be useful
            AddBoolOption((UnitySettings s) => s.GutterIconMode,
                          GutterIconMode.CodeInsightDisabled, GutterIconMode.None,
                          "Show gutter icons for implicit script usages");

            AddHeader("Text based assets");
            AddBoolOption((UnitySettings s) => s.IsAssetIndexingEnabled,
                          "Parse text based asset files for implicit script usages (requires re-opening solution)");


            AddHeader("Shaders");
            AddBoolOption((UnitySettings s) => s.SuppressShaderErrorHighlighting,
                          "Suppress resolve errors of unqualified names");

            if (productConfigurations.IsInternalMode())
            {
                AddHeader("Internal");

                AddBoolOption((UnitySettings s) => s.SuppressShaderErrorHighlightingInRenderPipelinePackages,
                              "Suppress resolve errors in render-pipeline packages");

                AddBoolOption((UnitySettings s) => s.EnableCgErrorHighlighting,
                              "[Deprecated] Parse GLSL files for syntax errors (requires internal mode, and re-opening solution)");
            }
        }
Пример #12
0
        public ReSharperOptionsPage(Lifetime lifetime, [NotNull] OptionsSettingsSmartContext settingsStore,
                                    RunsProducts.ProductConfigurations productConfigurations)
            : base(lifetime, settingsStore)
        {
            Header("C#");
            CheckBox((UnitySettings s) => s.EnableBurstCodeHighlighting,
                     "Enable analysis for Burst compiler issues");
            CheckBox((UnitySettings s) => s.EnablePerformanceCriticalCodeHighlighting,
                     "Enable performance analysis in frequently called code");

            BeginSection();
            {
                var option = WithIndent(AddComboOption((UnitySettings s) => s.PerformanceHighlightingMode,
                                                       "Highlight performance critical contexts:",
                                                       new RadioOptionPoint(PerformanceHighlightingMode.Always, "Always"),
                                                       new RadioOptionPoint(PerformanceHighlightingMode.CurrentMethod, "Current method only"),
                                                       new RadioOptionPoint(PerformanceHighlightingMode.Never, "Never")
                                                       ));
                AddBinding(option, BindingStyle.IsEnabledProperty, ourEnablePerformanceHighlightingAccessor,
                           enable => enable);
                option = WithIndent(CheckBox((UnitySettings s) => s.EnableIconsForPerformanceCriticalCode,
                                             "Show icons for frequently called methods"));
                AddBinding(option, BindingStyle.IsEnabledProperty, ourEnablePerformanceHighlightingAccessor,
                           enable => enable);
            }
            EndSection();

            // The default is when code vision is disabled. Let's keep this so that if/when ReSharper ever gets Code
            // Vision, we'll show the items, or if the user installs Rider, the copied settings will still be useful
            AddBoolOption((UnitySettings s) => s.GutterIconMode,
                          GutterIconMode.CodeInsightDisabled, GutterIconMode.None,
                          "Show gutter icons for implicit script usages");

            Header("Text based assets");
            CheckBox((UnitySettings s) => s.IsAssetIndexingEnabled,
                     "Parse text based asset files for implicit script usages (requires re-opening solution)");

            if (productConfigurations.IsInternalMode())
            {
                Header("Internal");

                CheckBox((UnitySettings s) => s.EnableCgErrorHighlighting,
                         "Parse Cg files for syntax errors (requires internal mode, and re-opening solution)");
            }

            FinishPage();
        }
        public MspecPage(
            Lifetime lifetime,
            OptionsSettingsSmartContext optionsSettingsSmartContext,
            MspecTestProvider provider,
            RunsProducts.ProductConfigurations productConfigurations)
            : base(lifetime, optionsSettingsSmartContext)
        {
            var supportEnabledOption = UnitTestProviderOptionsPage.GetTestSupportEnabledOption(lifetime, optionsSettingsSmartContext, provider.ID);

            if (productConfigurations.IsInternalMode())
            {
                AddBoolOption(supportEnabledOption, "_Enable " + provider.Name + " support", string.Empty);
            }

            AddHeader("Test discovery");

            this.AddExplorationMethodSelect <MspecProviderSettings>(x => x.TestDiscoveryFromArtifactsMethod);
        }
Пример #14
0
        public UnityOptionsPage(Lifetime lifetime, OptionsSettingsSmartContext settingsStore,
                                RunsProducts.ProductConfigurations productConfigurations)
            : base(lifetime, settingsStore)
        {
            Header("General");

            CheckBox((UnitySettings s) => s.InstallUnity3DRiderPlugin,
                     "Automatically install and update Rider's Unity editor plugin (recommended)");
            CheckBox((UnitySettings s) => s.AllowAutomaticRefreshInUnity, "Automatically refresh assets in Unity");
            CheckBox((UnitySettings s) => s.IsYamlParsingEnabled,
                     "Parse text based asset files for implicit script usages");

            // TODO: Add to R# options page
            Header("C#");
            CheckBox((UnitySettings s) => s.EnablePerformanceCriticalCodeHighlighting,
                     "Highlight expensive method calls in frequently called code");
            AddComboOption((UnitySettings s) => s.GutterIconMode, "Show gutter icons for implicit script usages:",
                           new RadioOptionPoint(GutterIconMode.Always, "Always"),
                           new RadioOptionPoint(GutterIconMode.CodeInsightDisabled, "When Code Vision are disabled"),
                           new RadioOptionPoint(GutterIconMode.None, "Never")
                           );

            AddNamingSection(lifetime, settingsStore);

            Header("ShaderLab");
            CheckBox((UnitySettings s) => s.EnableShaderLabHippieCompletion,
                     "Enable simple word-based completion in ShaderLab files");

            if (productConfigurations.IsInternalMode())
            {
                Header("Internal");

                // TODO: Add to R# options page
                CheckBox((UnitySettings s) => s.EnableCgErrorHighlighting,
                         "Parse Cg files for syntax errors (requires internal mode, and re-opening solution)");
            }

            FinishPage();
        }
 public GotoWordIndexProvider(
     [NotNull] RunsProducts.ProductConfigurations configurations, [NotNull] IShellLocks shellLocks)
 {
     myConfigurations = configurations;
     myShellLocks     = shellLocks;
 }
        public InjectedHlslTypingAssist(
            Lifetime lifetime,
            [NotNull] ISolution solution,
            [NotNull] IPsiServices psiServices,
            [NotNull] ICommandProcessor commandProcessor,
            [NotNull] ISettingsStore settingsStore,
            [NotNull] RunsProducts.ProductConfigurations productConfigurations,
            [NotNull] CachingLexerService cachingLexerService,
            [NotNull] ITypingAssistManager typingAssistManager,
            [NotNull] IExternalIntellisenseHost externalIntellisenseHost,
            [NotNull] SkippingTypingAssist skippingTypingAssist,
            [NotNull] LastTypingAssistAction lastTypingAssistAction,
            [NotNull] HlslInShaderLabDummyFormatter inShaderLabDummyFormatter)
            : base(solution, settingsStore, cachingLexerService, commandProcessor, psiServices, externalIntellisenseHost,
                   skippingTypingAssist, lastTypingAssistAction)
        {
            myInShaderLabDummyFormatter = inShaderLabDummyFormatter;
            var braceHandler  = new InjectedHlslBraceHandler(this, inShaderLabDummyFormatter, false, productConfigurations.IsInternalMode());
            var quoteHandler  = new CppQuoteHandler <ShaderLabLanguage>(this);
            var deleteHandler = new CppDeleteHandler <ShaderLabLanguage>(this, inShaderLabDummyFormatter);

            typingAssistManager.AddTypingHandler(lifetime, '{', this, c => WrapCppAction(c, braceHandler.HandleLeftBraceTyped),
                                                 IsTypingHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '}', this, c => WrapCppAction(c, braceHandler.HandleRightBraceTyped),
                                                 IsTypingHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '(', this, c => WrapCppAction(c, braceHandler.HandleLeftBracketOrParenthTyped),
                                                 IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '<', this, c => WrapCppAction(c, braceHandler.HandleLTTyped),
                                                 IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '>', this, c => WrapCppAction(c, braceHandler.HandleRightBracketTyped),
                                                 IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '[', this, c => WrapCppAction(c, braceHandler.HandleLeftBracketOrParenthTyped),
                                                 IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, ']', this, c => WrapCppAction(c, braceHandler.HandleRightBracketTyped),
                                                 IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, ')', this, c => WrapCppAction(c, braceHandler.HandleRightBracketTyped),
                                                 IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '"', this, c => WrapCppAction(c, quoteHandler.HandleQuoteTyped),
                                                 IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '\'', this, c => WrapCppAction(c, quoteHandler.HandleQuoteTyped),
                                                 IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, ';', this, c => WrapCppAction(c, braceHandler.HandleSemicolonTyped),
                                                 IsCorrectCommonTyposAvailable);
            typingAssistManager.AddTypingHandler(lifetime, ':', this, c => WrapCppAction(c, braceHandler.HandleColonTyped),
                                                 IsTypingHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '*', this, c => WrapCppAction(c, braceHandler.HandleStarTyped),
                                                 IsCorrectCommonTyposAvailable);

            // TODO: # typing should respect ShaderLabIndent
            // typingAssistManager.AddTypingHandler(lifetime, '#', this, c => WrapCppAction(c, braceHandler.HandleSharpTyped),
            //   IsCorrectCommonTyposAvailable);

            typingAssistManager.AddActionHandler(lifetime, TextControlActions.ActionIds.Backspace, this,
                                                 c => WrapAction(c, deleteHandler.HandleBackspacePressed), IsActionHandlerAvailable);
            typingAssistManager.AddActionHandler(lifetime, TextControlActions.ActionIds.Enter, this,
                                                 c => WrapAction(c, braceHandler.HandleEnterTyped), IsActionHandlerAvailable);
            typingAssistManager.AddActionHandler(lifetime, TextControlActions.ActionIds.Tab, this, HandleTabPressed,
                                                 IsActionHandlerAvailable);
            typingAssistManager.AddActionHandler(lifetime, TextControlActions.ActionIds.TabLeft, this, HandleTabLeftPressed,
                                                 IsActionHandlerAvailable);
            typingAssistManager.AddActionHandler(lifetime, EditorStartNewLineBeforeAction.ACTION_ID, this,
                                                 c => WrapAction(c, braceHandler.HandleStartNewLineBeforePressed), IsActionHandlerAvailable);
        }
        public UnityOptionsPage(Lifetime lifetime, OptionsPageContext pageContext,
                                OptionsSettingsSmartContext settingsStore,
                                RunsProducts.ProductConfigurations productConfigurations)
            : base(lifetime, pageContext, settingsStore)
        {
            AddHeader("General");
            AddBoolOption((UnitySettings s) => s.InstallUnity3DRiderPlugin,
                          "Automatically install and update Rider's Unity editor plugin (recommended)");
            AddBoolOption((UnitySettings s) => s.AllowAutomaticRefreshInUnity, "Automatically refresh assets in Unity");

            AddPerformanceAnalysisSection();
            AddBurstAnalysisSection();

            AddHeader("C#");
            AddComboOption((UnitySettings s) => s.GutterIconMode,
                           "Show gutter icons for implicit script usages:", string.Empty, string.Empty,
                           new RadioOptionPoint(GutterIconMode.Always, "Always"),
                           new RadioOptionPoint(GutterIconMode.CodeInsightDisabled, "When Code Vision is disabled"),
                           new RadioOptionPoint(GutterIconMode.None, "Never")
                           );

            AddNamingSection(lifetime, settingsStore);

            AddHeader("Text based assets");
            AddBoolOption((UnitySettings s) => s.IsAssetIndexingEnabled,
                          "Parse text based asset files for script and event handler usages");
            AddBoolOption((UnitySettings s) => s.EnableInspectorPropertiesEditor,
                          "Show Inspector values in the editor");
            AddBoolOption((UnitySettings s) => s.IsPrefabCacheEnabled,
                          "Cache prefab data to improve find usage performance");
            AddBoolOption((UnitySettings s) => s.EnableAssetIndexingPerformanceHeuristic,
                          "Automatically disable asset indexing for large solutions");
            AddBoolOption((UnitySettings s) => s.UseUnityYamlMerge, "Prefer UnityYamlMerge for merging YAML files");
            using (Indent())
            {
                var option = AddControl((UnitySettings s) => s.MergeParameters,
                                        p => p.GetBeTextBox(lifetime).WithDescription("Merge parameters", lifetime));
                AddBinding(option, BindingStyle.IsEnabledProperty, (Expression <Func <UnitySettings, bool> >)(s => s.UseUnityYamlMerge),
                           enable => enable);
            }

            AddHeader("Shaders");
            AddBoolOption((UnitySettings s) => s.SuppressShaderErrorHighlighting, "Suppress resolve errors of unqualified names");


            AddHeader("Debugging");
            AddBoolOption((UnitySettings s) => s.EnableDebuggerExtensions,
                          "Extend value rendering");
            using (Indent())
            {
                // AddCommentText doesn't match the UI guidelines for inline help. It should wrap at about 70 characters
                // and have a slightly smaller font size. We can do the wrapping manually, but there's nothing we can do
                // about the font.
                // https://youtrack.jetbrains.com/issue/RIDER-47090
                AddCommentText("When enabled, Rider will show extra values in debugger object views,\n" +
                               "such as active scene and GameObject component data and children.\n" +
                               "Rendering of summary values is also improved, such as showing Vector3\n" +
                               "float values with full precision.");
            }

            if (productConfigurations.IsInternalMode())
            {
                AddHeader("Internal");

                AddBoolOption((UnitySettings s) => s.SuppressShaderErrorHighlightingInRenderPipelinePackages,
                              "Suppress resolve errors in render-pipeline packages");

                AddBoolOption((UnitySettings s) => s.EnableCgErrorHighlighting,
                              "[Deprecated] Parse GLSL files for syntax errors (requires internal mode, and re-opening solution)");
            }
        }
        public SettingsUpgrader(ISettingsStore settingsStore, IApplicationDescriptor applicationDescriptor, IShellLocks locks, ProductSettingsLocation productSettingsLocation, RunsProducts.ProductConfigurations productConfigurations)
        {
            var boundSettingsStore = settingsStore.BindToContextTransient(ContextRange.ManuallyRestrictWritesToOneContext((l, contexts) => contexts.Empty));
            Expression <Func <ZenCodingSettings, bool> > isUpgradedProperty = settings => settings.IsUpgraded;

            if (!boundSettingsStore.GetValue(isUpgradedProperty))
            {
                var settingsComponent = new ShellSettingsComponent(applicationDescriptor, locks, productSettingsLocation, productConfigurations);
                var oldSettings       = new Settings();
                settingsComponent.LoadSettings(oldSettings, XmlExternalizationScope.UserSettings, oldSettings.GetType().Name);
                for (int i = 0; i < oldSettings.FileAssociations.Count; i++)
                {
                    var association = oldSettings.FileAssociations[i];
                    boundSettingsStore.SetIndexedValue((ZenCodingSettings settings) => settings.FileAssociations, i, association);
                }

                boundSettingsStore.SetValue(isUpgradedProperty, true);
            }
        }