Ketho / vscode-wow-api

VS Code extension for World of Warcraft AddOns
https://marketplace.visualstudio.com/items?itemName=ketho.wow-api
MIT License
151 stars 33 forks source link

Update array before updating config #101

Closed thatnerdjosh closed 1 year ago

thatnerdjosh commented 1 year ago

Lua.workspace.library was being updated but immediately overwritten on the second call to setExternalLibrary. After some debugging, it seems like vscode.workspace.getConfiguration does not reload everything from the config on the second time it is called.

There is some interesting magic going on here: https://github.com/microsoft/vscode/blob/230a6266ebc8e092521a949ed159d8be23e1b1b2/src/vs/workbench/api/common/extHostConfiguration.ts#L186

Related to issue #100 - please review with scrutiny, as I am not an experienced extension developer..

thatnerdjosh commented 1 year ago

@Ketho - could you help to review this?

Ketho commented 1 year ago

I'm also not an experienced extension developer to be honest.

I suppose the second call of setExternalLibrary indeed overwrites the first call. I'll look into your PR later today.

Maybe I have to reconsider what the proper way to do it is now since Sumneko might have changed that. https://github.com/LuaLS/lua-language-server/wiki/Libraries

thatnerdjosh commented 1 year ago

@Ketho - ok - I do know that with the Libraries being updated it does function as expected, but didn't look too much into it more than that. Took a while just to land on this solution :sweat_smile: :)

Ketho commented 1 year ago

Thanks for looking into the issue, I probably wouldn't have the time to do that anytime soon 🙂