You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The macroList function currently does not cache the files.
Since it is called by collect (which is called by SugarCube diagnostics and hover), it can be called pretty often. While not often enough to likely cause notable/visible input lag it is still reads the file and parses it quite often.
Solution: Use https://code.visualstudio.com/api/references/vscode-api#workspace.createFileSystemWatcher with the current glob for json/yaml/yml files, and keep a global variable (exported or not? I'd say no) of the last parsed result. Then macroList simple checks if it already exists. On a file edit/creation/deletion, all it has to do is perform the parsing again.
I can implement this.
The text was updated successfully, but these errors were encountered:
Note: I realized that vscode.workspace.openTextDocument probably keeps the file open so it is not a full disk read every time.
Still, caching the parsing result would be useful, especially if/when more complex checks/transformations need to be applied to the information.
The
macroList
function currently does not cache the files.Since it is called by
collect
(which is called by SugarCubediagnostics
andhover
), it can be called pretty often. While not often enough to likely cause notable/visible input lag it is still reads the file and parses it quite often.Solution: Use https://code.visualstudio.com/api/references/vscode-api#workspace.createFileSystemWatcher with the current glob for json/yaml/yml files, and keep a global variable (exported or not? I'd say no) of the last parsed result. Then
macroList
simple checks if it already exists. On a file edit/creation/deletion, all it has to do is perform the parsing again.I can implement this.
The text was updated successfully, but these errors were encountered: