Closed mjbvz closed 6 years ago
This has the same root cause as #46142. The attribute value is considered a string so normal quick suggestions are disabled.
You can override the token type using the new tokenTypes
grammar contribution: 95a406bd2ae73065e1f4277b6a909792aa38e87d
Somehow I cannot load css languages after splitting the folders. Once @aeschli help me out on this I can test adding the tokenTypes for css too and close the issue.
You may want to scope 581000a to just tags where quick suggestions should be active (namely those for paths). Not sure if treating all tag values as other
instead of string
will cause any problems
@mjbvz Thanks for fixing it. I did it for css, but couldn't for less and scss.
@mjbvz For less
This does not work, still marked as String
.
"tokenTypes": {
"support.function.any-method string.quoted": "other"
}
This marks it as Other
.
"tokenTypes": {
"support.function string.quoted": "other"
}
I thought the dash was causing the problem, but I saw you are having entity.name.function.tagged-template.js.jsx
. Any thoughts?
@aeschli SCSS grammar does not have a token type for URL function. Should I just forget about SCSS?
@octref I think the better fix is to add that to the package.json:
"configurationDefaults": {
"[html]": {
"editor.quickSuggestions": {
"strings": true
}
}
}
Same for css. It's not that URL are not strings. They are. It's that we also have good proposals inside strings.
@aeschli That would enable quick suggestions in all strings, which could be annoying since word based suggestions and snippet suggestions will now show up. The intent of tokenTypes
is to allow us to treat specific strings as language features instead of as normal string strings
Look how string literals are used in HTML and CSS. They all represent values. In these values, quick suggestions should work. I'm not a fan of word based suggestions and snippet suggestions either, but there's no reason that these do not show up in such values.
I found these suggestions very noisy:
I'm not a fan of word based suggestions and snippet suggestions either, but there's no reason that these do not show up in such values.
We can leave that to the user to config. The current fix limits its scope to only string literals.
Steps to Reproduce:
In a project:
With
index.html
:src
, types
to create'./s'
Bug No quick suggestions