Skip to content

Architecture

Almenon edited this page Feb 15, 2020 · 8 revisions

Extension.ts registers the extension commands.

PreviewManager.ts creates the arepl "preview" (webview sidebar), starts AREPL, and registers handlers for user input.

User input goes through toAreplLogic to the arepl backend node module and gets evaluated by the python process there.

Return output goes through previewContainer and html is rendered in pythonPreview.ts

^ Diagram is slightly out of date. Unfortunately I get an error when trying to re-generate it.

You can find the arepl-backend package here.

Tests:

The .spec tests are unit tests that can be ran with mocha. I suggest using mocha extension with vscode. I use the following settings:

"mochaExplorer.files": "test/*.ts",
"mochaExplorer.require": "ts-node/register",
"mochaExplorer.ui": "tdd"

The files in /suite are integration tests. They run with a instance of vscode. I use the following launch config:

		{
			"name": "Integration Tests",
			"type": "extensionHost",
			"request": "launch",
			"runtimeExecutable": "${execPath}",
			"args": [
				"--disable-extensions",
				"--extensionDevelopmentPath=${workspaceFolder}",
				"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
			],
			"stopOnEntry": false,
			"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
			"preLaunchTask": "npm"
		}