0

Meaning enabling proper syntax and error highlighting, and suggestions. I'm not building my program through Kate, only editing code.

When I try to write the following in Kate (in a file called main.cpp that Kate uses c++ syntax highlighting etc. on, but it must be using an older language version):

#include <filesystem>
//stuff
std::filesystem::path path;

, I get the error: [clang] (no member) No member named 'filesystem' in namespace 'std', which is almost identical to the error that Visual Studio gives if I try to use std::filesystem without changing the Language setting to c++17 (or later). But, I have no idea how to change to c++17 syntax highlighting in Kate, or if that's even possible.

I checked the documentation and googled, and checked all the results on stackoverflow that I could find, and went through all the menus, but I don't know enough about using Kate yet to be able to figure out how to enable c++17 language in Kate on my own, unfortunately.

edit: In Settings > Configure Kate > LSP Client > Default Server Settings it says:

"servers": {
    ...
    "c": {
        "command": ["clangd", "-log=error", "--background-index", "--limit-results=500", "--completion-style=bundled"],
        "commandDebug": ["clangd", "-log=verbose", "--background-index"],
        "url": "https://clang.llvm.org/extra/clangd/",
        "highlightingModeRegex": "^(C|ANSI C89|Objective-C)$"
    },
    "cpp": {
        "use": "c",
        "highlightingModeRegex": "^(C\\+\\+|ISO C\\+\\+|Objective-C\\+\\+)$"
    },
  • 1
    Does the file contain the necessary include? – jabaa Aug 05 '23 at 03:07
  • I didn't even know that Kate could be used to edit c++ code. – Something Something Aug 05 '23 at 03:08
  • @HenriqueBucher Every text editor can be used to edit C++ code. C++ code is simple text. – jabaa Aug 05 '23 at 03:11
  • @jabaa dont be that guy, you know what I meant – Something Something Aug 05 '23 at 03:12
  • 1
    @HenriqueBucher No, I honestly don't know what you mean. Do you mean syntax highlighting? Do you mean compilation and debugging? I have no idea. – jabaa Aug 05 '23 at 03:13
  • 1
    @HenriqueBucher https://kate-editor.org/syntax/ https://kate-editor.org/about-kate/ – jabaa Aug 05 '23 at 03:15
  • @jabaa It does have #include yeah – golightlydev Aug 05 '23 at 04:10
  • 1
    From some quick googling it looks like Kate itself doesn't support c++ parsing, just syntax highlighting. I'm guessing you're using a plugin to enable this? The documentation for that plugin likely details how to configure it – Alan Birtles Aug 05 '23 at 06:29
  • Kate is one of the finest editors ever written. Ever since KDE2, and especially since KDE3 its syntax highlighting, and extensive configuration has made it an exceptional choice. But, in the end, it is an editor, a very good multi-document editor, with the ability to save sessions, and it provides a command-line. It is not an IDE. While it will build simple projects, its build configuration isn't that configurable. I've always just used it as an editor, to write the `Makefile` or `CMakeLists.txt` and then just open the command line or konsole and build from there. – David C. Rankin Aug 05 '23 at 08:44
  • @AlanBirtles I think it involves the LSP Client. I've added what I found there in the settings to my question above – golightlydev Aug 05 '23 at 14:04

0 Answers0