zeroc-ice / vscode-slice

Slice syntax highlighter for Visual Studio Code
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

Move Cached 'SliceOptions' into 'ConfigurationSet'. #47

Closed InsertCreativityHere closed 5 months ago

InsertCreativityHere commented 5 months ago

Currently, we cache a SliceOptions (options we pass to the compiler) in SliceConfig (config set on the server). Whenever we change a field in SliceConfig, we update our cached options.

This PR moves this cached value one level up. It is no longer in SliceConfig but in ConfigurationSet.

1) Now SliceConfig is now a simple, fully public struct. Before, everything was private, and you had to set things through functions, so we could intercept it and update the cache. No longer!

2) Instead of updating the cache every time a config item changes, we do a JIT update - we update the cache right before we compile (if necessary). This means less locking and less updating.


This also makes it easier for me to put print statements for whenever we update the Slice paths. If, hypothetically, I was trying to fix yet another pathing issue...