-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Minor connections refactor #3178
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! Love the code comments too
P.S. - was this the thing we were discussing where I said I would learn from the code and write a test?
Fixed up the double/single quote errors. Nope, this is mostly just to set the stage so when it happens again we'll have some better logs to figure out what's going on. |
@@ -27,7 +27,7 @@ export abstract class Connection { | |||
) { | |||
this.logger = logger.named( | |||
this.name, | |||
field("token", this.protocol.options.reconnectionToken), | |||
field('token', this.protocol.options.reconnectionToken), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the difference between "
and '
in JavaScript/TypeScript?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None but VS Code's linting rules enforce '
for "unlocalized" strings (well technically externalized strings) so the only time they are allowed is in calls like:
localize('projectQuickPick.help', "TypeScript help")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah very interesting pattern, so they're using something that extracts all "
-quoted strings into resource bundles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they might be doing something like that, although if they can already detect and report to the dev when a string should be using "
or '
I'm not sure why they can't just use that knowledge to extract it and don't bother the dev. 😛
Nice work! Merge whenever 🚢 |
- Move destroy logic into the class itself - Improve logging a bit - Remove the record option; we should always do this when using permessage-deflate. - Let debug port be null (it can be null in the message args). - Add setSocket so we don't have to initiate a connection to set it. - Move inflate bytes logic into the class itself.
- Moved everything I could into the class itself. - Improve the logging situation a bit. - Switch some trace logs to debug. - Get debug port from message arguments.
zlib errors can cause the protocol handshake to not reject (until the timeout).
More details in the commit messages.