You could use something like the following to get the line of a given SyntaxNode
Dim node As SyntaxNode = 'Something
Dim line As FileLinePositionSpan = node.SyntaxTree.GetLineSpan(node.Span)
Dim tree As SyntaxTree = 'Something
Dim text As SourceText = Await tree.GetTextAsync()
Dim lines As TextLineCollection = text.Lines
To get all lines of a file.
However, what if the code you were analyzing was actually like this:
Dim x As Integer
' Comment about something important
x = 100
In this case you would want to find LocalDeclarationStatementSyntax nodes and check for assignment. If they are not assigned, you would then check for SimpleAssignmentStatementSyntax nodes and verify that they are the same symbol using a SemanticModel.