Antyos / vscode-openscad

An OpenSCAD extension for VS Code
GNU General Public License v3.0
118 stars 18 forks source link

Fix incorrect deprecation warnings #61

Closed bluekeyes closed 8 months ago

bluekeyes commented 8 months ago

Thanks for this extension, it makes working with OpenSCAD more enjoyable! After #58 was released, I started seeing consistent deprecation warnings about properties I never set and that do not appear in my settings.json.

I did some debugging, and it turns out that when a property is defined in package.json, the config.get() function returns null if the property is unset instead of undefined. It appears undefined is reserved for properties that are actually not defined for the extension, although the VSCode API docs don't mention this (maybe it's a bug with VSCode 1.85.2?)

As a result, users who never set the deprecated export options would still see deprecation notifications when the extension processed its config. Fixing the checks to handle null seemed better than removing the property definitions, since I assume the property definitions are still useful for users who did configure the old properties.

Antyos commented 8 months ago

The null vs undefined behavior is odd--nice catch! Thank you so much for investigating and submitting a PR!

The name autoNamingExport always bothered me as awkward. I hope that #58 was more useful than it was annoying.