Ejemplo n.º 1
0
        private CodeContext GetCodeContext()
        {
            var document = ServiceProvider.GetCurrentDocument();

            if (document == null || !document.Project.TryGetCompilation(out _) || !CodeContext.IsSupported(document))
            {
                return(default(CodeContext));
            }
            return(CodeContext.Create(document, ServiceProvider.GetCurrentSelectionSpan()));
        }