Hub communication (#12)

* Add persistent accessibility pane

This will facilitate more extensive usage of the menu than the
context menu.

* Fixed missing files

* Add missing semicolon

* Implement HubController

* Parse messages on arrival

Rather than queuing inbound messages, the HubController now saves
pending promises/rejects for each pending request. Each inbound packet
is checked at the time of arrival, and if the ID matches a pending
response, the corresponding promise is called.

This fixes a problem where the longer the time between reads, the more
garbage responses queue up that are guaranteed to get thrown away the
next time the next response was gathered.

* Add clarification comment to send

* Add logger, output

* Use stat+stream instead of reading entire file on upload

* Split MindReader view into accessability and hub sub-views

* Add missing comma from conflict resolution

* Fix issues, split commands into sub-lists

* Add rebuild instructions

* More accurate

* Add tools for native modules instructions to README.md

* Move commands to correct spot

* Remove automatic connection

I did not heed the warning where 'only the path is guaranteed' when
listing open serial ports and made the assumption that the manufacturer
would be known (hint: it wasn't).

* Use device specific language for output title
This commit is contained in:
Jake Grossman
2021-12-01 21:40:01 -06:00
committed by GitHub
parent 913be402b1
commit b3984daad5
11 changed files with 1982 additions and 195 deletions

View File

@@ -1,6 +1,7 @@
{
"name": "mind-reader",
"displayName": "Mind_Reader",
"repository": "https://github.com/SingleSemesterSnobs/Mind_Reader",
"description": "",
"version": "0.0.1",
"engines": {
@@ -63,7 +64,6 @@
"command": "mind-reader.runLineContext",
"title": "Run Line Context"
},
{
"command": "mind-reader.runCursorContext",
"title": "Run Cursor Context"
@@ -71,128 +71,134 @@
{
"command": "mind-reader.getIndent",
"title": "Get Line Indentation"
},
{
"command": "mind-reader.connectHub",
"title": "Connect LEGO Hub"
},
{
"command": "mind-reader.disconnectHub",
"title": "Disconnect LEGO Hub"
},
{
"command": "mind-reader.uploadCurrentFile",
"title": "Upload current file to LEGO Hub"
},
{
"command": "mind-reader.runProgram",
"title": "Run a program from the LEGO Hub"
},
{
"command": "mind-reader.stopExecution",
"title": "Stop running program on the LEGO Hub"
},
{
"command": "mind-reader.deleteProgram",
"title": "Delete a program from the LEGO Hub"
}
],
"keybindings": [
{
"command": "mind-reader.decreaseFontScale",
"key": "numpad_subtract",
"mac": "d"
},
{
"command": "mind-reader.increaseFontScale",
"key": "numpad_add",
"mac": "[NumpadAdd]"
},
{
"command": "mind-reader.increaseEditorScale",
"key": "shift+numpad_add",
"keybindings": [
{
"command": "mind-reader.decreaseFontScale",
"key": "numpad_subtract",
"mac": "d"
},
{
"command": "mind-reader.increaseFontScale",
"key": "numpad_add",
"mac": "[NumpadAdd]"
},
{
"command": "mind-reader.increaseEditorScale",
"key": "shift+numpad_add",
"mac": "Shift+[NumpadAdd]"
},
{
"command": "mind-reader.decreaseEditorScale",
"key": "shift+numpad_subtract",
"mac": "Shift+[NumpadSubtract]"
},
{
"command": "mind-reader.resetEditorScale",
"key": "shift+enter",
"mac": "Shift+[Enter]"
},
},
{
"command": "mind-reader.decreaseEditorScale",
"key": "shift+numpad_subtract",
"mac": "Shift+[NumpadSubtract]"
},
{
"command": "mind-reader.resetEditorScale",
"key": "shift+enter",
"mac": "Shift+[Enter]"
},
{
"command": "mind-reader.showAllSymbols",
"key": "Ctrl+T",
"mac": "Cmd+[KeyT]"
},
{
"command": "mind-reader.gotoLine",
"key": "CTRL+G",
"mac": "Cmd+[KeyG]"
},
{
"command": "mind-reader.quickOpen",
"key": "CTRL+P",
"mac": "Cmd+[KeyP]"
},
},
{
"command": "mind-reader.gotoSymbol",
"key": "Ctrl+Shift+O",
"mac": "Cmd+Shift+[KeyO]"
},
{
"command": "mind-reader.showProblems",
"key": "Ctrl+Shift+M",
"mac": "Cmd+Shift+[KeyM]"
},
{
"command": "mind-reader.nextInFiles",
"key": "F8",
"mac": "[F8]"
},
{
"command": "mind-reader.prevInFiles",
"key": "Shift+F8",
"mac": "Shift+[F8]"
},
{
"command": "mind-reader.quickOpenPreviousRecentlyUsedEditorInGroup",
"key": "Ctrl+Tab",
"mac": "Cmd+[Tab]"
},
{
"command": "mind-reader.navigateBack",
"key": "Ctrl+Alt+-",
"mac": "Cmd+Alt+[Minus]"
},
{
"command": "mind-reader.getuickInputBack",
"command": "mind-reader.getQuickInputBack",
"key": "Ctrl+Alt+-",
"mac": "Cmd+Alt+[Minus]"
},
{
"command": "mind-reader.navigateForward",
"key": "Ctrl+Shift+-",
"mac": "Cmd+Shift+[Minus]"
},
{
"command": "mind-reader.selectTheme",
"key": "Ctrl+Shift+1",
"mac": "Cmd+Shift+[Digit1]"
},
{
"command": "mind-reader.getIndent",
"key": "Shift+Tab",
"mac": "Shift+[Tab]"
},
{
"command": "mind-reader.openKeyBindWin",
"key": "Ctrl+Shift+8",
"mac": "Cmd+Shift+8"
},
{
"command": "mind-reader.openKeyBindMac",
"key": "Ctrl+Shift+9",
"mac": "Cmd+Shift+9"
}
],
{
"command": "mind-reader.openKeyBindWin",
"key": "Ctrl+Shift+8",
"mac": "Cmd+Shift+8"
},
{
"command": "mind-reader.openKeyBindMac",
"key": "Ctrl+Shift+9",
"mac": "Cmd+Shift+9"
}
],
"menus": {
"editor/context": [
{
@@ -251,7 +257,6 @@
"group": "mind-reader",
"when": "activeEditor"
}
]
},
"submenus": [
@@ -263,20 +268,20 @@
"configuration": {
"title": "Mind_Reader",
"properties": {
"mindreader.productType": {
"mindReader.productType": {
"type": "string",
"description": "Specifies the LEGO® product.",
"default": "MINDSTORMS® EV3",
"default": "MINDSTORMS EV3",
"enum": [
"MINDSTORMS® EV3",
"SPIKE Prime"
"MINDSTORMS EV3",
"SPIKE Prime"
],
"enumDescriptions": [
"LEGO® MINDSTORMS® EV3 (31313)",
"LEGO® Education SPIKE™ Prime Set (45678)"
]
},
"mindreader.reader.screenReader": {
"mindReader.reader.screenReader": {
"type": "string",
"description": "Specifies which screen reader to optimize for.",
"default": "NVDA",
@@ -291,41 +296,47 @@
"Apple VoiceOver (macOS)"
]
},
"mindreader.reader.contextWindow": {
"mindReader.reader.contextWindow": {
"type": "number",
"description": "The number of words around the cursor to use when reading the cursor context",
"default": 1
},
"mindreader.connection.connectAutomatically": {
"type": "boolean",
"description": "Specifies whether to try to automatically detect and communicate with a connected Hub.",
"default": "true"
},
"mindreader.connection.portPath": {
"mindReader.connection.portPath": {
"type": "string",
"markdownDescription": "Specifies the serial port path to use if `#mindreader.connectAutomatically#` is not set."
"markdownDescription": "Specifies the serial port path to use if `#mindReader.connectAutomatically#` is not set."
},
"mindReader.connection.clearOutputOnRun": {
"type": "boolean",
"description": "Whether to clear the output each time the program is run",
"default": "true"
}
}
},
"views": {
"accessActions": [
{
"id": "accessActions",
"name": "Access Actions",
"icon": "media/dep.svg",
"contextualTitle": "Accessibility Menu Actions"
}
]
},
"viewsContainers": {
"activitybar": [
{
"id": "accessActions",
"title": "Access Actions",
"icon": "media/dep.svg"
}
]
}
"views": {
"MindReader": [
{
"id": "accessActions",
"name": "Access Actions",
"icon": "media/dep.svg",
"contextualTitle": "Accessibility Menu Actions"
},
{
"id": "hubActions",
"name": "Hub Actions",
"icon": "media/dep.svg",
"contextualTitle": "Hub Connection Actions"
}
]
},
"viewsContainers": {
"activitybar": [
{
"id": "MindReader",
"title": "MindReader Actions",
"icon": "media/dep.svg"
}
]
}
},
"scripts": {
"vscode:prepublish": "npm run compile",
@@ -336,17 +347,21 @@
"test": "node ./out/test/runTest.js"
},
"devDependencies": {
"@types/vscode": "^1.60.0",
"@types/glob": "^7.1.3",
"@types/mocha": "^8.2.2",
"@types/node": "14.x",
"eslint": "^7.27.0",
"@types/node": "16.x",
"@types/serialport": "^8.0.2",
"@types/vscode": "^1.60.0",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"@vscode/test-electron": "^1.6.2",
"eslint": "^7.27.0",
"glob": "^7.1.7",
"mocha": "^8.4.0",
"typescript": "^4.3.2",
"vscode-test": "^1.5.2",
"@vscode/test-electron": "^1.6.2"
"vscode-test": "^1.5.2"
},
"dependencies": {
"serialport": "^9.2.5"
}
}