zokugun / vscode-explicit-folding

Customize your Folding for Visual Studio Code
MIT License
95 stars 14 forks source link

Warnings about incorrect accessing of configuration API #88

Closed depascalis closed 1 year ago

depascalis commented 1 year ago

Describe the issue

The Extension Host spews out a lot of these warnings.

[exthost] [warning] [zokugun.explicit-folding] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[java]', provide the URI of a resource or 'null' for any resource.

The warning message above repeats for all available code languages.

Without debugging myself I believe the issue might be coming from this line https://github.com/zokugun/vscode-explicit-folding/blob/5d8d6840a3d669707e973aed6ee38c566aa6e70f/src/extension.ts#L255

I think it wants the second parameter, as you have done in other places.

Also, there are more places where getConfiguration() is used without a second parameter, you might want to correct those too.

To reproduce

  1. Load or reload a VSCode instance with the Explicit-Folding extension enabled (doh!πŸ˜„)
  2. Bring up the Output pane and select "Log (Extension Host)" from the dropdown
  3. The warnings should be showing all over the place

Additional context

The issue below mentions how to properly access the configuration API https://github.com/microsoft/vscode/issues/37041

Strangely, I can't find this "correct" use of getConfiguration() in the API documentation

daiyam commented 1 year ago

Weird, I don't have those warnings...

EDIT: For sure, I always test with my global folding... I will fix that error. Thx

depascalis commented 1 year ago

@daiyam it's not critical, just annoying to have a polluted log πŸ˜„

As I understand it, those warnings should only appear when in "dev mode", I don't know what that means.