├── media
├── icon.png
├── debugger.png
├── screenshot.png
├── close-dark.svg
├── close-light.svg
├── settings-dark.svg
├── settings-light.svg
├── root-folder-opened-dark.svg
├── root-folder-opened-light.svg
├── remote-explorer-dark.svg
├── remote-explorer-light.svg
├── sidebar-icon.svg
├── sidebar-icon-dark.svg
├── sidebar-icon-light.svg
├── computer.svg
└── monitor.svg
├── .gitignore
├── .vscodeignore
├── .vscode
├── extensions.json
└── launch.json
├── jsconfig.json
├── test
├── suite
│ ├── extension.test.js
│ └── index.js
└── runTest.js
├── .eslintrc.json
├── LICENSE
├── CHANGELOG.md
├── README.md
├── package.json
├── index.html
└── extension.js
/media/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MCJack123/vscode-craftos-pc/HEAD/media/icon.png
--------------------------------------------------------------------------------
/media/debugger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MCJack123/vscode-craftos-pc/HEAD/media/debugger.png
--------------------------------------------------------------------------------
/media/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MCJack123/vscode-craftos-pc/HEAD/media/screenshot.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /.DS_Store
2 | /.git
3 | /index.old.html
4 | /node_modules
5 | /vsc-extension-quickstart.md
6 | *.vsix
--------------------------------------------------------------------------------
/.vscodeignore:
--------------------------------------------------------------------------------
1 | .vscode/**
2 | .vscode-test/**
3 | test/**
4 | .gitignore
5 | vsc-extension-quickstart.md
6 | **/jsconfig.json
7 | **/*.map
8 | **/.eslintrc.json
9 | .zsh_history
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | // See https://go.microsoft.com/fwlink/?LinkId=733558
3 | // for the documentation about the extensions.json format
4 | "recommendations": [
5 | "dbaeumer.vscode-eslint"
6 | ]
7 | }
--------------------------------------------------------------------------------
/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "commonjs",
4 | "target": "es6",
5 | "checkJs": true, /* Typecheck .js files. */
6 | "lib": [
7 | "es6"
8 | ]
9 | },
10 | "exclude": [
11 | "node_modules"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/media/close-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/media/close-light.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/media/settings-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/media/settings-light.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/suite/extension.test.js:
--------------------------------------------------------------------------------
1 | const assert = require('assert');
2 |
3 | // You can import and use all API from the 'vscode' module
4 | // as well as import your extension to test it
5 | const vscode = require('vscode');
6 | // const myExtension = require('../extension');
7 |
8 | suite('Extension Test Suite', () => {
9 | vscode.window.showInformationMessage('Start all tests.');
10 |
11 | test('Sample test', () => {
12 | assert.equal(-1, [1, 2, 3].indexOf(5));
13 | assert.equal(-1, [1, 2, 3].indexOf(0));
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "browser": false,
4 | "commonjs": true,
5 | "es6": true,
6 | "node": true,
7 | "mocha": true
8 | },
9 | "parserOptions": {
10 | "ecmaVersion": 2018,
11 | "ecmaFeatures": {
12 | "jsx": true
13 | },
14 | "sourceType": "module"
15 | },
16 | "rules": {
17 | "no-const-assign": "warn",
18 | "no-this-before-super": "warn",
19 | "no-undef": "warn",
20 | "no-unreachable": "warn",
21 | "no-unused-vars": "warn",
22 | "constructor-super": "warn",
23 | "valid-typeof": "warn"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/media/root-folder-opened-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/media/root-folder-opened-light.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/media/remote-explorer-dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/media/remote-explorer-light.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/runTest.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 |
3 | const { runTests } = require('vscode-test');
4 |
5 | async function main() {
6 | try {
7 | // The folder containing the Extension Manifest package.json
8 | // Passed to `--extensionDevelopmentPath`
9 | const extensionDevelopmentPath = path.resolve(__dirname, '../');
10 |
11 | // The path to the extension test script
12 | // Passed to --extensionTestsPath
13 | const extensionTestsPath = path.resolve(__dirname, './suite/index');
14 |
15 | // Download VS Code, unzip it and run the integration test
16 | await runTests({ extensionDevelopmentPath, extensionTestsPath });
17 | } catch (err) {
18 | console.error('Failed to run tests');
19 | process.exit(1);
20 | }
21 | }
22 |
23 | main();
24 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | // A launch configuration that launches the extension inside a new window
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | {
6 | "version": "0.2.0",
7 | "configurations": [
8 | {
9 | "name": "Run Extension",
10 | "type": "extensionHost",
11 | "request": "launch",
12 | "runtimeExecutable": "${execPath}",
13 | "args": [
14 | "--extensionDevelopmentPath=${workspaceFolder}"
15 | ]
16 | },
17 | {
18 | "name": "Extension Tests",
19 | "type": "extensionHost",
20 | "request": "launch",
21 | "runtimeExecutable": "${execPath}",
22 | "args": [
23 | "--extensionDevelopmentPath=${workspaceFolder}",
24 | "--extensionTestsPath=${workspaceFolder}/test/suite/index"
25 | ]
26 | }
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/test/suite/index.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const Mocha = require('mocha');
3 | const glob = require('glob');
4 |
5 | function run() {
6 | // Create the mocha test
7 | const mocha = new Mocha({
8 | ui: 'tdd'
9 | });
10 | // Use any mocha API
11 | mocha.useColors(true);
12 |
13 | const testsRoot = path.resolve(__dirname, '..');
14 |
15 | return new Promise((c, e) => {
16 | glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
17 | if (err) {
18 | return e(err);
19 | }
20 |
21 | // Add files to the test suite
22 | files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
23 |
24 | try {
25 | // Run the mocha test
26 | mocha.run(failures => {
27 | if (failures > 0) {
28 | e(new Error(`${failures} tests failed.`));
29 | } else {
30 | c();
31 | }
32 | });
33 | } catch (err) {
34 | console.error(err);
35 | e(err);
36 | }
37 | });
38 | });
39 | }
40 |
41 | module.exports = {
42 | run
43 | };
44 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020-2022 JackMacWindows
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | All notable changes to the "craftos-pc" extension will be documented in this file.
4 |
5 | ## 1.2.3
6 |
7 | * Added a new very prominent button to open files
8 | * Added an extra alert when the files are already open
9 |
10 | ## 1.2.2
11 |
12 | * Fixed an issue preventing uploading files between 48-64 kB in size
13 |
14 | ## 1.2.1
15 |
16 | * Added automatic detection of user installations on Windows
17 | * Adjusted some error messages to be more descriptive
18 | * Added a new output channel for debugging messages
19 |
20 | ## 1.2.0
21 |
22 | * Added debugger support for CraftOS-PC v2.7 and later
23 | * Added support for Visual Studio Live Share
24 | * This currently requires manually allowing the extension to communicate
25 |
26 | ## 1.1.8
27 |
28 | * Fixed a bug causing disconnections when sending large data packets
29 |
30 | ## 1.1.6
31 |
32 | * Added Run Script button to quickly run files in a new CraftOS-PC instance
33 |
34 | ## 1.1.5
35 |
36 | * Added history to Open WebSocket button
37 |
38 | ## 1.1.4
39 |
40 | * Terminal windows now automatically resize to fit the screen
41 | * Fixed an issue causing the bug info prompt from 1.1.3 to not appear
42 |
43 | ## 1.1.3
44 |
45 | * Added more information about VS Code "certificate has expired" bug
46 | * Added a "CraftOS-PC: Force Close Connection" to close the connection immediately without waiting for a response
47 | * Fixed an issue causing remote screens to go black
48 |
49 | ## 1.1.1
50 |
51 | * Fixed mouse_up event not being sent
52 |
53 | ## 1.1.0
54 |
55 | * Added ability to connect to WebSocket servers
56 | * Added integration with new remote.craftos-pc.cc service (beta)
57 | * Added support for raw mode 1.1 specification
58 | * Added URI handler for WebSocket links
59 | * Fixed security vulnerability in glob-parent dependency
60 |
61 | ## 1.0.2
62 |
63 | * Fixed wrong mouse buttons being sent
64 | * Fixed drag coordinates in the margins of the screen
65 | * Fixed mouse drag events firing in the same cell after click
66 |
67 | ## 1.0.1
68 |
69 | * Fixed mouse events not being sent to the window
70 |
71 | ## 1.0.0
72 |
73 | * Added support for custom fonts
74 | * Font files must be in the exact same format as ComputerCraft fonts (with the same outer padding area)
75 | * Added close buttons to each window, as well as a global quit button
76 | * Added buttons to open a new window with the selected computer's data directory
77 | * This requires either CraftOS-PC v2.5.6 or later, or computers labeled "Computer >id<"
78 | * Added button to open the configuration
79 | * Added paste event detection
80 | * Added icons for monitors
81 | * Updated extension icon to CraftOS-PC v2.4's new icon
82 | * Fixed duplicate drag events being sent for the same character cell
83 | * Fixed mouse events sending the wrong coordinates
84 | * Fixed the computer background not being drawn properly
85 | * Upgraded y18n and lodash to fix vulnerabilities (#3, #4)
86 | * Reformatted code to be a bit more clean
87 |
88 | ## 0.2.1
89 |
90 | * Added an error message if the executable is missing
91 | * Fixed `mouse_click` events being sent instead of `mouse_drag`
92 |
93 | ## 0.2.0
94 |
95 | * Fixed performance issues causing high CPU usage and major slowdown
96 | * Render speed should now be about the same as in standard GUI mode
97 | * Added `craftos-pc.additionalArguments` setting
98 | * Added command to close the emulator session without having to close each window
99 | * Fixed a bug causing CraftOS-PC to not start on Windows when a workspace is open
100 |
101 | ## 0.1.1
102 |
103 | Fixes a bug where the wrong key events were being sent (e.g. `key_up` when pressing a key down). Also fixes `char` events being sent with modifier keys held.
104 |
105 | Download the latest build of CraftOS-PC (from 7/27/20 or later) to fix a bug with events being sent to the wrong window, as well as a bug preventing Ctrl-R/S/T from working properly.
106 |
107 | ## 0.1.0
108 |
109 | First public alpha release.
--------------------------------------------------------------------------------
/media/sidebar-icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/media/sidebar-icon-dark.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/media/sidebar-icon-light.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/media/computer.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CraftOS-PC for VS Code README
2 |
3 | An extension for Visual Studio Code adding a bunch of new features to help you write ComputerCraft code easier through CraftOS-PC.
4 |
5 | ## Features
6 |
7 | * Support for built-in CraftOS-PC terminals in VS Code
8 | * Quickly access computer data directories and the configuration
9 | * Run ComputerCraft Lua scripts in CraftOS-PC
10 | * Browse files on the connected computer in the current workspace
11 | * Connect to CraftOS-PC raw mode WebSocket servers
12 | * Use the remote.craftos-pc.cc service to open any ComputerCraft computer in VS Code (beta)
13 | * Debug code directly in VS Code using the native debugger interface
14 |
15 | 
16 |
17 | 
18 |
19 | ## Requirements
20 |
21 | * CraftOS-PC v2.3 or later (https://www.craftos-pc.cc)
22 | * **If on Windows, make sure to install the console version as well under Optional components in the installer**
23 | * If installed in a non-standard directory (such as in your user directory), make sure to set `craftos-pc.executablePath` in the settings
24 | * See "Known issues" for caveats for certain CraftOS-PC versions
25 | * If you only want to use remote.craftos-pc.cc, you do not have to install CraftOS-PC
26 |
27 | ## Recommended Extensions
28 |
29 | * [ComputerCraft by JackMacWindows (me!)](https://marketplace.visualstudio.com/items?itemName=jackmacwindows.vscode-computercraft) for ComputerCraft autocomplete
30 | * [Lua by sumneko](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) for Lua syntax highlighting & linting
31 |
32 | ## Extension Settings
33 |
34 | This extension contributes the following settings:
35 |
36 | * `craftos-pc.executablePath.[windows|mac|linux|all]`: Path to the CraftOS-PC executable depending on the platform. This should be an absolute path to an executable supporting console output (on Windows, this must be pointing to a copy of `CraftOS-PC_console.exe`, which is optionally available in the installer).
37 | * `craftos-pc.dataPath`: Path to the data directory storing computer files, configuration, etc.
38 | * `craftos-pc.additionalArguments`: Additional command-line arguments to send to CraftOS-PC, separated by spaces.
39 | * `craftos-pc.customFont.path`: The path to a custom font, if desired. Must be a path to a valid image, or 'hdfont' to automatically find the HD font. Unlike normal CraftOS-PC, this may point to non-BMP files as well.
40 |
41 | ## Known Issues
42 |
43 | * Occasionally, keyboard input may stop working. To fix this, click outside the CraftOS-PC window and then back in.
44 | * Scroll events do not report the position of the scroll. This is a limitation of JavaScript.
45 | * Live Share support does not respect read-only mode due to a limitation in the Live Share API.
46 | * Some versions of CraftOS-PC have bugs that interfere with the functioning of this extension:
47 | * The debugger only works on CraftOS-PC v2.7 or later.
48 | * Filesystem access only works on CraftOS-PC v2.6 or later, or any server implementing raw mode 1.1 or later.
49 | * v2.5.4-v2.5.5: Creating a new window results in a crash. This is fixed in v2.6.
50 | * v2.5.1-v2.5.1.1: CraftOS-PC often crashes in raw mode on these versions. This is fixed in v2.5.2.
51 | * v2.3-v2.3.4: All events are sent to the first window, and all windows have the same ID. This is fixed in v2.4.
52 |
53 | ### Live Share
54 |
55 | The VS Code Live Share extension uses a permission list to check whether an extension is allowed to use certain parts of the API. Unfortunately, that list does not include this extension (yet), so Live Share support requires creating a special config file to enable it manually.
56 |
57 | To fix this, create a file called `.vs-liveshare-settings.json` in your home folder, and paste this inside the file:
58 |
59 | ```json
60 | {
61 | "extensionPermissions": {
62 | "JackMacWindows.craftos-pc": [
63 | "shareServices"
64 | ]
65 | }
66 | }
67 | ```
68 |
69 | Then reload VS Code and run Live Share again.
70 |
71 | ## Release Notes
72 |
73 | ## 1.2.3
74 |
75 | * Added a new very prominent button to open files
76 | * Added an extra alert when the files are already open
77 |
78 | ## 1.2.2
79 |
80 | * Fixed an issue preventing uploading files between 48-64 kB in size
81 |
82 | ## 1.2.1
83 |
84 | * Added automatic detection of user installations on Windows
85 | * Adjusted some error messages to be more descriptive
86 | * Added a new output channel for debugging messages
87 |
88 | ## 1.2.0
89 |
90 | * Added debugger support for CraftOS-PC v2.7 and later
91 | * Added support for Visual Studio Live Share
92 | * This currently requires manually allowing the extension to communicate
93 |
94 | ## 1.1.8
95 |
96 | * Fixed a bug causing disconnections when sending large data packets
97 |
98 | ## 1.1.6
99 |
100 | * Added Run Script button to quickly run files in a new CraftOS-PC instance
101 |
102 | ## 1.1.5
103 |
104 | * Added history to Open WebSocket button
105 |
106 | ## 1.1.4
107 |
108 | * Terminal windows now automatically resize to fit the screen
109 | * Fixed an issue causing the bug info prompt from 1.1.3 to not appear
110 |
111 | ## 1.1.3
112 |
113 | * Added more information about VS Code "certificate has expired" bug
114 | * Added a "CraftOS-PC: Force Close Connection" to close the connection immediately without waiting for a response
115 | * Fixed an issue causing remote screens to go black
116 |
117 | ## 1.1.1
118 |
119 | * Fixed mouse_up event not being sent
120 |
121 | ## 1.1.0
122 |
123 | * Added ability to connect to WebSocket servers
124 | * Added integration with new remote.craftos-pc.cc service (beta)
125 | * Added support for raw mode 1.1 specification
126 | * Added URI handler for WebSocket links
127 | * Fixed security vulnerability in glob-parent dependency
128 |
129 | ## 1.0.2
130 |
131 | * Fixed wrong mouse buttons being sent
132 | * Fixed drag coordinates in the margins of the screen
133 | * Fixed mouse drag events firing in the same cell after click
134 |
135 | ## 1.0.1
136 |
137 | * Fixed mouse events not being sent to the window
138 |
139 | ## 1.0.0
140 |
141 | * Added support for custom fonts
142 | * Font files must be in the exact same format as ComputerCraft fonts (with the same outer padding area)
143 | * Added close buttons to each window, as well as a global quit button
144 | * Added buttons to open a new window with the selected computer's data directory
145 | * This requires either CraftOS-PC v2.5.6 or later, or computers labeled "Computer >id<"
146 | * Added button to open the configuration
147 | * Added paste event detection
148 | * Added icons for monitors
149 | * Updated extension icon to CraftOS-PC v2.4's new icon
150 | * Fixed duplicate drag events being sent for the same character cell
151 | * Fixed mouse events sending the wrong coordinates
152 | * Fixed the computer background not being drawn properly
153 | * Upgraded y18n and lodash to fix vulnerabilities (#3, #4)
154 | * Reformatted code to be a bit more clean
155 |
156 | ### 0.2.1
157 |
158 | * Added an error message if the executable is missing
159 | * Fixed `mouse_click` events being sent instead of `mouse_drag`
160 |
161 | ### 0.2.0
162 |
163 | * Fixed performance issues causing high CPU usage and major slowdown
164 | * Render speed should now be about the same as in standard GUI mode
165 | * Added `craftos-pc.additionalArguments` setting
166 | * Added command to close the emulator session without having to close each window
167 | * Fixed a bug causing CraftOS-PC to not start on Windows when a workspace is open
168 |
169 | ### 0.1.1
170 |
171 | Fixes a bug where the wrong key events were being sent (e.g. `key_up` when pressing a key down). Also fixes `char` events being sent with modifier keys held.
172 |
173 | Download the latest build of CraftOS-PC (from 7/27/20 or later) to fix a bug with events being sent to the wrong window, as well as a bug preventing Ctrl-R/S/T from working properly.
174 |
175 | ### 0.1.0
176 |
177 | First public alpha release.
178 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "craftos-pc",
3 | "displayName": "CraftOS-PC for VS Code",
4 | "description": "Adds the ability to open CraftOS-PC windows inside VS Code, as well as some ease-of-use functionality to make ComputerCraft programming easier.",
5 | "version": "1.2.3",
6 | "engines": {
7 | "vscode": "^1.41.0"
8 | },
9 | "categories": [
10 | "Other"
11 | ],
12 | "keywords": [
13 | "computercraft",
14 | "craftos",
15 | "terminal",
16 | "craftos-pc"
17 | ],
18 | "author": {
19 | "name": "JackMacWindows"
20 | },
21 | "publisher": "JackMacWindows",
22 | "repository": {
23 | "type": "git",
24 | "url": "https://github.com/MCJack123/vscode-craftos-pc"
25 | },
26 | "icon": "media/icon.png",
27 | "activationEvents": [
28 | "onStartupFinished"
29 | ],
30 | "main": "./extension.js",
31 | "contributes": {
32 | "commands": [
33 | {
34 | "command": "craftos-pc.open",
35 | "title": "CraftOS-PC: Start Session"
36 | },
37 | {
38 | "command": "craftos-pc.open-websocket",
39 | "title": "CraftOS-PC: Open WebSocket Connection..."
40 | },
41 | {
42 | "command": "craftos-pc.open-new-remote",
43 | "title": "CraftOS-PC: Open New remote.craftos-pc.cc Session"
44 | },
45 | {
46 | "command": "craftos-pc.open-window",
47 | "title": "CraftOS-PC: Open Window with ID..."
48 | },
49 | {
50 | "command": "craftos-pc.open-computer-data",
51 | "title": "CraftOS-PC: Open Data Directory for Computer...",
52 | "icon": {
53 | "light": "media/root-folder-opened-light.svg",
54 | "dark": "media/root-folder-opened-dark.svg"
55 | }
56 | },
57 | {
58 | "command": "craftos-pc.open-remote-data",
59 | "title": "CraftOS-PC: Open Remote Data for Window...",
60 | "icon": {
61 | "light": "media/remote-explorer-light.svg",
62 | "dark": "media/remote-explorer-dark.svg"
63 | }
64 | },
65 | {
66 | "command": "craftos-pc.open-config",
67 | "title": "CraftOS-PC: Open Configuration",
68 | "icon": {
69 | "light": "media/settings-light.svg",
70 | "dark": "media/settings-dark.svg"
71 | }
72 | },
73 | {
74 | "command": "craftos-pc.close",
75 | "title": "CraftOS-PC: Close Session",
76 | "icon": {
77 | "light": "media/close-light.svg",
78 | "dark": "media/close-dark.svg"
79 | }
80 | },
81 | {
82 | "command": "craftos-pc.close-window",
83 | "title": "CraftOS-PC: Close Window",
84 | "icon": {
85 | "light": "media/close-light.svg",
86 | "dark": "media/close-dark.svg"
87 | }
88 | },
89 | {
90 | "command": "craftos-pc.kill",
91 | "title": "CraftOS-PC: Force Close Connection"
92 | },
93 | {
94 | "command": "craftos-pc.clear-history",
95 | "title": "CraftOS-PC: Clear WebSocket History"
96 | },
97 | {
98 | "command": "craftos-pc.run-file",
99 | "title": "CraftOS-PC: Run Script",
100 | "icon": {
101 | "light": "media/sidebar-icon-light.svg",
102 | "dark": "media/sidebar-icon-dark.svg"
103 | }
104 | }
105 | ],
106 | "viewsContainers": {
107 | "activitybar": [
108 | {
109 | "id": "craftos-terminals",
110 | "title": "CraftOS Terminals",
111 | "icon": "media/sidebar-icon.svg"
112 | }
113 | ]
114 | },
115 | "views": {
116 | "craftos-terminals": [
117 | {
118 | "id": "craftos-computers",
119 | "name": "Computers"
120 | },
121 | {
122 | "id": "craftos-monitors",
123 | "name": "Monitors"
124 | },
125 | {
126 | "id": "craftos-open-files",
127 | "name": "Open Files"
128 | }
129 | ]
130 | },
131 | "viewsWelcome": [
132 | {
133 | "view": "craftos-computers",
134 | "contents": "You must start CraftOS-PC before using this tab.\n[Start CraftOS-PC](command:craftos-pc.open)\n[Open WebSocket...](command:craftos-pc.open-websocket)\n[Connect to Remote (Beta)](command:craftos-pc.open-new-remote)"
135 | },
136 | {
137 | "view": "craftos-open-files",
138 | "contents": "Click this button to open remote files.\n[Open Remote Files](command:craftos-pc.open-primary-remote-data)"
139 | }
140 | ],
141 | "menus": {
142 | "view/item/context": [
143 | {
144 | "command": "craftos-pc.open-remote-data",
145 | "when": "view == craftos-computers && viewItem == data-available",
146 | "group": "inline@1"
147 | },
148 | {
149 | "command": "craftos-pc.close-window",
150 | "when": "view == craftos-computers || view == craftos-monitors",
151 | "group": "inline@2"
152 | }
153 | ],
154 | "view/title": [
155 | {
156 | "command": "craftos-pc.open-config",
157 | "when": "view == craftos-computers",
158 | "group": "navigation@1"
159 | },
160 | {
161 | "command": "craftos-pc.close",
162 | "when": "view == craftos-computers",
163 | "group": "navigation@2"
164 | }
165 | ],
166 | "editor/title": [
167 | {
168 | "command": "craftos-pc.run-file",
169 | "when": "resourceLangId == lua && isFileSystemResource",
170 | "group": "navigation"
171 | }
172 | ]
173 | },
174 | "configuration": {
175 | "title": "CraftOS-PC",
176 | "properties": {
177 | "craftos-pc.executablePath.windows": {
178 | "type": "string",
179 | "default": "C:\\Program Files\\CraftOS-PC\\CraftOS-PC_console.exe",
180 | "description": "The path to the CraftOS-PC executable on Windows. Must be the console version.",
181 | "scope": "machine-overridable"
182 | },
183 | "craftos-pc.executablePath.mac": {
184 | "type": "string",
185 | "default": "/Applications/CraftOS-PC.app/Contents/MacOS/craftos",
186 | "description": "The path to the CraftOS-PC executable (NOT the application) on macOS.",
187 | "scope": "machine-overridable"
188 | },
189 | "craftos-pc.executablePath.linux": {
190 | "type": "string",
191 | "default": "/usr/bin/craftos",
192 | "description": "The path to the CraftOS-PC executable on Linux.",
193 | "scope": "machine-overridable"
194 | },
195 | "craftos-pc.executablePath.all": {
196 | "type": "string",
197 | "default": null,
198 | "description": "The path to the CraftOS-PC executable. Overrides any platform defaults if set.",
199 | "scope": "machine-overridable"
200 | },
201 | "craftos-pc.dataPath": {
202 | "type": "string",
203 | "default": null,
204 | "description": "The path to the data directory to use for CraftOS-PC. This defaults to the standard data directory location.",
205 | "scope": "window"
206 | },
207 | "craftos-pc.additionalArguments": {
208 | "type": "string",
209 | "default": null,
210 | "description": "Additional command-line arguments to pass to CraftOS-PC.",
211 | "scope": "machine-overridable"
212 | },
213 | "craftos-pc.customFont.path": {
214 | "type": "string",
215 | "default": null,
216 | "description": "The path to a custom font, if desired. Must be a path to a valid image, or 'hdfont' to automatically find the HD font.",
217 | "scope": "machine-overridable"
218 | }
219 | }
220 | },
221 | "debuggers": [
222 | {
223 | "type": "craftos-pc",
224 | "label": "CraftOS-PC Debugger",
225 | "runtime": "node",
226 | "configurationAttributes": {
227 | "launch": {
228 | "required": [],
229 | "properties": {
230 | "program": {
231 | "type": "string",
232 | "description": "Program to launch when debugging"
233 | }
234 | }
235 | },
236 | "attach": {
237 | "required": [],
238 | "properties": {
239 | "port": {
240 | "type": "number",
241 | "description": "Port to attach to"
242 | },
243 | "host": {
244 | "type": "string",
245 | "description": "Host address of the debuggee"
246 | }
247 | }
248 | }
249 | },
250 | "initialConfigurations": [
251 | {
252 | "type": "craftos-pc",
253 | "request": "launch",
254 | "name": "Debug CraftOS-PC"
255 | }
256 | ]
257 | }
258 | ],
259 | "breakpoints": [
260 | {
261 | "language": "lua"
262 | }
263 | ]
264 | },
265 | "scripts": {
266 | "lint": "eslint .",
267 | "pretest": "npm run lint",
268 | "test": "node ./test/runTest.js"
269 | },
270 | "devDependencies": {
271 | "@types/glob": "^7.1.1",
272 | "@types/mocha": "^7.0.1",
273 | "@types/node": "^12.11.7",
274 | "@types/vscode": "^1.41.0",
275 | "eslint": "^6.8.0",
276 | "glob": "^7.1.6",
277 | "mocha": "^10.1.0",
278 | "typescript": "^3.7.5",
279 | "vscode-test": "^1.3.0"
280 | },
281 | "dependencies": {
282 | "semver": "^7.5.2",
283 | "vsls": "^1.0.4753",
284 | "ws": "^7.5.10"
285 | }
286 | }
287 |
--------------------------------------------------------------------------------
/media/monitor.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |