-
Notifications
You must be signed in to change notification settings - Fork 37
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
colorize.include is not working #890
Comments
Found the issue. In Extensions.js (In Kami's version, Yuteng's is obfuscated) is this function: function isIncludedFile(fileName) { Replacing the return to just check for hardcoded extension makes files of that extension work. So there is something whacked with the regex and my regex skills are weak. |
Nope. Same fail. |
Besides, the forked version has essentially the same code as the original in the function isIncludedFile. line 149 of Extensions.js of original |
@reefhound try latest version |
Did you actually try the latest version? You can add a non-Language Supported file pattern in "colorize.include" and get it to activate and colorize? I have the latest code in the repo. The canColorize function is what determines if the page is activated. It does not even look at "colorize.exclude". In fact, there is a comment that it needs to be added and the include needs to be reworked. And the isIncludedFile function is the same as what I posted in post #2 so it hasn't been changed. /**
/**
|
@reefhound |
I'm not installing "open source" that has been obfuscated. Where is the development repo? I'll be able to tell if it's fixed from looking at the code itself. |
I've already fixed Kami's for myself. Since all I care about is absolute extensions, I only check the extension. I get the extension and do a simple check that the filename ends with the extension. I added an exclude function and allowed an exclude match to short circuit the canColorize function. |
/**
|
never mind, found your code. Looks like you replaced find with some and added the exclude check inline rather than separate function, I'll test. |
I installed your latest and still not working for me. My snippet to colorize: This snippet, in a filename with an included qss extension, does not activate and colorize yet in an excluded css extension continues to active and colorize. |
Note that your exclusion check comes after your language check so an excluded file that is language supported will never get excluded. In my fix, I do the exclusion check first. function isIncludedFile(fileName: string): boolean { /**
|
you need write |
"colorize.include": ["/*.qss"], I have it as double asterisk, slash, asterisk extension. It's this discussion board software changing it. |
I will fix the exclude logic tomorrow, I need to sleep now. |
The qss file can be colorized in my local machine, I will show you my settings and screenshot tomorrow |
{
"colorize.languages": ["css", "scss", "less", "xml", "svg"],
"colorize.enable_search_variables": false,
"colorize.include": [
"**/*.css",
"**/*.scss",
"**/*.sass",
"**/*.less",
"**/*.styl",
"**/*.qss"
],
} I had publish a new version fix the exclude logic tjx666@6aa0231 |
Just tried latest, still doesn't work for me. I did a complete uninstall, restart, install cycle. I think something else is going on. The code in the commit looks ok. Are you sure the build pipeline is working right? Have you confirmed it working on your end with the production version? I'm just wondering if the package reg-to-exp is the problem. I'm using the latest version of Vscode on Windows 10. The extension version shows as 0.12.8 |
I think you're not using Windows. Could be the way Windows uses backslashes instead of forward slashes in filenames. Not sure if glob-to-regexp supports Windows. There's a later version forked. kd-glob-to-regexp 0.4.2 |
Looking at index.js of the dependency glob-to-regexp, it appears to be a single function that parses the input string one character at a time and builds the regex string. In the switch cases I don't see a check for "\" which is how the Windows path separator would look. |
can you provide a screenshot of this extension homepage in vscode. I want to ensure you are using my latest version |
can you provide a screenshot of this extension homepage in vscode? I want to ensure you are using my latest version |
Pretty sure it's the latest. I can see the newest functions in the extension code, though obfuscated and minified. function fr(r){return f.filesToExcludes.some(e=>(0,he.default)(e).test(r))}function hr(r){return f.filesToIncludes.some(e=>(0,he.default)(e).test(r))} |
I'm outside visiting my relatives.I will test it on windows tonight |
@reefhound try latest version |
Works now. Great job. |
The Colorize tray icon says "Colorize is not activated for this file"
I'm trying to colorize qss files, Python's PyQt styling. I have my settings as:
"colorize.include": [
"**/*.qss"
],
The content is similar to CSS and colorizes fine when pasted into a file with a .css extension so the issue is it's not processing the .qss file. I have not seen one person report getting this to work. Is there some additional step required?
I've tried both the original version by Kami and the newer fork.
Also, the "colorize.exclude" doesn't work either. I added to exclude .css and it still colorizes it even after restart.
"colorize.exclude": ["/*.css", "/*.scss"],
The text was updated successfully, but these errors were encountered: