Ticket Created

SDK 8.0.0 BETA and language server build process

I tried using the SDK 8.0.0 BETA today and was able to get one smaller, more simple project working -- so I know the SDK works on my MacOS setup. However, I also ran into some issues, which seem to be specific to the language server build process (or whatever the process should be called):

1. One of my projects is able to get to 100% on the language server build processand displays warnings; however, when I attempt to run the app on the simulator, the process simply hangs. Sometimes it builds the PRG and sometimes it hangs prior. In both cases, the PRG never makes it to the simulator (whether it's already running or not). There's also no way to recover the build process and/or stop it; the little blue line continues to move at the top of the "Run and Debug" tab. The only way to stop this is to close the workspace/window. Whatever is going on also seems to cause an issue with "Find in Files", showing a subtext as "A system error occurred (spawn EBADF)".

2. Another project hangs around 33% during the language server build process, then seems to timeout and displays an error as such:

approachs7042mm: Error occurred while reading Monkey C file: Cannot invoke "String.split(String)" because the return value of "java.util.Properties.getProperty(String)" is null

In both the above cases, the projects compile and run just fine under SDK 7.4.3 and the older Monkey C plugin.

  •  There's no output because it's not even starting the process. The project seems to be unable to get through the language server build. After just shy of 5 minutes it seems to timeout and I see a bunch of Unmatched cancel warnings and an unsuccessful workspace build error.

    Jan. 10, 2025 12:40:22 P.M. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
    WARNING: Unmatched cancel notification for request id 14
    [Error - 12:40:22 PM] Full workspace build unsuccessful for root folder '/Users/douglas/develop/garmin/apps/boating'.

    After that, the "Problems" tab shows the error I mentioned already.


    approachs7042mm: Error occurred while reading Monkey C file: Cannot invoke "String.split(String)" because the return value of "java.util.Properties.getProperty(String)" is null

  • > I don't really understand what is "language server build process"

    Language server: the process which analyzes a source code language (such Monkey C) and provides language-specific information to a client such as a VS Code extension (e.g. the Monkey C extension). This information supports features "such as code completion, syntax highlighting, and marking of warnings and errors". Originally developed for VS Code, the language server protocol is now an open standard.

    Language server build process: In order to mark warnings and errors in the IDE, the language server presumably has to continuously build your code in the background, every time you make a change. This process is what's being referred to as the "Language server build process".

    www.google.com/search

    https://en.wikipedia.org/wiki/Language_Server_Protocol

    code.visualstudio.com/.../language-server-extension-guide

  • If it's not running the build command, could you send us some logs? There's a setting for the Monkey C extension in VS Code 1.1.0 of "Debug Log Level". The higher the level of logging the easier it is for us to figure out what is going on, but you may not want to send us everything they include. At a minimum we would want the basic level, but the intermediate also includes the app's .mir file and verbose includes the .mc files.

  • A further update: I was able to get one of the projects (the one mentioned above in point #1) to start the simulator, connect to it and run. The only things I did were to remove the "bin" folder in the project and update the launch.json file (I noticed that prg and prgDebugXml were no longer valid). However, I also put the old launch.json back and it still worked. So perhaps something in the bin folder was causing an issue?

    My other project, however, still refuses to run the actual build command.

  • The two projects I have issues with are both really big projects; one has 71 Monkey C source files and the other has 90. Neither has any custom command-line arguments in the plugin settings or the jungle file. Could this be related to the size of the project?

    Is there a way for me to manually run the language server command on my one project that hangs at 30% and displays the String.split error?

    For both projects, when I try to run the app the terminal tab displays only this, with no actual command: "Executing task: monkeyc: Building For Device" 

    I did manage to somehow get something to pop up in an error dialog box this morning on one of the projects, and it allowed me to see the following details:

    2025-01-10 09:07:45.466 [info] [Error - 9:07:45 AM] JSON Language Server client: couldn't create connection to server.
    2025-01-10 09:07:45.466 [info] Error: spawn EBADF
    at ChildProcess.spawn (node:internal/child_process:420:11)
    at spawn (node:child_process:796:9)
    at fork (node:child_process:173:10)
    at e.fork (node:electron/js2c/node_init:2:18231)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/client/dist/node/jsonClientMain.js:1:498227
    at new Promise (<anonymous>)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/client/dist/node/jsonClientMain.js:1:497802
    at async D.createConnection (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/client/dist/node/jsonClientMain.js:1:297142)
    at async D.start (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/client/dist/node/jsonClientMain.js:1:287364)
    at async _ (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/client/dist/node/jsonClientMain.js:1:561152)
    at async t.startClient (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/client/dist/node/jsonClientMain.js:1:555412)
    at async t.activate (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/client/dist/node/jsonClientMain.js:1:576296)
    at async K0.n (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:115:4447)
    at async K0.m (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:115:4410)
    at async K0.l (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:115:3866)