xcode-build-server icon indicating copy to clipboard operation
xcode-build-server copied to clipboard

In included file: <cstddef> tried including <stddef.h> but didn't find libc++'s <stddef.h> header.

Open liyderek opened this issue 1 year ago • 41 comments

I recently started using xcode-build-server with sourcekit-lsp in neovim, and I'm having trouble with the LSP. For context I used Xcodebuild.nvim to configure the setup and then ran the xcode-build-server command. For some reason the LSP only works in 1 file, which is a header file and gives me an error when I try to include .

In included file: <cstddef> tried including <stddef.h> but didn't find libc++'s <stddef.h> header.
This usually means that your header search paths are not configured properly.
The header search paths should contain the C++ Standard Library headers before
any C Standard Library, and you are probably using compiler flags that make that
not be the case. clang (pp_hash_error) [11, 10]
image image

liyderek avatar Sep 02 '24 01:09 liyderek

Did you correctly setup your workspace and xcode build server? if so,you can see xcode build server start up logs. you also need to configure Sourcekit lsp to handle c files

SolaWing avatar Sep 02 '24 01:09 SolaWing

see xcode build server start up logs

@SolaWing Sorry for noob question but what are these logs and how can I get them? Do you mean LSP logs?

liyderek avatar Sep 02 '24 01:09 liyderek

YES, if you export SOURCEKIT_LOGGING=3, you will see more detail logs from lsp and xcode-build-server.

SolaWing avatar Sep 02 '24 02:09 SolaWing

@SolaWing Finally figured out logs from sourcekit, but xcode-build-server logs are not there. Here's some of the log

