sublimelsp / LSP-json

Schema validation/completions for your JSON and Sublime files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

schema file patterns with whitespace

deathaxe opened this issue · comments

Just noticed the file patterns for jsonschema extensions must not contain whitespace. Space needs to be escaped via %20 instead. It's quite logical from the uri perspective, but might not be too obvious.

The question is: Is it intended behavior or may some sort of translation be added, which escapes spaces and possibly other characters?

{
    "contributions": {
        "settings": [
            {
                "file_patterns": [
                    "A%20File%20Icon.sublime-settings"
                ],
                "schema": {

I think it makes sense to simplify that.

It's matched against file paths that per LSP spec are URIs. I'll use urllib.parse.quote to encode file patterns. That could encode too much. I had to explicitly exclude * from encoding and I might have missed some other characters that should not be encoded.

The server handles that pattern by escaping and converting to RegExp so it's quite a custom handling.

Thanks!