Skip to content
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

refactor(spelling): correct misspelled response #33921

Merged
merged 1 commit into from
Oct 16, 2019
Merged

refactor(spelling): correct misspelled response #33921

merged 1 commit into from
Oct 16, 2019

Conversation

sQVe
Copy link
Contributor

@sQVe sQVe commented Oct 10, 2019

This PR fixes a spelling mistake introduced with 8004fec.

@typescript-bot
Copy link
Collaborator

Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @amcasey, @mjbvz, @minestarks for you. Feel free to loop in other consumers/maintainers if necessary

@msftclas
Copy link

msftclas commented Oct 10, 2019

CLA assistant check
All CLA requirements met.

@amcasey
Copy link
Member

amcasey commented Oct 10, 2019

It looks like this has, unfortunately, already shipped, so we probably have to keep the misspelled one for back compat. I'm guessing the preferred approach is to add the new one with correct spelling and flag the old one as deprecated. @sheetalkamat?

@sheetalkamat
Copy link
Member

I'm guessing the preferred approach is to add the new one with correct spelling and flag the old one as deprecated

Yes that's the way we would need to handle this change.

@sQVe
Copy link
Contributor Author

sQVe commented Oct 11, 2019

@amcasey, @sheetalkamat: Could you possibly point me in the right direction on how to make this change but also keep backwards compatibility?

@mjbvz
Copy link
Contributor

mjbvz commented Oct 11, 2019

Looks like this only touches a type name and not the protocol itself, so do we really need to worry about breaking things? The change maybe cause a compile error but I think server would still work if you use the old misspelled type name

@sQVe
Copy link
Contributor Author

sQVe commented Oct 11, 2019

export interface DefinitionInfoAndBoundSpanResponse extends Response {
    body?: DefinitionInfoAndBoundSpan;
}

/**
 * @deprecated
 */
export interface DefinitionInfoAndBoundSpanReponse extends DefinitionInfoAndBoundSpanResponse {}

Would something like the above suffice?

@amcasey
Copy link
Member

amcasey commented Oct 11, 2019

@mjbvz I agree that it should still work at runtime, but I think we prefer to avoid compiler errors as well.

@sQVe My naive guess would have been type DefinitionInfoAndBoundSpanReponse = DefinitionInfoAndBoundSpanResponse; to alias the type, but @sheetalkamat would know better.

@sheetalkamat
Copy link
Member

/** @deprecated Use `DefinitionInfoAndBoundSpanResponse` instead.  */
export type DefinitionInfoAndBoundSpanReponse = DefinitionInfoAndBoundSpanResponse ;

@sQVe
Copy link
Contributor Author

sQVe commented Oct 15, 2019

@amcasey, @sheetalkamat: Backwards compability is now added. I made the assumption that I could leave the tests untouched and just use the new correctly named type.

@sQVe
Copy link
Contributor Author

sQVe commented Oct 15, 2019

Unsure on how to make the tests pass.

 61508 passing (2m)
  1 failing

  1)

         Public APIs
           for the language server
             should be acknowledged when they change:
     Error: The baseline file api/tsserverlibrary.d.ts has changed.

Above is not much to go on.

@sheetalkamat
Copy link
Member

You need to run gulp runtests --t="Public API" and then gulp baseline-accept and commit the change in the baseline.

Copy link
Member

@amcasey amcasey left a comment

Choose a reason for hiding this comment

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

LGTM once the tests pass. Thanks!

@sQVe
Copy link
Contributor Author

sQVe commented Oct 16, 2019

Got the tests to pass and squashed commits into one. I think this is ready for a merge now. 🙏

@sheetalkamat sheetalkamat merged commit f24db4c into microsoft:master Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants