Nathanael saith unto him, Whence knowest thou me? Jesus answered and said unto him, Before that Philip called thee, when thou wast under the fig tree, I saw thee.
Note 3 at Joh 1:48: This was Jesus operating in the gift of the Spirit called a word of knowledge (1Co 12:8). From Nathanael's reaction in Joh 1:49, it is clear that Jesus saw more than just Nathanael sitting under a tree. Jesus' statement in Joh 1:47 must have revealed Nathanael's thoughts, thus proving to Nathanael that Jesus was indeed the Messiah.