New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create LocalizationHoverProvider
#35
Conversation
Right now, the localization references are built once (when the extension activates). To keep the references up to date, a file-system watcher can be used to update, rebuild and remove localization handler references as needed. here's a quick draft sketch of what it would look like: const localizationXMLFileWatcher = vscode.workspace.createFileSystemWatcher("**/Localization/**/*.xml");
localizationXMLFileWatcher.onDidCreate(e => {
vscode.window.showInformationMessage(`CREATE: ${e.fsPath.split("\\").at(-1)}`);
buildLocalizationReference();
});
localizationXMLFileWatcher.onDidChange(e => {
vscode.window.showInformationMessage(`CHANGE: ${e.fsPath.split("\\").at(-1)}`);
buildLocalizationReference();
});
localizationXMLFileWatcher.onDidDelete(e => {
vscode.window.showInformationMessage(`DELETE: ${e.fsPath.split("\\").at(-1)}`);
removeLocalizationReference();
}); |
This ensures the map is empty everytime build is called. This should prevent duplication.
It's starting to take shape. Considering each localization xml contributes its own handles and content, it may be prudent to register separate hover providers for each file (and dispose them off if they're deleted). This will isolate the reference map objects. That said, how often do I expect the localization files to be removed? for this to even be a issue. Even then a simple reload the editor will "fix" the problem. |
as it makes more sense to exist there
Because of 9dca9ac, |
* Start Consolidating `meta.lsx` logic * Consolidate metadata into `metaLsx` class * Move find back into the class * Remove unnecessary constructor overload * Refactor MetaLsx class to parse dependencies and module information from meta.lsx file * Refactor version number handling in bumpVersionNumber function * Refactor `MetaLsx` class to `update` and `save` module information * Refactor version number bumping logic * Update comments * Add error handling to `bumpVersionNumber` * Refactor `convertVersionNumber` * Add error handling to `copyModUUID` * Add comments * Update default options * Remove `versionRegex` as it is no longer needed here * Add `cSpell` workspace settings * Refactor `MetaLsx` class
Register a hover provider for localization handles in localization (XML) files that show the content associated with the handle.
Fixes #28