Objeck LSP

Sublime TCP client shim.

Installation

Standard I/O

{
	"clients": {
		"objeck": {
			"enabled": false,
			"command": [
				"<objeck_path>/bin/obr.exe",
				"<objeck_server_path>/objeck_lsp.obe",
				"<objeck_server_path>/objk_apis.json",
				"stdio"
			],
			"env": {
				"OBJECK_LIB_PATH": "<objeck_path>/lib",
				"OBJECK_STDIO": "binary"
			},
			"selector": "source.objeck-obs"
		}
	}
}

TCP sockets

{
	"clients": {
		"objeck": {
			"enabled": false,
			"command": [
				"<objeck_path>/bin/obr.exe",
				"<objeck_server_path>/objeck_lsp.obe",
				"<objeck_server_path>/objk_apis.json",
				"6013"
			],
			"env": {
				"OBJECK_LIB_PATH": "<objeck_path>/lib"
			},
			"selector": "source.objeck-obs",
			"tcp_port": 6013
		}
	}
}

Running client

Debugging (DAP)

Sublime debugging uses the Debugger package by Dave Leroy. After installing it via Package Control:

  1. Copy dap/objeck_dap_adapter.py into your Packages/Objeck/ directory (the install.sh / install.cmd script does this for you).
  2. Create Packages/User/Objeck.sublime-settings pointing at your obd binary:
{
    "obd_path": "C:\\Program Files\\Objeck\\bin\\obd.exe",
    "objeck_lib_path": "C:\\Program Files\\Objeck\\lib"
}
  1. Compile your source with debug symbols: obc -src myprog.obs --debug -dest myprog.obe. Skipping this is the most common mistake — the session starts but no breakpoint ever binds.
  2. Add a debug configuration, either per project or globally (below).
  3. Debugger > Start, pick the configuration, and click the gutter to set breakpoints.

The adapter is registered on Sublime startup and runs obd --dap over stdio with OBJECK_LIB_PATH set per Objeck.sublime-settings.

Creating a debug configuration

Per project — put a debugger_configurations block in a .sublime-project and open it with Project > Open Project. Configurations are only read from an open project, not from a plain folder. See dap/objeck.sublime-project.example.

Globally, without a project — the Debugger package normally insists on a sublime project and shows "Debugger requires a sublime project". A non-empty global_debugger_configurations in Packages/User/Debugger.sublime-settings lifts that requirement and makes the configuration available in every window. See dap/Debugger.sublime-settings.example:

{
    "global_debugger_configurations": [
        {
            "name": "Objeck: debug current file",
            "type": "objeck",
            "request": "launch",
            "program": "${file_path}/${file_base_name}.obe",
            "sourceDir": "${file_path}"
        }
    ]
}

${file_path} and ${file_base_name} are expanded per window, so this one entry debugs whichever .obs file is open — provided the matching .obe sits beside it. Use ${folder} instead only inside a project, since it has no meaning without one.

Troubleshooting