We might want to do something special for untitled documents here, since the fullPath will be invalid. Maybe the second argument should be made optional, and not provided for untitled files?