Syntax highlight in VS Code under MacOS
-
Hi,
I just installed MacOS (MBP M1) from scratch, and looking for syntax highlighting in VS Code.
Official c4dpy Manual doc has no instruction for MacOS.
When trying to set interpreter to/Applications/Maxon Cinema 4D 2025/c4dpy.app/Contents/MacOS/c4dpy
I get this error2024-11-09 22:17:14.074 [info] > "/Applications/Maxon Cinema 4D 2025/c4dpy.app/Contents/MacOS/c4dpy" -I ~/.vscode/extensions/ms-python.python-2024.18.1-darwin-arm64/python_files/get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2024.18.1-darwin-arm64/python_files/interpreterInfo.py 2024-11-09 22:17:29.115 [error] [Error: Command failed: "/Applications/Maxon Cinema 4D 2025/c4dpy.app/Contents/MacOS/c4dpy" -I /Users/user/.vscode/extensions/ms-python.python-2024.18.1-darwin-arm64/python_files/get_output_via_markers.py /Users/user/.vscode/extensions/ms-python.python-2024.18.1-darwin-arm64/python_files/interpreterInfo.py sysctl: No such file or directory at genericNodeError (node:internal/errors:984:15) at wrappedFn (node:internal/errors:538:14) at ChildProcess.exithandler (node:child_process:423:12) at ChildProcess.emit (node:events:531:35) at maybeClose (node:internal/child_process:1105:16) at ChildProcess._handle.onexit (node:internal/child_process:305:5)] { code: null, killed: true, signal: 'SIGTERM', cmd: '"/Applications/Maxon Cinema 4D 2025/c4dpy.app/Contents/MacOS/c4dpy" -I /Users/user/.vscode/extensions/ms-python.python-2024.18.1-darwin-arm64/python_files/get_output_via_markers.py /Users/user/.vscode/extensions/ms-python.python-2024.18.1-darwin-arm64/python_files/interpreterInfo.py' }
Several years ago I deal with python package symlink if I remember correctly, but I can't find this instruction anymore.
Would be thankful for any suggestion. -
Hi @baca,
The expected workflow to achieve syntax highlighting in VSCode is using our C4D Connector Extension for VSCode. Please note, for syntax highlighting to work your VSCode need to be opened within some workspace (e.g. when you do "Open folder" in VSCode).
The approach from the c4dpy manual should still be working and the error you're sharing looks like command
"/Applications/Maxon Cinema 4D 2025/c4dpy.app/Contents/MacOS/c4dpy" -I
did not make an output that's expected by the VSCode. Please use the extension approach instead.
Cheers,
Ilia -
Thanks, I forgot about the extension.
I didn't use the connection to Cinema4D, but syntax highlighting works just fine. -
I would heavily recommend using the extension, as it will automatically curate the paths for you. I.e., when you use the extension and connect to a Cinema 4D instance, it will make sure that the dummy modules of that Cinema 4D version are on the search paths.
But when you really do not want to use it, you can also just edit your config so that the dummy module paths are discoverable for auto complete and the linter.
What you will need in any case, is the Python and Pylance extension for VS Code, as they are the extensions which make use of these settings. When you install the connector, they will be installed automatically as a dependency.
Cheers,
Ferdinand