Errors when using SourceKit-LSP with Kate Editor

I'm trying to use SourceKit-LSP from Swift 6.3.3 on Linux with KDE's Kate Editor. I'm finding that new symbols are not identified when created in a new file, and there are a few LSP errors that populate. I'm assuming whatever issue there is primarily lies on Kate's side, but is the below info meaningful towards identifying what the issue actually is?

katelspclientplugin: buffer size 391
katelspclientplugin: got message payload size 368
katelspclientplugin: message payload:
{"jsonrpc":"2.0","result":{"detail":"","sortText":"4985.26681591-struct","insertText":"struct","textEdit":{"range":{"end":{"line":0,"character":1},"start":{"line":0,"character":0}},"newText":"struct"},"kind":14,"label":"struct","data":{"itemId":11,"sessionId":0,"uri":"file:\/\/\/home\/ww2406\/projects\/project_swift\/Sources\/project\/models\/test3.swift"}},"id":14}
katelspclientplugin: buffer size 0
katelspclientplugin: calling $/cancelRequest
katelspclientplugin: sending message:
{
    "jsonrpc": "2.0",
    "method": "$/cancelRequest",
    "params": {
        "id": 15
    }
}

katelspclientplugin: buffer size 111
katelspclientplugin: got message payload size 89
katelspclientplugin: message payload:
{"error":{"code":-32800,"message":"request cancelled by client"},"jsonrpc":"2.0","id":15}
katelspclientplugin: unexpected reply id 15
katelspclientplugin: buffer size 0
katelspclientplugin: calling textDocument/documentHighlight
katelspclientplugin: sending message:
{
    "id": 16,
    "jsonrpc": "2.0",
    "method": "textDocument/documentHighlight",
    "params": {
        "position": {
            "character": 4,
            "line": 0
        },
        "textDocument": {
            "uri": "file:///home/ww2406/projects/project_swift/Sources/project/models/test3.swift"
        }
    }
}

katelspclientplugin: calling $/cancelRequest
katelspclientplugin: sending message:
{
    "jsonrpc": "2.0",
    "method": "$/cancelRequest",
    "params": {
        "id": 16
    }
}

sourcekit: [1:findRelatedIdentifiersInFile: 0.0000] failed to create an ASTInvocation: error: no input files
katelspclientplugin: buffer size 111
katelspclientplugin: got message payload size 89
katelspclientplugin: message payload:
{"jsonrpc":"2.0","id":16,"error":{"message":"request cancelled by client","code":-32800}}
katelspclientplugin: unexpected reply id 16
katelspclientplugin: buffer size 0


I'm finding that new symbols are not identified when created in a new file

Are you sending workspace/didChangeWatchedFiles notifications for newly created files?

failed to create an ASTInvocation: error: no input files

This likely means that we didn’t get compiler arguments for the file you’re opening. Did you open the workspace folder that contains Package.swift? Do debug this further, we’d need the output of sourcekit-lsp diagnose with extended logging enabled (see sourcekit-lsp/Documentation/Diagnose Bundle.md at main · swiftlang/sourcekit-lsp · GitHub). You may also be able to tell what’s going wrong yourself by reading the logs as described in sourcekit-lsp/CONTRIBUTING.md at main · swiftlang/sourcekit-lsp · GitHub.

Thanks @ahoppen , I did some more investigation this weekend and came across workspace/didChangeWatchedFiles too as well as sourcekit-lsp diagnose. From reviewing the logs and Kate's source code, I believe that's what's missing. Would the failed to create an ASTInvocation potentally be due to lack of workspace/didChangeWatchedFiles, in that sourcekit-lsp is never notified of changes in files and gets confused?

It might be, though I’m not sure. The log included in sourcekit-lsp diagnose should be able to tell us.

Sorry for the delay, here it is: sourcekit lsp diagnose · GitHub