[START][2024-09-01 21:19:28] LSP logging initiated
   2   │ [INFO][2024-09-01 21:19:28] .../vim/lsp/rpc.lua:731 "Starting RPC client"   {  cmd = { "/usr/bin/sourcekit-lsp" },  extra = {    cwd = "/Users/derek/Documents/testgame"  }}
   3   │ [DEBUG][2024-09-01 21:19:28] .../vim/lsp/rpc.lua:286    "rpc.send"  {  id = 1,  jsonrpc = "2.0",  method = "initialize",  params = {    capabilities = {      general = {        positionEncodings = { "utf-16" }      },      textDocument = {        
       │ callHierarchy = {          dynamicRegistration = false        },        codeAction = {          codeActionLiteralSupport = {            codeActionKind = {              valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline",
       │  "refactor.rewrite", "source", "source.organizeImports" }            }          },          dataSupport = true,          dynamicRegistration = true,          isPreferredSupport = true,          resolveSupport = {            properties = { "edit" }
       │           }        },        completion = {          completionItem = {            commitCharactersSupport = false,            deprecatedSupport = false,            documentationFormat = { "markdown", "plaintext" },            preselectSupport = f
       │ alse,            snippetSupport = false          },          completionItemKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }          },          completionList = {        
       │     itemDefaults = { "editRange", "insertTextFormat", "insertTextMode", "data" }          },          contextSupport = false,          dynamicRegistration = false        },        declaration = {          linkSupport = true        },        defini
       │ tion = {          dynamicRegistration = true,          linkSupport = true        },        diagnostic = {          dynamicRegistration = false        },        documentHighlight = {          dynamicRegistration = false        },        documentSym
       │ bol = {          dynamicRegistration = false,          hierarchicalDocumentSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }       
       │    }        },        formatting = {          dynamicRegistration = true        },        hover = {          contentFormat = { "markdown", "plaintext" },          dynamicRegistration = true        },        implementation = {          linkSupport 
       │ = true        },        inlayHint = {          dynamicRegistration = true,          resolveSupport = {            properties = { "textEdits", "tooltip", "location", "command" }          }        },        publishDiagnostics = {          dataSuppor
       │ t = true,          relatedInformation = true,          tagSupport = {            valueSet = { 1, 2 }          }        },        rangeFormatting = {          dynamicRegistration = true        },        references = {          dynamicRegistration =
       │  false        },        rename = {          dynamicRegistration = true,          prepareSupport = true        },        semanticTokens = {          augmentsSyntaxTokens = true,          dynamicRegistration = false,          formats = { "relative" 
       │ },          multilineTokenSupport = false,          overlappingTokenSupport = true,          requests = {            full = {              delta = true            },            range = false          },          serverCancelSupport = false,       
       │    tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" },          tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "
       │ typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" }        },        signatureHelp = {          dynami
       │ cRegistration = false,          signatureInformation = {            activeParameterSupport = true,            documentationFormat = { "markdown", "plaintext" },            parameterInformation = {              labelOffsetSupport = true            
       │ }          }        },        synchronization = {          didSave = true,          dynamicRegistration = false,          willSave = true,          willSaveWaitUntil = true        },        typeDefinition = {          linkSupport = true        }  
       │     },      window = {        showDocument = {          support = true        },        showMessage = {          messageActionItem = {            additionalPropertiesSupport = false          }        },        workDoneProgress = true      },      
       │ workspace = {        applyEdit = true,        configuration = true,        didChangeConfiguration = {          dynamicRegistration = false        },        didChangeWatchedFiles = {          dynamicRegistration = true,          relativePatternSupp
       │ ort = true        },        inlayHint = {          refreshSupport = true        },        semanticTokens = {          refreshSupport = true        },        symbol = {          dynamicRegistration = false,          symbolKind = {            valueS
       │ et = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        workspaceEdit = {          resourceOperations = { "rename", "create", "delete" }        },        workspaceFolders =
       │  true      }    },    clientInfo = {      name = "Neovim",      version = "0.10.1"    },    initializationOptions = vim.empty_dict(),    processId = 5960,    rootPath = "/Users/derek/Documents/testgame",    rootUri = "file:///Users/derek/Docum
       │ ents/testgame",    trace = "off",    workDoneToken = "1",    workspaceFolders = { {        name = "/Users/derek/Documents/testgame",        uri = "file:///Users/derek/Documents/testgame"      } }  }}
   4   │ [DEBUG][2024-09-01 21:19:28] .../vim/lsp/rpc.lua:408    "rpc.receive"   {  id = 1,  jsonrpc = "2.0",  result = {    capabilities = {      callHierarchyProvider = true,      codeActionProvider = vim.empty_dict(),      colorProvider = true,      com
       │ pletionProvider = {        resolveProvider = false,        triggerCharacters = { "." }      },      declarationProvider = true,      definitionProvider = true,      documentHighlightProvider = true,      documentSymbolProvider = true,      execute
       │ CommandProvider = {        commands = { "semantic.refactor.command" }      },      foldingRangeProvider = true,      hoverProvider = true,      implementationProvider = true,      referencesProvider = true,      textDocumentSync = {        change 
       │ = 2,        openClose = true,        save = {          includeText = false        },        willSave = true,        willSaveWaitUntil = false      },      typeHierarchyProvider = true,      workspace = {        workspaceFolders = {          change
       │ Notifications = true,          supported = true        }      },      workspaceSymbolProvider = true    }  }}

liyderek avatar Sep 02 '24 04:09 liyderek

your log seems only LSP Client's log, no LSP Server log from sourcekit.

SolaWing avatar Sep 02 '24 05:09 SolaWing

@SolaWing I'm not getting any useful logs from sourcekit-lsp... I got this from the system log

default	11:35:45.982711-0700	sourcekit-lsp	[0x600002d50000] activating connection: mach=true listener=false peer=false name=com.apple.cfprefsd.daemon
default	11:35:45.982768-0700	sourcekit-lsp	[0x600002d500f0] activating connection: mach=true listener=false peer=false name=com.apple.cfprefsd.agent

Here's my config for sourcekit

vim.lsp.set_log_level("debug")
require "lspconfig".sourcekit.setup{
    filetypes = { "swift", "c", "cpp", "objective-c", "objective-cpp" },
    cmd = { "sh", "/Users/derek/.config/nvim/sourcekit_lsp.sh" },
}

sourcekit_lsp.sh:

SOURCEKIT_LOGGING=3 sourcekit-lsp

liyderek avatar Sep 02 '24 18:09 liyderek

still not see any lsp server logs.. also notice in vim, objective-c and objective-cpp will have the type objc and objcpp, not same as LSP's languageID, and it may need to mapping by your lsp-client.

here is a sample output from sourcekit-lsp by my coc.nvim output:


[2024-09-03 10:47:09.731] SourceKitServer: Request<initialize(0)>
[2024-09-03 10:47:09.735] SourceKitServer: Response<initialize(0)>
INFO:root:# xcode build server with python 3.12.5 (main, Aug  6 2024, 19:08:49) [Clang 15.0.0 (clang-1500.3.9.4)]]
INFO:server:Xcode Build Server Startup
DEBUG:server:Req --> {"id":1,"jsonrpc":"2.0","method":"build\/initialize","params":{"bspVersion":"2.0","displayName":"SourceKit-LSP","version":"1.0","capabilities":{"languageIds":["c","cpp","objective-c","objective-cpp","swift"]},"rootUri":"root"}}
DEBUG:server:Res <-- {"jsonrpc": "2.0", "id": 1, "result": {"displayName": "xcode build server", "version": "0.1", "bspVersion": "2.0", "rootUri": "file://root/", "capabilities": {"languageIds": ["c", "cpp", "objective-c", "objective-cpp", "swift"]}, "data": {"indexDatabasePath": "/Users/wang/Library/Caches/xcode-build-server/path/indexDatabasePath-943bca20aaeb8b42a6c2611225bd1cfd", "indexStorePath": "/Users/wang/Library/Developer/Xcode/DerivedData/pname/-athuzhygqqkfgydhrkmmrruvfkvf/Index.noindex/DataStore"}}}
DEBUG:server:Req --> {"params":{},"jsonrpc":"2.0","method":"build\/initialized"}
[2024-09-03 10:47:09.792] initialized build server xcode build server
[2024-09-03 10:47:09.794] opened IndexStoreDB at /Users/wang/Library/Caches/xcode-build-server/path/indexDatabasePath-943bca20aaeb8b42a6c2611225bd1cfd with store path /Users/wang/Library/Developer/Xcode/DerivedData/pname/-athuzhygqqkfgydhrkmmrruvfkvf/Index.noindex/DataStore
[2024-09-03 10:47:09.794] SourceKitServer: Notification<initialized>
[2024-09-03 10:47:09.794] SourceKitServer: Notification<workspace/didChangeConfiguration>
[2024-09-03 10:47:09.794] SourceKitServer: Notification<textDocument/didOpen>
sourcekit: [2:sourcekitd_initialize:6147: 0.0000] initializing
[2024-09-03 10:47:09.800] Using toolchain XcodeDefault (com.apple.dt.toolchain.XcodeDefault) for DocumentURI(storage: file://root/pname//ContentView.swift)
[2024-09-03 10:47:09.800] registerForChangeNotifications(root/pname//ContentView.swift)
DEBUG:server:Req --> {"method":"textDocument\/registerForChanges","params":{"uri":"file:\/\/\/Users\/wang\/Desktop\/personal\/OpenSource\/pname/\/pname/\/ContentView.swift","action":"register"},"id":2,"jsonrpc":"2.0"}
DEBUG:server:Res <-- {"jsonrpc": "2.0", "id": 2, "result": null}
DEBUG:root:infer root: root, None
DEBUG:server:Res <-- {"jsonrpc": "2.0", "method": "build/sourceKitOptionsChanged", "params": {"uri": "file://root/pname//ContentView.swift", "updatedOptions": {"options": ["root/pname//ContentView.swift", "-sdk", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/"], "workingDirectory": "root"}}}
[2024-09-03 10:47:09.801] BuildServerHandler: Notification<build/sourceKitOptionsChanged>
[2024-09-03 10:47:09.801] Initial build settings received for opened file DocumentURI(storage: file://root/pname//ContentView.swift)
sourcekit: [2:sourcekitd_send_request_sync-before:8979: 0.0052] {
  key.request: source.request.editor.open,
  key.name: "root/pname//ContentView.swift",
  key.compilerargs: [
    "root/pname//ContentView.swift",
    "-sdk",
    "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/",
    "-working-directory",
    "root"
  ],
  key.sourcetext: "//\n//  ContentView.swift\n// sourcetxt"
}
sourcekit: [4:handleInternalUIDRequest:4099: 0.0413] service queried UID for: source.request.enable_request_barriers
sourcekit: [4:handleInternalUIDRequest:4099: 0.0413] service queried UID for: source.request.configuration.global
sourcekit: [4:handleInternalUIDRequest:4099: 0.0414] service queried UID for: source.request.protocol_version
sourcekit: [4:handleInternalUIDRequest:4099: 0.0414] service queried UID for: source.request.compiler_version
sourcekit: [4:handleInternalUIDRequest:4099: 0.0414] service queried UID for: source.request.crash_exit
sourcekit: [4:handleInternalUIDRequest:4099: 0.0415] service queried UID for: source.request.test_notification
sourcekit: [4:handleInternalUIDRequest:4099: 0.0415] service queried UID for: source.request.statistics
sourcekit: [4:handleInternalUIDRequest:4099: 0.0416] service queried UID for: source.request.demangle
sourcekit: [4:handleInternalUIDRequest:4099: 0.0416] service queried UID for: source.request.mangle_simple_class
sourcekit: [4:handleInternalUIDRequest:4099: 0.0416] service queried UID for: source.request.enable-compile-notifications
sourcekit: [4:handleInternalUIDRequest:4099: 0.0417] service queried UID for: source.request.buildsettings.register
sourcekit: [4:handleInternalUIDRequest:4099: 0.0417] service queried UID for: source.request.dependency_updated
sourcekit: [4:handleInternalUIDRequest:4099: 0.0417] service queried UID for: source.request.docinfo
sourcekit: [4:handleInternalUIDRequest:4099: 0.0417] service queried UID for: source.request.editor.open
sourcekit: [4:handleInternalUIDRequest:4099: 0.0445] service queried UID for: source.diagnostic.stage.swift.parse
sourcekit: [4:handleInternalUIDRequest:4099: 0.0448] service queried UID for: source.decl.attribute._custom
sourcekit: [4:handleInternalUIDRequest:4099: 0.0448] service queried UID for: source.lang.swift.decl.var.instance
sourcekit: [4:handleInternalUIDRequest:4099: 0.0449] service queried UID for: source.lang.swift.accessibility.internal
sourcekit: [4:handleInternalUIDRequest:4099: 0.0449] service queried UID for: source.lang.swift.expr.call
sourcekit: [4:handleInternalUIDRequest:4099: 0.0449] service queried UID for: source.lang.swift.syntaxtype.comment.mark
sourcekit: [4:handleInternalUIDRequest:4099: 0.0450] service queried UID for: source.lang.swift.expr.argument
sourcekit: [4:handleInternalUIDRequest:4099: 0.0451] service queried UID for: source.lang.swift.stmt.brace
sourcekit: [4:handleInternalUIDRequest:4099: 0.0451] service queried UID for: source.lang.swift.expr.closure
sourcekit: [4:handleInternalUIDRequest:4099: 0.0452] service queried UID for: source.lang.swift.structure.elem.condition_expr
sourcekit: [4:handleInternalUIDRequest:4099: 0.0452] service queried UID for: source.lang.swift.stmt.if
sourcekit: [4:handleInternalUIDRequest:4099: 0.0453] service queried UID for: source.lang.swift.decl.var.local
sourcekit: [4:handleInternalUIDRequest:4099: 0.0453] service queried UID for: source.lang.swift.structure.elem.expr
sourcekit: [4:handleInternalUIDRequest:4099: 0.0453] service queried UID for: source.lang.swift.expr.array
sourcekit: [4:handleInternalUIDRequest:4099: 0.0454] service queried UID for: source.lang.swift.decl.var.parameter
sourcekit: [4:handleInternalUIDRequest:4099: 0.0454] service queried UID for: source.lang.swift.structure.elem.typeref
sourcekit: [4:handleInternalUIDRequest:4099: 0.0454] service queried UID for: source.lang.swift.decl.struct
sourcekit: [4:handleInternalUIDRequest:4099: 0.0456] service queried UID for: source.lang.swift.decl.function.method.static
sourcekit: [4:handleInternalUIDRequest:4099: 0.0457] service queried UID for: source.lang.swift.decl.generic_type_param
sourcekit: [4:handleInternalUIDRequest:4099: 0.0457] service queried UID for: source.lang.swift.decl.function.method.instance
sourcekit: [4:handleInternalUIDRequest:4099: 0.0457] service queried UID for: source.lang.swift.decl.var.static
sourcekit: [4:handleInternalUIDRequest:4099: 0.0458] service queried UID for: source.lang.swift.syntaxtype.comment
sourcekit: [4:handleInternalUIDRequest:4099: 0.0458] service queried UID for: source.lang.swift.syntaxtype.keyword
sourcekit: [4:handleInternalUIDRequest:4099: 0.0458] service queried UID for: source.lang.swift.syntaxtype.identifier
sourcekit: [4:handleInternalUIDRequest:4099: 0.0458] service queried UID for: source.lang.swift.syntaxtype.typeidentifier
sourcekit: [4:handleInternalUIDRequest:4099: 0.0459] service queried UID for: source.lang.swift.syntaxtype.string
sourcekit: [4:handleInternalUIDRequest:4099: 0.0459] service queried UID for: source.lang.swift.syntaxtype.number
sourcekit: [4:handleInternalUIDRequest:4099: 0.0459] service queried UID for: source.lang.swift.syntaxtype.operator
sourcekit: [2:sourcekitd_send_request_sync-after:8979: 0.0464] {
  key.offset: 0,
  key.length: 3981,
  key.diagnostic_stage: source.diagnostic.stage.swift.parse,
  key.syntaxmap: [
    {
      key.kind: source.lang.swift.syntaxtype.comment,
      key.offset: 0,
      key.length: 3
    },

SolaWing avatar Sep 03 '24 02:09 SolaWing

Finally got the stdout from the lsp... Here is the beginning log

DEBUG:server:Res <-- {"jsonrpc": "2.0", "method": "build/sourceKitOptionsChanged", "params": {"uri": "file:///Users/derek/Documents/testgame/testgame/renderer/TextButton.mm", "updatedOptions": {"options": ["-x", "objective-c++", "-ivfsstatcache", "/Users/derek/Documents/testgame/DerivedData/SDKStatCaches.noindex/macosx14.5-23F73-7e3fd6dc4171e65dbd154ba8db3956d2.sdkstatcache", "-fmessage-length=0", "-fdiagnostics-show-note-include-stack", "-fmacro-backtrace-limit=0", "-fno-color-diagnostics", "-fmodules-prune-interval=86400", "-fmodules-prune-after=345600", "-fbuild-session-file=/Users/derek/Documents/testgame/DerivedData/ModuleCache.noindex/Session.modulevalidation", "-fmodules-validate-once-per-build-session", "-Wnon-modular-include-in-framework-module", "-Werror=non-modular-include-in-framework-module", "-Wno-trigraphs", "-Wno-missing-field-initializers", "-Wno-missing-prototypes", "-Werror=return-type", "-Wdocumentation", "-Wunreachable-code", "-Wquoted-include-in-framework-header", "-Wno-implicit-atomic-properties", "-Werror=deprecated-objc-isa-usage", "-Wno-objc-interface-ivars", "-Werror=objc-root-class", "-Wno-arc-repeated-use-of-weak", "-Wimplicit-retain-self", "-Wno-non-virtual-dtor", "-Wno-overloaded-virtual", "-Wno-exit-time-destructors", "-Wduplicate-method-match", "-Wno-missing-braces", "-Wparentheses", "-Wswitch", "-Wunused-function", "-Wno-unused-label", "-Wno-unused-parameter", "-Wunused-variable", "-Wunused-value", "-Wempty-body", "-Wuninitialized", "-Wconditional-uninitialized", "-Wno-unknown-pragmas", "-Wno-shadow", "-Wno-four-char-constants", "-Wno-conversion", "-Wconstant-conversion", "-Wint-conversion", "-Wbool-conversion", "-Wenum-conversion", "-Wno-float-conversion", "-Wnon-literal-null-conversion", "-Wobjc-literal-conversion", "-Wshorten-64-to-32", "-Wno-newline-eof", "-Wno-selector", "-Wno-strict-selector-match", "-Wundeclared-selector", "-Wdeprecated-implementations", "-Wno-c++11-extensions", "-Wno-implicit-fallthrough", "-fstrict-aliasing", "-Wprotocol", "-Wdeprecated-declarations", "-Winvalid-offsetof", "-Wno-sign-conversion", "-Winfinite-recursion", "-Wmove", "-Wcomma", "-Wblock-capture-autoreleasing", "-Wstrict-prototypes", "-Wrange-loop-analysis", "-Wno-semicolon-before-method-body", "-Wunguarded-availability", "-index-store-path", "/Users/derek/Documents/testgame/DerivedData/testgame/Index.noindex/DataStore", "-target", "arm64-apple-macos14.4", "-std=gnu++20", "-fobjc-arc", "-fobjc-weak", "-fmodules", "-gmodules", "-fmodules-cache-path=/Users/derek/Documents/testgame/DerivedData/ModuleCache.noindex", "-fpascal-strings", "-O0", "-fno-common", "-DDEBUG=1", "-DOBJC_OLD_DISPATCH_PROTOTYPES=0", "-isysroot", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk", "-g", "-fvisibility-inlines-hidden", "-iquote", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-generated-files.hmap", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-own-target-headers.hmap", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-all-target-headers.hmap", "-iquote", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-project-headers.hmap", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Products/Debug/include", "-I/Users/derek/Documents/testgame/include", "-I/opt/homebrew/include/freetype2", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/DerivedSources-normal/arm64", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/DerivedSources/arm64", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/DerivedSources", "-F/Users/derek/Documents/testgame/DerivedData/testgame/Build/Products/Debug", "-MMD", "-MT", "dependencies", "-MF", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.d", "--serialize-diagnostics", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.dia", "-c", "/Users/derek/Documents/testgame/testgame/renderer/TextButton.mm", "-o", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.o", "-index-unit-output-path", "/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.o"], "workingDirectory": "/Users/derek/Documents/testgame"}}}


[2024-09-02 14:39:23.438] Using toolchain XcodeDefault (com.apple.dt.toolchain.XcodeDefault) for DocumentURI(storage: file:///Users/derek/Documents/testgame/testgame/renderer/TextButton.hpp)
[2024-09-02 14:39:23.449] registerForChangeNotifications(/Users/derek/Documents/testgame/testgame/renderer/TextButton.hpp)
[2024-09-02 14:39:23.449] mainFilesContainingFile(/Users/derek/Documents/testgame/testgame/renderer/TextButton.hpp) -> [LanguageServerProtocol.DocumentURI(storage: file:///Users/derek/Documents/testgame/testgame/renderer/TextButton.mm)]
[2024-09-02 14:39:23.451] BuildServerHandler: Notification<build/sourceKitOptionsChanged>(
  clientID: ObjectIdentifier(0x0000600003021400),
  params: FileOptionsChangedNotification(uri: LanguageServerProtocol.DocumentURI(storage: file:///Users/derek/Documents/testgame/testgame/renderer/TextButton.mm), updatedOptions: BuildServerProtocol.SourceKitOptionsResult(options: ["-x", "objective-c++", "-ivfsstatcache", "/Users/derek/Documents/testgame/DerivedData/SDKStatCaches.noindex/macosx14.5-23F73-7e3fd6dc4171e65dbd154ba8db3956d2.sdkstatcache", "-fmessage-length=0", "-fdiagnostics-show-note-include-stack", "-fmacro-backtrace-limit=0", "-fno-color-diagnostics", "-fmodules-prune-interval=86400", "-fmodules-prune-after=345600", "-fbuild-session-file=/Users/derek/Documents/testgame/DerivedData/ModuleCache.noindex/Session.modulevalidation", "-fmodules-validate-once-per-build-session", "-Wnon-modular-include-in-framework-module", "-Werror=non-modular-include-in-framework-module", "-Wno-trigraphs", "-Wno-missing-field-initializers", "-Wno-missing-prototypes", "-Werror=return-type", "-Wdocumentation", "-Wunreachable-code", "-Wquoted-include-in-framework-header", "-Wno-implicit-atomic-properties", "-Werror=deprecated-objc-isa-usage", "-Wno-objc-interface-ivars", "-Werror=objc-root-class", "-Wno-arc-repeated-use-of-weak", "-Wimplicit-retain-self", "-Wno-non-virtual-dtor", "-Wno-overloaded-virtual", "-Wno-exit-time-destructors", "-Wduplicate-method-match", "-Wno-missing-braces", "-Wparentheses", "-Wswitch", "-Wunused-function", "-Wno-unused-label", "-Wno-unused-parameter", "-Wunused-variable", "-Wunused-value", "-Wempty-body", "-Wuninitialized", "-Wconditional-uninitialized", "-Wno-unknown-pragmas", "-Wno-shadow", "-Wno-four-char-constants", "-Wno-conversion", "-Wconstant-conversion", "-Wint-conversion", "-Wbool-conversion", "-Wenum-conversion", "-Wno-float-conversion", "-Wnon-literal-null-conversion", "-Wobjc-literal-conversion", "-Wshorten-64-to-32", "-Wno-newline-eof", "-Wno-selector", "-Wno-strict-selector-match", "-Wundeclared-selector", "-Wdeprecated-implementations", "-Wno-c++11-extensions", "-Wno-implicit-fallthrough", "-fstrict-aliasing", "-Wprotocol", "-Wdeprecated-declarations", "-Winvalid-offsetof", "-Wno-sign-conversion", "-Winfinite-recursion", "-Wmove", "-Wcomma", "-Wblock-capture-autoreleasing", "-Wstrict-prototypes", "-Wrange-loop-analysis", "-Wno-semicolon-before-method-body", "-Wunguarded-availability", "-index-store-path", "/Users/derek/Documents/testgame/DerivedData/testgame/Index.noindex/DataStore", "-target", "arm64-apple-macos14.4", "-std=gnu++20", "-fobjc-arc", "-fobjc-weak", "-fmodules", "-gmodules", "-fmodules-cache-path=/Users/derek/Documents/testgame/DerivedData/ModuleCache.noindex", "-fpascal-strings", "-O0", "-fno-common", "-DDEBUG=1", "-DOBJC_OLD_DISPATCH_PROTOTYPES=0", "-isysroot", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk", "-g", "-fvisibility-inlines-hidden", "-iquote", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-generated-files.hmap", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-own-target-headers.hmap", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-all-target-headers.hmap", "-iquote", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-project-headers.hmap", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Products/Debug/include", "-I/Users/derek/Documents/testgame/include", "-I/opt/homebrew/include/freetype2", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/DerivedSources-normal/arm64", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/DerivedSources/arm64", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/DerivedSources", "-F/Users/derek/Documents/testgame/DerivedData/testgame/Build/Products/Debug", "-MMD", "-MT", "dependencies", "-MF", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.d", "--serialize-diagnostics", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.dia", "-c", "/Users/derek/Documents/testgame/testgame/renderer/TextButton.mm", "-o", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.o", "-index-unit-output-path", "/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.o"], workingDirectory: Optional("/Users/derek/Documents/testgame")))
)
[2024-09-02 14:39:23.451] Initial build settings received for opened file DocumentURI(storage: file:///Users/derek/Documents/testgame/testgame/renderer/TextButton.hpp)


[2024-09-02 14:39:23.451] settings for DocumentURI(storage: file:///Users/derek/Documents/testgame/testgame/renderer/TextButton.hpp): ["/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang", "-xobjective-c++", "-x", "objective-c++", "-ivfsstatcache", "/Users/derek/Documents/testgame/DerivedData/SDKStatCaches.noindex/macosx14.5-23F73-7e3fd6dc4171e65dbd154ba8db3956d2.sdkstatcache", "-fmessage-length=0", "-fdiagnostics-show-note-include-stack", "-fmacro-backtrace-limit=0", "-fno-color-diagnostics", "-fmodules-prune-interval=86400", "-fmodules-prune-after=345600", "-fbuild-session-file=/Users/derek/Documents/testgame/DerivedData/ModuleCache.noindex/Session.modulevalidation", "-fmodules-validate-once-per-build-session", "-Wnon-modular-include-in-framework-module", "-Werror=non-modular-include-in-framework-module", "-Wno-trigraphs", "-Wno-missing-field-initializers", "-Wno-missing-prototypes", "-Werror=return-type", "-Wdocumentation", "-Wunreachable-code", "-Wquoted-include-in-framework-header", "-Wno-implicit-atomic-properties", "-Werror=deprecated-objc-isa-usage", "-Wno-objc-interface-ivars", "-Werror=objc-root-class", "-Wno-arc-repeated-use-of-weak", "-Wimplicit-retain-self", "-Wno-non-virtual-dtor", "-Wno-overloaded-virtual", "-Wno-exit-time-destructors", "-Wduplicate-method-match", "-Wno-missing-braces", "-Wparentheses", "-Wswitch", "-Wunused-function", "-Wno-unused-label", "-Wno-unused-parameter", "-Wunused-variable", "-Wunused-value", "-Wempty-body", "-Wuninitialized", "-Wconditional-uninitialized", "-Wno-unknown-pragmas", "-Wno-shadow", "-Wno-four-char-constants", "-Wno-conversion", "-Wconstant-conversion", "-Wint-conversion", "-Wbool-conversion", "-Wenum-conversion", "-Wno-float-conversion", "-Wnon-literal-null-conversion", "-Wobjc-literal-conversion", "-Wshorten-64-to-32", "-Wno-newline-eof", "-Wno-selector", "-Wno-strict-selector-match", "-Wundeclared-selector", "-Wdeprecated-implementations", "-Wno-c++11-extensions", "-Wno-implicit-fallthrough", "-fstrict-aliasing", "-Wprotocol", "-Wdeprecated-declarations", "-Winvalid-offsetof", "-Wno-sign-conversion", "-Winfinite-recursion", "-Wmove", "-Wcomma", "-Wblock-capture-autoreleasing", "-Wstrict-prototypes", "-Wrange-loop-analysis", "-Wno-semicolon-before-method-body", "-Wunguarded-availability", "-index-store-path", "/Users/derek/Documents/testgame/DerivedData/testgame/Index.noindex/DataStore", "-target", "arm64-apple-macos14.4", "-std=gnu++20", "-fobjc-arc", "-fobjc-weak", "-fmodules", "-gmodules", "-fmodules-cache-path=/Users/derek/Documents/testgame/DerivedData/ModuleCache.noindex", "-fpascal-strings", "-O0", "-fno-common", "-DDEBUG=1", "-DOBJC_OLD_DISPATCH_PROTOTYPES=0", "-isysroot", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk", "-g", "-fvisibility-inlines-hidden", "-iquote", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-generated-files.hmap", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-own-target-headers.hmap", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-all-target-headers.hmap", "-iquote", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-project-headers.hmap", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Products/Debug/include", "-I/Users/derek/Documents/testgame/include", "-I/opt/homebrew/include/freetype2", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/DerivedSources-normal/arm64", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/DerivedSources/arm64", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/DerivedSources", "-F/Users/derek/Documents/testgame/DerivedData/testgame/Build/Products/Debug", "-MMD", "-MT", "dependencies", "-MF", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.d", "--serialize-diagnostics", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.dia", "-c", "/Users/derek/Documents/testgame/testgame/renderer/TextButton.hpp", "-o", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.o", "-index-unit-output-path", "/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.o", "-Xclang", "-fmodule-format=raw", "-working-directory", "/Users/derek/Documents/testgame"]
I[14:39:23.454] ASTWorker building file /Users/derek/Documents/testgame/testgame/renderer/TextButton.hpp version 0 with command 
[/Users/derek/Documents/testgame]
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -xobjective-c++ -x objective-c++ -ivfsstatcache /Users/derek/Documents/testgame/DerivedData/SDKStatCaches.noindex/macosx14.5-23F73-7e3fd6dc4171e65dbd154ba8db3956d2.sdkstatcache -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fno-color-diagnostics -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/derek/Documents/testgame/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code -Wquoted-include-in-framework-header -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -Wno-c++11-extensions -Wno-implicit-fallthrough -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body -Wunguarded-availability -index-store-path /Users/derek/Documents/testgame/DerivedData/testgame/Index.noindex/DataStore -target arm64-apple-macos14.4 -std=gnu++20 -fobjc-arc -fobjc-weak -fmodules -gmodules -fmodules-cache-path=/Users/derek/Documents/testgame/DerivedData/ModuleCache.noindex -fpascal-strings -O0 -fno-common -DDEBUG=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -g -fvisibility-inlines-hidden -iquote /Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-generated-files.hmap -I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-own-target-headers.hmap -I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-all-target-headers.hmap -iquote /Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noinde

[2024-09-02 14:39:24.778] ClangLanguageServerShim: Request<workspace/semanticTokens/refresh>(
  id: 0,
  clientID: ObjectIdentifier(0x000060000302d700),
  params: WorkspaceSemanticTokensRefreshRequest()
)
[2024-09-02 14:39:24.778] SourceKitServer: Request<workspace/semanticTokens/refresh>(
  id: 1,
  clientID: ObjectIdentifier(0x0000600000b2cf80),
  params: WorkspaceSemanticTokensRefreshRequest()
)
"

I[14:39:24.778] <-- reply(0)
E[14:39:24.778] Failed to decode workspace/semanticTokens/refresh reply: expected null
E[14:39:24.778] Failed to refresh semantic tokens: -32602: failed to decode workspace/semanticTokens/refresh reply: expected null
[2024-09-02 14:39:24.779] SourceKitServer: Response<workspace/semanticTokens/refresh(1)>(
  success(LanguageServerProtocol.VoidResponse())
)
[2024-09-02 14:39:24.779] ClangLanguageServerShim: Response<workspace/semanticTokens/refresh(0)>(
  success(LanguageServerProtocol.VoidResponse())
)


[2024-09-02 14:39:24.809] ClangLanguageServerShim: Notification<textDocument/publishDiagnostics>(
  clientID: ObjectIdentifier(0x000060000302d700),
  params: PublishDiagnosticsNotification(uri: LanguageServerProtocol.DocumentURI(storage: file:///Users/derek/Documents/testgame/testgame/renderer/TextButton.hpp), version: Optional(0), diagnostics: [LanguageServerProtocol.Diagnostic(_range: LanguageServerProtocol.CustomCodable<LanguageServerProtocol.PositionRange>(wrappedValue: Range(Position(line: 10, utf16index: 9)..<Position(line: 10, utf16index: 10))), severity: Optional(LanguageServerProtocol.DiagnosticSeverity.error), code: Optional("pp_hash_error"), codeDescription: nil, source: Optional("clang"), message: "In included file: <cstddef> tried including <stddef.h> but didn\'t find libc++\'s <stddef.h> header.           This usually means that your header search paths are not configured properly.           The header search paths should contain the C++ Standard Library headers before           any C Standard Library, and you are probably using compiler flags that make that           not be the case.", tags: nil, relatedInformation: Optional([LanguageServerProtocol.DiagnosticRelatedInformation(location: LanguageServerProtocol.Location(uri: LanguageServerProtocol.DocumentURI(storage: file:///Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c%2B%2B/v1/cstddef), _range: LanguageServerProtocol.CustomCodable<LanguageServerProtocol.PositionRange>(wrappedValue: Range(Position(line: 45, utf16index: 4)..<Position(line: 45, utf16index: 9)))), message: "Error occurred here", codeActions: nil)]), data: nil, codeActions: nil), LanguageServerProtocol.Diagnostic(_range: LanguageServerProtocol.CustomCodable<LanguageServerProtocol.PositionRange>(wrappedValue: Range(Position(line: 0, utf16index: 0)..<Position(line: 0, utf16index: 0))), severity: Optional(LanguageServerProtocol.DiagnosticSeverity.error), code: Optional("fatal_too_many_errors"), codeDescription: nil, source: Optional("clang"), message: "Too many errors emitted, stopping now", tags: nil, relatedInformation: Optional([]), data: nil, codeActions: nil), LanguageServerProtocol.Diagnostic(_range: LanguageServerProtocol.CustomCodable<LanguageServerProtocol.PositionRange>(wrappedValue: Range(Position(line: 20, utf16index: 4)..<Position(line: 20, utf16index: 14))), severity: Optional(LanguageServerProtocol.DiagnosticSeverity.warning), code: Optional("-Wdefaulted-function-deleted"), codeDescription: nil, source: Optional("clang"), message: "Explicitly defaulted default constructor is implicitly deleted (fix available)", tags: nil, relatedInformation: Optional([LanguageServerProtocol.DiagnosticRelatedInformation(location: LanguageServerProtocol.Location(uri: LanguageServerProtocol.DocumentURI(storage: file:///Users/derek/Documents/testgame/testgame/renderer/TextButton.hpp), _range: LanguageServerProtocol.CustomCodable<LanguageServerProtocol.PositionRange>(wrappedValue: Range(Position(line: 18, utf16index: 18)..<Position(line: 18, utf16index: 23)))), message: "Default constructor of \'TextButton\' is implicitly deleted because field \'click\' of const-qualified type \'const click_v\' (aka \'void (*const)(int, int)\') would not be initialized", codeActions: nil)]), data: nil, codeActions: nil)])
)
[2024-09-02 14:39:24.809] SourceKitServer: Notification<textDocument/publishDiagnostics>(
  clientID: ObjectIdentifier(0x0000600000b2cf80),
  params: PublishDiagnosticsNotification(uri: LanguageServerProtocol.DocumentURI(storage: file:///Users/derek/Documents/testgame/testgame/renderer/TextButton.hpp), version: Optional(0), diagnostics: [LanguageServerProtocol.Diagnostic(_range: LanguageServerProtocol.CustomCodable<LanguageServerProtocol.PositionRange>(wrappedValue: Range(Position(line: 10, utf16index: 9)..<Position(line: 10, utf16index: 10))), severity: Optional(LanguageServerProtocol.DiagnosticSeverity.error), code: Optional("pp_hash_error"), codeDescription: nil, source: Optional("clang"), message: "In included file: <cstddef> tried including <stddef.h> but didn\'t find libc++\'s <stddef.h> header.           This usually means that your header search paths are not configured properly.           The header search paths should contain the C++ Standard Library headers before           any C Standard Library, and you are probably using compiler flags that make that           not be the case.", tags: nil, relatedInformation: Optional([LanguageServerProtocol.DiagnosticRelatedInformation(location: LanguageServerProtocol.Location(uri: LanguageServerProtocol.DocumentURI(storage: file:///Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c%2B%2B/v1/cstddef), _range: LanguageServerProtocol.CustomCodable<LanguageServerProtocol.PositionRange>(wrappedValue: Range(Position(line: 45, utf16index: 4)..<Position(line: 45, utf16index: 9)))), message: "Error occurred here", codeActions: nil)]), data: nil, codeActions: nil), LanguageServerProtocol.Diagnostic(_range: LanguageServerProtocol.CustomCodable<LanguageServerProtocol.PositionRange>(wrappedValue: Range(Position(line: 0, utf16index: 0)..<Position(line: 0, utf16index: 0))), severity: Optional(LanguageServerProtocol.DiagnosticSeverity.error), code: Optional("fatal_too_many_errors"), codeDescription: nil, source: Optional("clang"), message: "Too many errors emitted, stopping now", tags: nil, relatedInformation: Optional([]), data: nil, codeActions: nil), LanguageServerProtocol.Diagnostic(_range: LanguageServerProtocol.CustomCodable<LanguageServerProtocol.PositionRange>(wrappedValue: Range(Position(line: 20, utf16index: 4)..<Position(line: 20, utf16index: 14))), severity: Optional(LanguageServerProtocol.DiagnosticSeverity.warning), code: Optional("-Wdefaulted-function-deleted"), codeDescription: nil, source: Optional("clang"), message: "Explicitly defaulted default constructor is implicitly deleted (fix available)", tags: nil, relatedInformation: Optional([LanguageServerProtocol.DiagnosticRelatedInformation(location: LanguageServerProtocol.Location(uri: LanguageServerProtocol.DocumentURI(storage: file:///Users/derek/Documents/testgame/testgame/renderer/TextButton.hpp), _range: LanguageServerProtocol.CustomCodable<LanguageServerProtocol.PositionRange>(wrappedValue: Range(Position(line: 18, utf16index: 18)..<Position(line: 18, utf16index: 23)))), message: "Default constructor of \'TextButton\' is implicitly deleted because field \'click\' of const-qualified type \'const click_v\' (aka \'void (*const)(int, int)\') would not be initialized", codeActions: nil)]), data: nil, codeActions: nil)])
)
[2024-09-02 14:39:24.810] SourceKitServer: Response<textDocument/documentHighlight(2)>(
  success(Optional([]))
)


[2024-09-02 14:39:25.028] SourceKitServer: Request<textDocument/documentHighlight>(
  id: 3,
  clientID: ObjectIdentifier(0x000060000302c200),
  params: DocumentHighlightRequest(textDocument: LanguageServerProtocol.TextDocumentIdentifier(uri: LanguageServerProtocol.DocumentURI(storage: file:///Users/derek/Documents/testgame/testgame/renderer/TextButton.hpp)), position: Position(line: 44, utf16index: 0))
)


[2024-09-02 14:39:25.376] SourceKitServer: Request<textDocument/documentHighlight>(
  id: 4,
  clientID: ObjectIdentifier(0x000060000302c200),
  params: DocumentHighlightRequest(textDocument: LanguageServerProtocol.TextDocumentIdentifier(uri: LanguageServerProtocol.DocumentURI(storage: file:///Users/derek/Documents/testgame/testgame/renderer/TextButton.hpp)), position: Position(line: 37, utf16index: 22))
)

liyderek avatar Sep 03 '24 05:09 liyderek

Did your project works? if not, did the flags from sourceKitOptionsChanged, has any difference with your compile command?

SolaWing avatar Sep 03 '24 05:09 SolaWing

@SolaWing Where do I get sourceKitOptionsChanged? Here's the buildserver.json

{
	"argv": [
		"/opt/homebrew/bin/xcode-build-server"
	],
	"bspVersion": "2.0",
	"languages": [
		"c",
		"cpp",
		"objective-c",
		"objective-cpp",
		"swift"
	],
	"name": "xcode build server",
	"version": "0.2",
	"workspace": "/Users/derek/Documents/testgame/testgame.xcodeproj/project.xcworkspace",
	"build_root": "/Users/derek/Documents/testgame/DerivedData/testgame",
	"scheme": "testgame",
	"kind": "xcode"
}

liyderek avatar Sep 04 '24 04:09 liyderek

sourceKitOptionsChanged can from lsp logs, if you set SOURCEKIT_LOGGING=3.

In addition, is your project running in the minimal demo project? If not, you can also upload this demo project to me to confirm whether there is any problem.

SolaWing avatar Sep 04 '24 05:09 SolaWing

@SolaWing How are you using sourcekit-lsp to get the logs? Are you running it in the terminal or ide?

liyderek avatar Sep 07 '24 03:09 liyderek

Logs here https://pastebin.com/NdJQQKUF

liyderek avatar Sep 07 '24 04:09 liyderek

here is sourceKitOptionsChanged flags from your compile logs. did it any different with your compile command? by the way, did it works in your FontRenderer.m files? or only not work in header files?

DEBUG:server:Res <-- {"jsonrpc": "2.0", "method": "build/sourceKitOptionsChanged", "params": {"uri": "file:///Users/derek/Documents/testgame/testgame/renderer/FontRenderer.m", "updatedOptions": {"options": ["-x", "objective-c", "-ivfsstatcache", "/Users/derek/Documents/testgame/DerivedData/SDKStatCaches.noindex/macosx14.5-23F73-7e3fd6dc4171e65dbd154ba8db3956d2.sdkstatcache", "-fmessage-length=0", "-fdiagnostics-show-note-include-stack", "-fmacro-backtrace-limit=0", "-fno-color-diagnostics", "-fmodules-prune-interval=86400", "-fmodules-prune-after=345600", "-fbuild-session-file=/Users/derek/Documents/testgame/DerivedData/ModuleCache.noindex/Session.modulevalidation", "-fmodules-validate-once-per-build-session", "-Wnon-modular-include-in-framework-module", "-Werror=non-modular-include-in-framework-module", "-Wno-trigraphs", "-Wno-missing-field-initializers", "-Wno-missing-prototypes", "-Werror=return-type", "-Wdocumentation", "-Wunreachable-code", "-Wquoted-include-in-framework-header", "-Wno-implicit-atomic-properties", "-Werror=deprecated-objc-isa-usage", "-Wno-objc-interface-ivars", "-Werror=objc-root-class", "-Wno-arc-repeated-use-of-weak", "-Wimplicit-retain-self", "-Wduplicate-method-match", "-Wno-missing-braces", "-Wparentheses", "-Wswitch", "-Wunused-function", "-Wno-unused-label", "-Wno-unused-parameter", "-Wunused-variable", "-Wunused-value", "-Wempty-body", "-Wuninitialized", "-Wconditional-uninitialized", "-Wno-unknown-pragmas", "-Wno-shadow", "-Wno-four-char-constants", "-Wno-conversion", "-Wconstant-conversion", "-Wint-conversion", "-Wbool-conversion", "-Wenum-conversion", "-Wno-float-conversion", "-Wnon-literal-null-conversion", "-Wobjc-literal-conversion", "-Wshorten-64-to-32", "-Wpointer-sign", "-Wno-newline-eof", "-Wno-selector", "-Wno-strict-selector-match", "-Wundeclared-selector", "-Wdeprecated-implementations", "-Wno-implicit-fallthrough", "-fstrict-aliasing", "-Wprotocol", "-Wdeprecated-declarations", "-Wno-sign-conversion", "-Winfinite-recursion", "-Wcomma", "-Wblock-capture-autoreleasing", "-Wstrict-prototypes", "-Wno-semicolon-before-method-body", "-Wunguarded-availability", "-index-store-path", "/Users/derek/Documents/testgame/DerivedData/testgame/Index.noindex/DataStore", "-target", "arm64-apple-macos14.4", "-std=gnu17", "-fobjc-arc", "-fobjc-weak", "-fmodules", "-gmodules", "-fmodules-cache-path=/Users/derek/Documents/testgame/DerivedData/ModuleCache.noindex", "-fpascal-strings", "-O0", "-fno-common", "-DDEBUG=1", "-DOBJC_OLD_DISPATCH_PROTOTYPES=0", "-isysroot", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk", "-g", "-iquote", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-generated-files.hmap", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-own-target-headers.hmap", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-all-target-headers.hmap", "-iquote", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-project-headers.hmap", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Products/Debug/include", "-I/Users/derek/Documents/testgame/include", "-I/opt/homebrew/include/freetype2", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/DerivedSources-normal/arm64", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/DerivedSources/arm64", "-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/DerivedSources", "-F/Users/derek/Documents/testgame/DerivedData/testgame/Build/Products/Debug", "-MMD", "-MT", "dependencies", "-MF", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/FontRenderer.d", "--serialize-diagnostics", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/FontRenderer.dia", "-c", "/Users/derek/Documents/testgame/testgame/renderer/FontRenderer.m", "-o", "/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/FontRenderer.o", "-index-unit-output-path", "/testgame.build/Debug/testgame.build/Objects-normal/arm64/FontRenderer.o"], "workingDirectory": "/Users/derek/Documents/testgame"}}}

SolaWing avatar Sep 08 '24 02:09 SolaWing

I switched to vscode and it worked on all files... Here is my compile command

-x objective-c++ -ivfsstatcache /Users/derek/Documents/testgame/DerivedData/SDKStatCaches.noindex/macosx14.5-23F73-7e3fd6dc4171e65dbd154ba8db3956d2.sdkstatcache -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fno-color-diagnostics -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/derek/Documents/testgame/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Wquoted-include-in-framework-header -Wno-implicit-atomic-properties -Werror\=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror\=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -Wno-c++11-extensions -Wno-implicit-fallthrough -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body -Wunguarded-availability -index-store-path /Users/derek/Documents/testgame/DerivedData/testgame/Index.noindex/DataStore @/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/af3fcb34312c57c0f52879cdce924b91-common-args.resp -MMD -MT dependencies -MF /Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.d --serialize-diagnostics /Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.dia -c /Users/derek/Documents/testgame/testgame/renderer/TextButton.mm -o /Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.o -index-unit-output-path /testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.o

This seems different from Sourcekit's compile command

liyderek avatar Sep 08 '24 03:09 liyderek

LSP will unfold flags, but basically it’s same. if it’s ok in your vscode, there may some config from your vim lsp config cause the problems

SolaWing avatar Sep 08 '24 03:09 SolaWing

@SolaWing in vscode sourcekit works in all files but the error is still there, also I saw in the logs that it failed to index the Foundation library is that normal?

liyderek avatar Sep 08 '24 04:09 liyderek

Fail to index Foundation seems not normal.

Did you have a minimum reproduce demo? Did new demo project works or only your projects not work?

SolaWing avatar Sep 08 '24 07:09 SolaWing

@SolaWing on an empty project with a .mm file, same error image

liyderek avatar Sep 09 '24 05:09 liyderek

wired, I can't reproduce in a simple demo app.. and I compare your flags with mine carefully, it's basically the same.. so the environment of yours may something wrong.. Not only can it not compile stddef.h, it can't even compile Foundation. maybe your sdk is broken? Can you compile successfully?

here is my new demo project: does it works for you? zip.zip

flags compare:

yours

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-xobjective-c++
-x
objective-c++
-ivfsstatcache
/Users/derek/Documents/testgame/DerivedData/SDKStatCaches.noindex/macosx14.5-23F73-7e3fd6dc4171e65dbd154ba8db3956d2.sdkstatcache
-fmessage-length=0
-fdiagnostics-show-note-include-stack
-fmacro-backtrace-limit=0
-fno-color-diagnostics
-fmodules-prune-interval=86400
-fmodules-prune-after=345600
-fbuild-session-file=/Users/derek/Documents/testgame/DerivedData/ModuleCache.noindex/Session.modulevalidation
-fmodules-validate-once-per-build-session
-Wnon-modular-include-in-framework-module
-Werror=non-modular-include-in-framework-module
-Wno-trigraphs
-Wno-missing-field-initializers
-Wno-missing-prototypes
-Werror=return-type
-Wdocumentation
-Wunreachable-code
-Wquoted-include-in-framework-header
-Wno-implicit-atomic-properties
-Werror=deprecated-objc-isa-usage
-Wno-objc-interface-ivars
-Werror=objc-root-class
-Wno-arc-repeated-use-of-weak
-Wimplicit-retain-self
-Wno-non-virtual-dtor
-Wno-overloaded-virtual
-Wno-exit-time-destructors
-Wduplicate-method-match
-Wno-missing-braces
-Wparentheses
-Wswitch
-Wunused-function
-Wno-unused-label
-Wno-unused-parameter
-Wunused-variable
-Wunused-value
-Wempty-body
-Wuninitialized
-Wconditional-uninitialized
-Wno-unknown-pragmas
-Wno-shadow
-Wno-four-char-constants
-Wno-conversion
-Wconstant-conversion
-Wint-conversion
-Wbool-conversion
-Wenum-conversion
-Wno-float-conversion
-Wnon-literal-null-conversion
-Wobjc-literal-conversion
-Wshorten-64-to-32
-Wno-newline-eof
-Wno-selector
-Wno-strict-selector-match
-Wundeclared-selector
-Wdeprecated-implementations
-Wno-c++11-extensions
-Wno-implicit-fallthrough
-fstrict-aliasing
-Wprotocol
-Wdeprecated-declarations
-Winvalid-offsetof
-Wno-sign-conversion
-Winfinite-recursion
-Wmove
-Wcomma
-Wblock-capture-autoreleasing
-Wstrict-prototypes
-Wrange-loop-analysis
-Wno-semicolon-before-method-body
-Wunguarded-availability
-index-store-path
/Users/derek/Documents/testgame/DerivedData/testgame/Index.noindex/DataStore
-target
arm64-apple-macos14.4
-std=gnu++20
-fobjc-arc
-fobjc-weak
-fmodules
-gmodules
-fmodules-cache-path=/Users/derek/Documents/testgame/DerivedData/ModuleCache.noindex
-fpascal-strings
-O0
-fno-common
-DDEBUG=1
-DOBJC_OLD_DISPATCH_PROTOTYPES=0
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk
-g
-fvisibility-inlines-hidden
-iquote
/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-generated-files.hmap
-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-own-target-headers.hmap
-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-all-target-headers.hmap
-iquote
/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/testgame-project-headers.hmap
-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Products/Debug/include
-I/Users/derek/Documents/testgame/include
-I/opt/homebrew/include/freetype2
-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/DerivedSources-normal/arm64
-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/DerivedSources/arm64
-I/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/DerivedSources
-F/Users/derek/Documents/testgame/DerivedData/testgame/Build/Products/Debug
-MMD
-MT
dependencies
-MF
/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.d
--serialize-diagnostics
/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.dia
-c
-o
/Users/derek/Documents/testgame/DerivedData/testgame/Build/Intermediates.noindex/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.o
-index-unit-output-path
/testgame.build/Debug/testgame.build/Objects-normal/arm64/TextButton.o
-Xclang
-fmodule-format=raw
-working-directory
/Users/derek/Documents/testgame
-resource-dir=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0
--
/Users/derek/Documents/testgame/testgame/renderer/TextButton.hpp

mines

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-xobjective-c++
-x
objective-c++
-ivfsstatcache
/Users/wang/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/macosx14.5-23F73-fc0f2f59e0c8875136f1dae492368c3a7e3fd6dc4171e65dbd154ba8db3956d2.sdkstatcache
-fmessage-length=0
-fdiagnostics-show-note-include-stack
-fmacro-backtrace-limit=0
-fno-color-diagnostics
-fmodules-prune-interval=86400
-fmodules-prune-after=345600
-fbuild-session-file=/Users/wang/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation
-fmodules-validate-once-per-build-session
-Wnon-modular-include-in-framework-module
-Werror=non-modular-include-in-framework-module
-Wno-trigraphs
-Wno-missing-field-initializers
-Wno-missing-prototypes
-Werror=return-type
-Wdocumentation
-Wunreachable-code
-Wquoted-include-in-framework-header
-Wno-implicit-atomic-properties
-Werror=deprecated-objc-isa-usage
-Wno-objc-interface-ivars
-Werror=objc-root-class
-Wno-arc-repeated-use-of-weak
-Wimplicit-retain-self
-Wno-non-virtual-dtor
-Wno-overloaded-virtual
-Wno-exit-time-destructors
-Wduplicate-method-match
-Wno-missing-braces
-Wparentheses
-Wswitch
-Wunused-function
-Wno-unused-label
-Wno-unused-parameter
-Wunused-variable
-Wunused-value
-Wempty-body
-Wuninitialized
-Wconditional-uninitialized
-Wno-unknown-pragmas
-Wno-shadow
-Wno-four-char-constants
-Wno-conversion
-Wconstant-conversion
-Wint-conversion
-Wbool-conversion
-Wenum-conversion
-Wno-float-conversion
-Wnon-literal-null-conversion
-Wobjc-literal-conversion
-Wshorten-64-to-32
-Wno-newline-eof
-Wno-selector
-Wno-strict-selector-match
-Wundeclared-selector
-Wdeprecated-implementations
-Wno-c++11-extensions
-Wno-implicit-fallthrough
-fstrict-aliasing
-Wprotocol
-Wdeprecated-declarations
-Winvalid-offsetof
-Wno-sign-conversion
-Winfinite-recursion
-Wmove
-Wcomma
-Wblock-capture-autoreleasing
-Wstrict-prototypes
-Wrange-loop-analysis
-Wno-semicolon-before-method-body
-Wunguarded-availability
-index-store-path
/Users/wang/Library/Developer/Xcode/DerivedData/BBB-cyokaitskczvsudphcitaklhfyvp/Index.noindex/DataStore
-target
arm64-apple-macos14.5
-std=gnu++20
-fobjc-arc
-fobjc-weak
-fmodules
-gmodules
-fmodules-cache-path=/Users/wang/Library/Developer/Xcode/DerivedData/ModuleCache.noindex
-fpascal-strings
-O0
-fno-common
-DDEBUG=1
-DOBJC_OLD_DISPATCH_PROTOTYPES=0
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk
-g
-fvisibility-inlines-hidden
-iquote
/Users/wang/Library/Developer/Xcode/DerivedData/BBB-cyokaitskczvsudphcitaklhfyvp/Build/Intermediates.noindex/BBB.build/Debug/BBB.build/BBB-generated-files.hmap
-I/Users/wang/Library/Developer/Xcode/DerivedData/BBB-cyokaitskczvsudphcitaklhfyvp/Build/Intermediates.noindex/BBB.build/Debug/BBB.build/BBB-own-target-headers.hmap
-I/Users/wang/Library/Developer/Xcode/DerivedData/BBB-cyokaitskczvsudphcitaklhfyvp/Build/Intermediates.noindex/BBB.build/Debug/BBB.build/BBB-all-target-headers.hmap
-iquote
/Users/wang/Library/Developer/Xcode/DerivedData/BBB-cyokaitskczvsudphcitaklhfyvp/Build/Intermediates.noindex/BBB.build/Debug/BBB.build/BBB-project-headers.hmap
-I/Users/wang/Library/Developer/Xcode/DerivedData/BBB-cyokaitskczvsudphcitaklhfyvp/Build/Products/Debug/include
-I/Users/wang/Library/Developer/Xcode/DerivedData/BBB-cyokaitskczvsudphcitaklhfyvp/Build/Intermediates.noindex/BBB.build/Debug/BBB.build/DerivedSources-normal/arm64
-I/opt/homebrew/include/freetype2
-I/Users/wang/Library/Developer/Xcode/DerivedData/BBB-cyokaitskczvsudphcitaklhfyvp/Build/Intermediates.noindex/BBB.build/Debug/BBB.build/DerivedSources/arm64
-I/Users/wang/Library/Developer/Xcode/DerivedData/BBB-cyokaitskczvsudphcitaklhfyvp/Build/Intermediates.noindex/BBB.build/Debug/BBB.build/DerivedSources
-F/Users/wang/Library/Developer/Xcode/DerivedData/BBB-cyokaitskczvsudphcitaklhfyvp/Build/Products/Debug
-MMD
-MT
dependencies
-MF
/Users/wang/Library/Developer/Xcode/DerivedData/BBB-cyokaitskczvsudphcitaklhfyvp/Build/Intermediates.noindex/BBB.build/Debug/BBB.build/Objects-normal/arm64/TestObjc.d
--serialize-diagnostics
/Users/wang/Library/Developer/Xcode/DerivedData/BBB-cyokaitskczvsudphcitaklhfyvp/Build/Intermediates.noindex/BBB.build/Debug/BBB.build/Objects-normal/arm64/TestObjc.dia
-c
-o
/Users/wang/Library/Developer/Xcode/DerivedData/BBB-cyokaitskczvsudphcitaklhfyvp/Build/Intermediates.noindex/BBB.build/Debug/BBB.build/Objects-normal/arm64/TestObjc.o
-index-unit-output-path
/BBB.build/Debug/BBB.build/Objects-normal/arm64/TestObjc.o
-Xclang
-fmodule-format=raw
-working-directory
/private/tmp/BBB
-resource-dir=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0
--
/private/tmp/BBB/BBB/TestObjc.hpp

SolaWing avatar Sep 09 '24 07:09 SolaWing

By the way, what is your xcode and sourcekit version? I use newest version 15.4, may upgrade it fixes issue?

SolaWing avatar Sep 09 '24 07:09 SolaWing

Compile works, but lsp still gives the error, both in nvim and vscode. image

Xcode version is 15.4, idk how to get the sourcekit version Also, I can't compile Cocoa

image

liyderek avatar Sep 11 '24 04:09 liyderek

vscode swift extension default use xcrun --find swift to find toolchain root, and get sourcekit from it.

so your develop environment is broken. you can check if the desired system cpp header file exist at image

if you has multiple xcode toolchain, may try switch to the default one or delete others.. or you may tried reinstall your xcode, even reinstall your system, or switch another mac to check if it works.

SolaWing avatar Sep 11 '24 07:09 SolaWing

stddef exists and including <stddef.h> works in the LSP. Also, I'm not using the swift extension because it only works on swift files and instead using the extension called "Sourcekit-LSP". I don't have any toolchains installed either.

liyderek avatar Sep 12 '24 01:09 liyderek

I also found this in LSP logs which might be a cause for concern:

I[21:06:27.995] Indexed c++20 standard library (incomplete due to errors): 10590 symbols, 2741 filtered

liyderek avatar Sep 12 '24 02:09 liyderek

error say cpp's stddef.h, so should has two stddef.h, one for c, one for cpp.

sourcekit-lsp is used by swift extension. and it support swift and all C-famaily. but for C-famaily, need to manual active this server.

I am sorry I have no any further clue to help you fixes this issue, except change a new mac or reinstall environement...

SolaWing avatar Sep 12 '24 08:09 SolaWing

I'll try to reinstall xcode and try again

liyderek avatar Sep 12 '24 22:09 liyderek

@SolaWing Are you using MacOS Sequoia? That's the only software update available

liyderek avatar Sep 13 '24 03:09 liyderek

I found the problem. Sourcekit was using the file at /usr/include/stddef.h which pointed to the sdk at /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk while xcode was using /Applications/Xcode-15.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk and they were different versions. How do I get 14.5 on commandline tools?

liyderek avatar Sep 13 '24 05:09 liyderek

may because -target arm64-apple-macos14.4? by the way, does '-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk' exist? your flags show this two flags.

CommandLineTools may install by xcode-select --install

@SolaWing Are you using MacOS Sequoia? That's the only software update available

I use mac 14.6.1 (23G93)

SolaWing avatar Sep 13 '24 11:09 SolaWing