Conversation
There was a problem hiding this comment.
I haven't looked at it in detail now, but I would suggest to leave the names of the settings as they were before, at least exclude should not change in my opinion. For include I understand the idea of not using the previous setting so that everyone benefits from the changes, however I would not use languages as include settings. What about usecases where the extension should only run in specific folders for example? What about custom files that are not assigned to any language? That would limit the usability of the extension.
There may be other things that I didn't notice at first glance.
I have not tested the settings itself, but TODO: is displayed again without any settings present, that works.
| // check if we have a list of languages to be used for. If not: use on all languages. | ||
| const thisFileLangId = activeEditor.document.languageId; | ||
| console.log(`thisFileLangId: ${thisFileLangId}`); | ||
| const includedLanguages = settings.get('includedLanguages') || []; | ||
| console.log(`includedLanguages: ${String(includedLanguages)} (${typeof includedLanguages})`); | ||
| if (includedLanguages && includedLanguages.length > 0 && !includedLanguages.includes(thisFileLangId)) { | ||
| console.log(`updateDecorations not wanted on lang ${thisFileLangId} for file ${activeEditor.document.fileName}`); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Why is this not in the function that checks if the current file should be used?
There was a problem hiding this comment.
There was a reason at the time, but I now forget why.
But it may not be relevant now, depending how the discussion on which type of include setting to use.
Co-authored-by: alkatar21 <61387986+alkatar21@users.noreply.github.com>
Co-authored-by: alkatar21 <61387986+alkatar21@users.noreply.github.com>
#72