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

Why does the response to my request (to client) for config settings contain nulls? #623

Closed
ZacLN opened this issue May 20, 2020 · 12 comments

Comments

@ZacLN
Copy link

ZacLN commented May 20, 2020

Hi,
We're sending a "workspace/configuration" request to the vscode client (as per this) and are receiving null values instead of false for a group of boolean properties. When set to true the properties are returned as expected. These properties all set within the vscode extension similar to the following snippet within the relevant contributes/configuration/properties of the client extension's package.json.

"julia.lint.run": {
                    "type": "boolean",
                    "default": true,
                    "description": "Run the linter on active files."
                }

Other, non-boolean, properties are returned as expected. What are we missing?

This relates to the julia-vscode extension.

@rcjsuen
Copy link
Contributor

rcjsuen commented May 20, 2020

Sounds like some TypeScript/JavaScript conversion issue...?

@ZacLN Do you have issues with 0 or "" and other such "falsy" values?

@ZacLN
Copy link
Author

ZacLN commented May 21, 2020

Not that I'm aware of. I'm assuming this is something to do with how we're specifying the properties as it seems such an odd behaviour that couldn't possibly have gone unnoticed before.

@rcjsuen
Copy link
Contributor

rcjsuen commented May 21, 2020

@ZacLN What did you find when you added breakpoints and/or print statements in configuration.ts?

@ZacLN
Copy link
Author

ZacLN commented May 21, 2020

I don't have any idea of how to get started with debugging the editor in unison with the extension, is there some guide available?

@rcjsuen
Copy link
Contributor

rcjsuen commented May 21, 2020

I don't have any idea of how to get started with debugging the editor in unison with the extension, is there some guide available?

Not sure. The only document I'm aware of is the Language Server Extension Guide. Otherwise, I just go inside my node_modules folder and just add breakpoints and print statements to see what's happening.

@ZacLN
Copy link
Author

ZacLN commented May 21, 2020

Thanks! It seems this is the culprit. I assume it's checking against result being null but also prevents returning false - is this likely to be intended behaviour?

@rcjsuen
Copy link
Contributor

rcjsuen commented May 21, 2020

Thanks! It seems this is the culprit.

Can you test that code with "" and 0? I feel like they should return null also... 🤔

@ZacLN
Copy link
Author

ZacLN commented May 21, 2020

Yep it does

@rcjsuen
Copy link
Contributor

rcjsuen commented May 21, 2020

@ZacLN Definitely looks like a bug to me.

@davidanthoff
Copy link

@dbaeumer do you agree that this is a bug and should be fixed, or are we misunderstanding something in the spec?

This is our highest priority bug for the Julia extension right now, we need to find some way to work around this. Just having some official guidance from you would help us decide how to proceed :) Thanks!

@dbaeumer
Copy link
Member

Agree that this is a bug.

Two things you can do: convert it to false on the server side. Use a client side middle ware to convert it back to false.

@davidanthoff
Copy link

Great, thanks! We have a workaround for now and then we'll just wait for the next release here :)

@vscodebot vscodebot bot locked and limited conversation to collaborators Jul 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants