refactor: add helper functions to `session.ts`
refactor: add helper functions to `session.ts`

In preparation for adding `typeDefinitionProvider` to the capabilities,
refactor some common code in the `session.ts` file into helper
functions.

angular/vscode-ng-language-service,angular/vscode-ng-language-service,angular/vscode-ng-language-service,angular/vscode-ng-language-service