cheshirekow / cmake_format

Source code formatter for cmake listfiles.
GNU General Public License v3.0
954 stars 105 forks source link

Help using config file in vscode #204

Closed 4a-42 closed 4 years ago

4a-42 commented 4 years ago

I'm trying to use the cheshirekow.cmake-format extension. Here are my extension settings (the rest of the settings are on default values):

    "cmakeFormat.args": [
        "--log-level",
        "debug",
        "--config-file",
        "${worspaceFolder}/.cmake-format.py",
        "--"
    ],

I get this error message when I save a cmake file.

[2020-05-16 16:00:02.248] [renderer1] [warning] {"name":"Error","message":"Command failed: cmake-format --log-level debug --config-file ${worspaceFolder}/.cmake-format.py -- -\nCRITICAL __main__.py:572: Desired config file does not exist: ${worspaceFolder}/.cmake-format.py\r\n"}

It works with an absolute path, but it seems to not work with relative paths.

cheshirekow commented 4 years ago

Hi! The extension currently does not support variable substitutions. Also #177 has already been filed requesting this feature. As an FYI: this apparently isn't built into vscode and we extension authors must implement the substitution ourselves. It's relatively straightforward and I hope to have it implemented soon.

cheshirekow commented 4 years ago

Closing this since it's a duplicate, but feel free to add another comment if there is more you'd like to discuss.