xaverh/vscode-clang-format

Formatter does not seem to work in jupyter notebooks

creme332 opened this issue · 0 comments

For C++ notebooks with the .ipynb extension, there's no option for Format Document With: in the command palette. Pressing SHIFT + ALT + F in a cell gives an error message There is no formatter for 'cpp' files installed.. However the formatter is working fine for files with the .cpp extension.

My settings.json file is as follows:

{
    "editor.codeActionsOnSave": {
        "source.fixAll": true
     },
     "editor.formatOnSave": true,
     "clang-format.executable": "/usr/bin/clang-format-10",
     "clang-format.style": "google",
     "clang-format.language.c.enable": true,
     "[c]": {
        "editor.defaultFormatter": "xaver.clang-format",
        "editor.wordBasedSuggestions": false,
        "editor.suggest.insertMode": "replace",
        "editor.semanticHighlighting.enabled": true
     }
}

How can I use the clang-formatter for c++ jupyter notebooks?