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
Result.matched is all class names that catched by unocss core engine.
Before unocss core engine generate the result, transformers are applied.
So, if the source code is <template><view class="text-#f00">123</view></template>, transformer will transform it to <template><view class="text-_wn_f00">123</view></template>.
However, text-_wn_f00 isn't in original source code which vscode use to find the positions.
This is why.
I found a workaround, but I doesn't know whether it should be adopted into this repo, so I didn't create a pr.
The workaround is:
When we transform the code, we also inject a comment, the comment's content is all class names collected while transforming. The comment's format depends on that the source code is .vue file or .jsx? file.
I found that vscode unocss plugin doesn't work well with the
unocss-preset-weapp/transformer
, below is the reason:First, the vscode unocss plugin use the
getMatchedPositionsFromCode
function to extract all positions which need to be styled with a dashed underline:Result.matched is all class names that catched by unocss core engine.
Before unocss core engine generate the result, transformers are applied.
So, if the source code is
<template><view class="text-#f00">123</view></template>
, transformer will transform it to<template><view class="text-_wn_f00">123</view></template>
.However,
text-_wn_f00
isn't in original source code which vscode use to find the positions.This is why.
I found a workaround, but I doesn't know whether it should be adopted into this repo, so I didn't create a pr.
The workaround is:
When we transform the code, we also inject a comment, the comment's content is all class names collected while transforming. The comment's format depends on that the source code is
.vue
file or.jsx?
file.Here is the key code:
The text was updated successfully, but these errors were encountered: