Update the protocol to version 3.17 - #350
Conversation
899d325 to
b26baf6
Compare
|
This code is not tested yet And I'm not sure about 440140a and why it was required |
|
@CGNonofr Thank you. I will have a look later today. |
… a Connection It allows to remove a hack which is not doable anymore
Ok NOW it's tested and ready to be reviewed |
kaisalmen
left a comment
There was a problem hiding this comment.
Comments don't imply required changes, but please look at the null check. If that needs ok, LGTM
| export class MonacoLanguageClient extends BaseLanguageClient { | ||
|
|
||
| static bypassConversion = (result: any) => result || undefined; | ||
| static bypassConversion = (result: any, token?: vscode.CancellationToken) => token != null ? Promise.resolve(result || undefined) : (result || undefined); |
There was a problem hiding this comment.
Do you want to have a strict null check here, then change to !==?
There was a problem hiding this comment.
I'm not sure to understand what you mean, can you provide the code you want to be there?
There was a problem hiding this comment.
Shouldn't token != null betoken !== null?
There was a problem hiding this comment.
We can replace != null by !== undefined if you want.
I'm just used to using == null because it allows to check for undefined and null, and it's allowed by the standartjs eslint rules.
There was a problem hiding this comment.
Do you want me to change it?
There was a problem hiding this comment.
This is a boolean expression, if token is defined, then it is true: token ? Promise.resolve(result || undefined) : (result || undefined);
I'm not sure to understand what you mean, token is a boolean?
Should we consider investigating the new issue that came up before. WDYT
Are you talking about #351? I don't think it's a new issue, but I'm currently investigating. There is probably no reason for it to block the next release tho
I mean a real new version 0.19.0 or shall we call it 1.0.0?
I never understand why so many libraries are using a version number < 1 even after years (even monaco!).
But it's not a big deal, as you wish!
There was a problem hiding this comment.
I'm not sure to understand what you mean, token is a boolean?
You can rewrite this as such (token is undefined => false or defined => true). That's what I meant:
static bypassConversion = (result: any, token?: vscode.CancellationToken) => {
if (token) {
return Promise.resolve(result || undefined);
} else {
return (result || undefined);
}
};The method signature is identical to:
static bypassConversion = (result: any, token?: vscode.CancellationToken) => token != null ? Promise.resolve(result || undefined) : (result || undefined);There was a problem hiding this comment.
Let's aim for 1.0.0. webpack example is almost working again. monaco workers are not working properly. Will fix this today. Release today or tomorrow.
There was a problem hiding this comment.
You can rewrite this as such (token is undefined => false or defined => true)
That's what I meant when talking about if on anything else than boolean, relying on the trythiness of an object and the falsiness of undefined seems wrong and dangerous, no big deal tho since the whole project is done this way
There was a problem hiding this comment.
Please press the merge button if you like. 👍
| } | ||
|
|
||
| protected registerBuiltinFeatures(): void { | ||
| super.registerBuiltinFeatures(); |
There was a problem hiding this comment.
Does the base implementation now perform this registration and it is therefore no longer needed here?
There was a problem hiding this comment.
Ok, I looked at vscode-languageclient\lib\common\client.js and this is done there. Was that an error to register it twicebefore or was that really an change in the lc lib?
There was a problem hiding this comment.
I don't really know, it seems there isn't any consequence of registering a feature twice, so I don't know for how long it was there.
I think these features were proposed back then, so we added them and forgot to remove it when they became builtin
|
@CGNonofr sorry it took a bit longer. The week didn't turn out as planned. 😅 |
Notes: