Closed kanlukasz closed 3 years ago
Yes, /file:///
is not correct, correct path should be started with file:///
.
But I still can't point out what's exactly happened, can you check this option as below image shows and reproduce it again, then paste output channel messages to here?
Otherwise, this is indeed a mechanism to force load files when your code explicitly import codes like <style src="...">
or @import ...
, you may disable this by uncheck this option:
Huh.... it wasn't easy to reproduce, but I finally caught it. Hard to explain but i try 😱
There is some problem with respecting exclusions from .gitignore
.
Note: your ignoreFilesBy
option has a default setting
(I assume my git exclusions are correct too as the git repository cannot see these files):
# ignore specific current theme directory
wp-content/themes/xxxxxxxxx/assets/css
As you can see css
directory is ignored and there is a file style.min.css
But when i open that file, your plugin starts tracking it:
[14:48:34] file:///var/www/xxxxxxxxxx/public_html/wp-content/themes/xxxxxxxxxxxx/assets/css/style.min.css tracked
Now we can jump to the main issue. The file gets the wrong path because it's read accidentally while my package.json
scripts are executing. Let's compare it:
When i open file in normal way:
[14:48:34] file:///var/www/xxxxxxxxxx/public_html/wp-content/themes/xxxxxxxxxxxx/assets/css/style.min.css tracked
When i run my scripts from package.json
:
[15:04:35] file:///file%3A///var/www/xxxxxxxx/public_html/wp-content/themes/xxxxxxxx/assets/css/style.min.css tracked
After this action, erroneous messages start
package.json
file:{
"private": true,
"devDependencies": {
"autoprefixer": "latest",
"bootstrap": "latest",
"node-sass": "latest",
"nodemon": "latest",
"postcss": "latest",
"postcss-cli": "latest",
"stylelint": "latest",
"stylelint-config-recommended": "latest",
"stylelint-config-sass-guidelines": "latest",
"stylelint-config-standard": "latest",
"svgo": "latest"
},
"scripts": {
"css-compile": "npx node-sass --include-path node_modules --output-style compressed --source-map true --source-map-contents true --precision 6 wp-content/themes/xxxxxxxxxxxxxx/assets/scss/style.scss wp-content/themes/xxxxxxxxxxxxxx/assets/css/style.min.css",
"css-prefix": "npx postcss --replace wp-content/themes/xxxxxxxxxxxxxx/assets/css/style.min.css --use autoprefixer --map",
"css": "npm run css-compile && npm run css-prefix",
"watch": "nodemon -e scss --watch wp-content/themes/xxxxxxxxxxxxxx/assets/scss --exec \"npm run css\""
}
}
Excluding this directory using CSSNavigation.excludeGlobPatterns
"CSSNavigation.excludeGlobPatterns": [
"**/node_modules/**",
"**/bower_components/**",
"**/vendor/**",
"**/coverage/**",
"**/wp-content/themes/xxxxxxxxxxxx/assets/css/**"
]
Everything works fine with this setting added
Honestly, I don't know what now.
.gitignore
?During testing, I also accidentally noticed another problem. It is not related to what I described above but it may be useful for you. From what I can see, this only happens once after I reload VSCode and start using my project files
[Error - 1:55:03 PM] Request textDocument/definition failed.
Message: Request textDocument/definition failed with message: Cannot read property 'length' of null
Code: -32603
If it is important, of course I can create a separate ticket. Let me know
I think I already catch the main issue... fixing it.
Hi, I already publish a new version v1.10.3, can you help to check this? I think my system can't reproduce it.
Otherwise, I changed the description of option alwaysIncludeImportedFiles
to explain when true
it will always include the imported files although they should be excluded aspect to .gitignore
.
Hello,
I did a quick test and now it looks like the path is generating correctly:
[19:43:48] file:///var/www/xxxxxx/public_html/wp-content/themes/xxxxxxx/assets/css/style.min.css tracked
Still not sure about alwaysIncludeImportedFiles
behavior as whatever it is on true
or false
still tracked files excluded in gitignore
.
But I think I need to re-verify it, maybe I missed something. If I find any irregularities, I will let you know in a separate issue.
Anyway I think we can say that the main issue is solved 👍 and we can close this ticket ✔
Thanks for the quick issue fix, I appreciate it very much By the way, happy new year 🎉
Now I'm sure there's something wrong in the ignore-walk
library I'm using, I will check it, thanks.
Otherwise, happy new year to you!☺
Sorry I did some test but can't reproduce.
Otherwise there is an exception you may meet: if you already opened the CSS file you expected to be ignored in your vscode, definitions will can be found inside it.
I know this is a little mess...
Hello,
While i working at
WSL2
environment at Windows 10 i notice one error:That's not true because this file exist.
Maybe the problem is the beginning of the path
'/file://
?Another interesting thing is that directory
wp-content/themes/my2020/assets/css
is ignored in.gitignore
, so it should not be scannedWhat can we do with this? Let me know if you need more details