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
hello !
Check Workspace Settings: Sometimes, workspace-specific settings might override user settings. Check if there are any todohighlight.include settings defined at the workspace level that might include more file types.
Extension Defaults: Verify if the extension itself has default settings that include other file types. You might need to explicitly exclude other file types if that's the case.
If the settings are correctly specified but not respected, you might need to look into the extension's code. Here is a modification to ensure that the extension checks the file extension before applying decorations.
File to Modify: Typically in the main extension file, possibly extension.js.
Code to Add:
First, you need to make sure that the function responsible for triggering updates to decorations checks the file type
function triggerUpdateDecorations() {
if (activeEditor && isLogFile(activeEditor.document.fileName)) {
updateDecorations();
}
}
function isLogFile(fileName) {
return fileName.endsWith('.log');
}
Check that your extension reloads its configuration when the settings change and correctly initializes when activated:function activate(context) {
vscode.workspace.onDidChangeConfiguration(handleConfigurationChange);
updateDecorations();
// other setup code...
}
function handleConfigurationChange(event) {
if (event.affectsConfiguration("todohighlight.include") || event.affectsConfiguration("todohighlight.keywords")) {
updateDecorations(); // Reapply with new settings
}
}
Additional Checks
Clear Cache/State: Sometimes, extensions might cache an old state; consider adding functionality to clear such states when configurations change.
Testing: After making these changes, test across multiple files to ensure the rules are applied only to .log files.
Hi,
I can't figure this out. I only have the follow custom settings in user's settings.json:
I just want highlighting only on file with .log extension. But still highlighting seems to be applied to all files, including this very settings.json.
Extension version: 1.0.5
Visual Studio Code 1.68.1
The text was updated successfully, but these errors were encountered: