sublimelsp / LSP-css

CSS, SCSS, LESS support for Sublime's LSP plugin
MIT License
37 stars 0 forks source link

Configurations from `css.customData` not applied #37

Closed titouanmathis closed 2 years ago

titouanmathis commented 2 years ago

I have a configuration file defining the at-directives from Tailwind in the same folder as my LSP-css.sublime-settings which does not seem to be picked up by the server as I still get warnings for "Unkown at rule".

LSP-css.sublime-settings

{
    "settings": {
        "css.customData": [
            "./lsp-css-custom-data-tailwind.json"
        ]
    }
}

lsp-css-custom-data-tailwind.json

{
    "version": 1.1,
    "atDirectives": [
        {
            "description": "Tailwind",
            "name": "@tailwind"
        },
        {
            "description": "Apply.",
            "name": "@apply"
        },
        {
            "description": "Screens.",
            "name": "@screen"
        }
    ]
}

I think there might be an issue with the path resolution as it is relative. The data seems to be read in customData.js#22, but I do not know how to debug this part to check if the path is correctly resolved.

rchl commented 2 years ago

That json file should likely be at your projects root directory.

Having it alongside LSP-css.sublime-settings will surely not work.

rchl commented 2 years ago

Also, the idea with those kinda of settings is that you set those per-project (Project: Edit Project from the command palette).

You add those in:

{
    "folders":
    [
        ...
    ],
    "settings": {
        "LSP": {
            "LSP-css": {
                "settings": {
                    // ...
                }
            }
        }
    }
}
titouanmathis commented 2 years ago

Also, the idea with those kinda of settings is that you set those per-project (Project: Edit Project from the command palette).

I did not know that, thanks for the tip!