Allow parameter completion at the end of file

Also avoid an extra cast to DotNetProject. It might fail if the project
is null