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())); }