CSS language server doesn't apply filtering
Closed this issue · 3 comments
- VSCode Version: 1.5.3 (5be4091)
- OS Version: Linux Fedora 24
I'm trying to consume the CSS language server from VSCode via stdio
/usr/bin/node /usr/share/code/resources/app/extensions/css/server/out/cssServerMain.js --stdio
and connect to it using the https://github.com/eclipselabs/eclipse-language-service and underlying https://github.com/TypeFox/ls-api
- Connection works, request are well sent and result well received.
- When trying to complete after the
a
in
a {
}
I see that :checked
is proposed, whereas it doesn't make sense here. If I try VSCode directly, the :checked
isn't proposed. It seems like VSCode has some additional filtering for the CSS pseudo-classes, and that this filtering is not part of the language server.
Could this filtering be part on the language server side?
Yes, that's how it is designed. Filtering has to be done client side. Some clients want to only filter by prefix, some using camel-case or fuzzy-matching. For consistency across languages we let the client do the filtering.
Assigning to @dbaeumer to add that to the language server protocol documentation.
So that means that the client has to do some level of file-reading to at least guess the word it applies to? I have the impression this is contrary to the goals of the protocol. Maybe the filtering strategy should be passed by clients as an option when starting the server, so the server would apply the requested strategy. Default strategy would be "none" (like now), other possible value would be "fuzzy" or "prefix".
This issue was moved to microsoft/language-server-protocol#105