Skip to content

refactor(server): Prefer null over undefined and explicit void #1493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2021

Conversation

atscott
Copy link
Collaborator

@atscott atscott commented Aug 26, 2021

Update return types of functions to:

  • Explicitly have void as the return type
  • Prefer null over undefined

The LSP spec always uses null as the return types:
https://microsoft.github.io/language-server-protocol/specifications/specification-current/

In fact, if the server is configured to return undefined, it will
still be null after coming through the LSP connection. To avoid any
confusion, we should just always use null.

@atscott atscott added the target: minor This PR is targeted for the next minor release label Aug 26, 2021
@google-cla google-cla bot added the cla: yes label Aug 26, 2021
@atscott atscott requested a review from clydin August 26, 2021 19:11
Update return types of functions to:

* Explicitly have `void` as the return type
* Prefer `null` over `undefined`

The LSP spec always uses `null` as the return types:
https://microsoft.github.io/language-server-protocol/specifications/specification-current/

In fact, if the server is configured to return `undefined`, it will
still be `null` after coming through the LSP connection. To avoid any
confusion, we should just always use `null`.
@atscott atscott changed the title refactor(server): Prefer over and explicit refactor(server): Prefer null over undefined and explicit void Aug 26, 2021
Copy link
Member

@clydin clydin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
nice cleanup.

@atscott atscott added the action: merge Ready to merge label Sep 13, 2021
@atscott atscott merged commit 6b8d49e into angular:master Sep 13, 2021
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge Ready to merge cla: yes target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants