using Microsoft.VisualStudio.Text; int lineNumber = snapshotPoint.GetContainingLine().LineNumber;
using Microsoft.VisualStudio.Text; string lineText = snapshotPoint.GetContainingLine().GetText();In this example, we get the containing line object and retrieve its text using the GetText() method. Both examples use the Microsoft.VisualStudio.Text package library.