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

Nullable option for Setting.Integer #435

Open
hahoyer opened this issue Oct 21, 2024 · 3 comments
Open

Nullable option for Setting.Integer #435

hahoyer opened this issue Oct 21, 2024 · 3 comments

Comments

@hahoyer
Copy link

hahoyer commented Oct 21, 2024

Is there a way to define a setting of type int??

Example: A maximum line length can be specified for the formatting of a document, but does not have to be. Then the line length is not limited.

At the moment I make do with a setting of type string, which I then convert. Another option would be to use the value -1 as a proxy for null. But these are all strange solutions, to be honest.

@JoshuaBStevens
Copy link
Member

Providing a separate bool setting "Limit line lengths" (on which the "Maximum line length" int setting would be dependent) might be a more user-friendly configuration experience. But I'm interested to hear if you have reasons for avoiding that arrangement.

@hahoyer
Copy link
Author

hahoyer commented Oct 28, 2024

I don't think I'm able to explain it to you if you don't see it yourself. It reminds me a bit of the times when C# didn't have nullables.
But then I guess I'll just have to live with it.
Thank you for the further suggestion to mitigate the lack.

@JoshuaBStevens
Copy link
Member

JoshuaBStevens commented Oct 28, 2024

Sorry, I was a bit unclear. I understand why a nullable integer would be preferable from the extender's (i.e. your) perspective. And I realized after posting my initial response that Gladstone settings don't currently have any UI except direct JSON editing. So my question about the user configuration experience was understandably confusing.

Eventually VisualStudio.Extensibility settings will be included in the "Unified Settings" UI, which you can see today via Tools > Options after selecting Tools > Options Experience > Preview in a preview release of VS. In that UI, we feel that separate controls to enable the setting and to edit the setting's value would be more user-friendly than trying to combine both concepts into a single control.

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

No branches or pull requests

2 participants