public DefaultLSPEditorFeatureDetector(ProjectHierarchyInspector projectHierarchyInspector) { if (projectHierarchyInspector is null) { throw new ArgumentNullException(nameof(projectHierarchyInspector)); } _projectHierarchyInspector = projectHierarchyInspector; _vsUIShellOpenDocument = new Lazy <IVsUIShellOpenDocument>(() => { var shellOpenDocument = (IVsUIShellOpenDocument)ServiceProvider.GlobalProvider.GetService(typeof(SVsUIShellOpenDocument)); Assumes.Present(shellOpenDocument); return(shellOpenDocument); }); _useLegacyEditor = new Lazy <bool>(() => { var settingsManager = (ISettingsManager)ServiceProvider.GlobalProvider.GetService(typeof(SVsSettingsPersistenceManager)); Assumes.Present(settingsManager); var useLegacyEditor = settingsManager.GetValueOrDefault <bool>(UseLegacyASPNETCoreEditorSetting); return(useLegacyEditor); }); }
public DefaultLSPEditorFeatureDetector(ProjectHierarchyInspector projectHierarchyInspector) { if (projectHierarchyInspector is null) { throw new ArgumentNullException(nameof(projectHierarchyInspector)); } _projectHierarchyInspector = projectHierarchyInspector; _featureFlags = (IVsFeatureFlags)AsyncPackage.GetGlobalService(typeof(SVsFeatureFlags)); _vsUIShellOpenDocument = new Lazy <IVsUIShellOpenDocument>(() => { var shellOpenDocument = (IVsUIShellOpenDocument)ServiceProvider.GlobalProvider.GetService(typeof(SVsUIShellOpenDocument)); Assumes.Present(shellOpenDocument); return(shellOpenDocument); }); }