Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggested enhancement - flag to indicate to intellisensehelper whether the workbook provider is required #687

Open
jmkinzer opened this issue Mar 28, 2024 · 0 comments

Comments

@jmkinzer
Copy link

jmkinzer commented Mar 28, 2024

Hi Govert -

WorkbookIntelliSenseProvider throws an System.Runtime.InteropServices.COMException (Invalid Index) in the case we're relying on the DNA provider because the worksheet for the WB provider will not be present. This is a bit messy and trips up the debugger. Can we have a flag to indicate whether it is even required to load it, to avoid this spurious exception?
 
e.g.

        public IntelliSenseHelper(IsEnableWBProvider)
        {
            Logger.Initialization.Verbose("IntelliSenseHelper Constructor Begin");
            _syncContextMain = new WindowsFormsSynchronizationContext();
            _uiMonitor = new UIMonitor(_syncContextMain);
            _display = new IntelliSenseDisplay(_syncContextMain, _uiMonitor);

            _providers = new List<IIntelliSenseProvider>
            {
                new ExcelDnaIntelliSenseProvider(_syncContextMain)
            };
                //  avoid loading and throwing a spurious exception if not needed
                if (IsEnableWBProvider) _providers.Add(new WorkbookIntelliSenseProvider());

            RegisterIntellisense();
            Logger.Initialization.Verbose("IntelliSenseHelper Constructor End");
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant