Calculate parameter scope in a less stupid way thereby fixing go-to-declaration with parameters