mirror of
https://github.com/We-Dont-Byte/Mind_Reader.git
synced 2024-11-15 03:35:59 +00:00
Use device specific language for output title
This commit is contained in:
parent
2d2ca75177
commit
306c9ce3e8
@ -27,9 +27,6 @@ Python programming with LEGO Mindstorms. Our goal is to:
|
|||||||
- [JAWS](https://www.freedomscientific.com/products/software/jaws/)
|
- [JAWS](https://www.freedomscientific.com/products/software/jaws/)
|
||||||
- [Apple VoiceOver](https://support.apple.com/guide/voiceover-guide/welcome/web/)
|
- [Apple VoiceOver](https://support.apple.com/guide/voiceover-guide/welcome/web/)
|
||||||
|
|
||||||
<!-- TODO: still need this -->
|
|
||||||
- Play audio alerts for syntax and runtime errors.
|
|
||||||
|
|
||||||
- Present a summary of the scope for an individual line of code.
|
- Present a summary of the scope for an individual line of code.
|
||||||
|
|
||||||
- Save and load programs directly onto the LEGO Hub from within Visual Studio Code
|
- Save and load programs directly onto the LEGO Hub from within Visual Studio Code
|
||||||
|
18
package.json
18
package.json
@ -268,20 +268,20 @@
|
|||||||
"configuration": {
|
"configuration": {
|
||||||
"title": "Mind_Reader",
|
"title": "Mind_Reader",
|
||||||
"properties": {
|
"properties": {
|
||||||
"mindreader.productType": {
|
"mindReader.productType": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Specifies the LEGO® product.",
|
"description": "Specifies the LEGO® product.",
|
||||||
"default": "MINDSTORMS® EV3",
|
"default": "MINDSTORMS EV3",
|
||||||
"enum": [
|
"enum": [
|
||||||
"MINDSTORMS® EV3",
|
"MINDSTORMS EV3",
|
||||||
"SPIKE™ Prime"
|
"SPIKE Prime"
|
||||||
],
|
],
|
||||||
"enumDescriptions": [
|
"enumDescriptions": [
|
||||||
"LEGO® MINDSTORMS® EV3 (31313)",
|
"LEGO® MINDSTORMS® EV3 (31313)",
|
||||||
"LEGO® Education SPIKE™ Prime Set (45678)"
|
"LEGO® Education SPIKE™ Prime Set (45678)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mindreader.reader.screenReader": {
|
"mindReader.reader.screenReader": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Specifies which screen reader to optimize for.",
|
"description": "Specifies which screen reader to optimize for.",
|
||||||
"default": "NVDA",
|
"default": "NVDA",
|
||||||
@ -296,16 +296,16 @@
|
|||||||
"Apple VoiceOver (macOS)"
|
"Apple VoiceOver (macOS)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mindreader.reader.contextWindow": {
|
"mindReader.reader.contextWindow": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"description": "The number of words around the cursor to use when reading the cursor context",
|
"description": "The number of words around the cursor to use when reading the cursor context",
|
||||||
"default": 1
|
"default": 1
|
||||||
},
|
},
|
||||||
"mindreader.connection.portPath": {
|
"mindReader.connection.portPath": {
|
||||||
"type": "string",
|
"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": {
|
"mindReader.connection.clearOutputOnRun": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Whether to clear the output each time the program is run",
|
"description": "Whether to clear the output each time the program is run",
|
||||||
"default": "true"
|
"default": "true"
|
||||||
|
@ -318,7 +318,7 @@ function createContextString(context: pl.LexNode[], line: number): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// find up to `n` words around the cursor, where `n` is
|
// find up to `n` words around the cursor, where `n` is
|
||||||
// the value of `#mindreader.reader.contextWindow`
|
// the value of `#mindReader.reader.contextWindow`
|
||||||
function runCursorContext(): void {
|
function runCursorContext(): void {
|
||||||
let editor = vscode.window.activeTextEditor;
|
let editor = vscode.window.activeTextEditor;
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
@ -328,7 +328,7 @@ function runCursorContext(): void {
|
|||||||
|
|
||||||
const cursorPos: vscode.Position = editor.selection.active;
|
const cursorPos: vscode.Position = editor.selection.active;
|
||||||
const text: string = editor.document.lineAt(cursorPos).text;
|
const text: string = editor.document.lineAt(cursorPos).text;
|
||||||
const windowSize: number = vscode.workspace.getConfiguration('mindreader').get('reader.contextWindow')!;
|
const windowSize: number = vscode.workspace.getConfiguration('mindReader').get('reader.contextWindow')!;
|
||||||
|
|
||||||
let trimmedText = text.trimStart(); // trim leading whitespace
|
let trimmedText = text.trimStart(); // trim leading whitespace
|
||||||
let leadingWS = text.length - trimmedText.length; // # of characters of leading whitespace
|
let leadingWS = text.length - trimmedText.length; // # of characters of leading whitespace
|
||||||
@ -401,7 +401,7 @@ async function connectHub(): Promise<void> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let portPath: string | undefined = vscode.workspace.getConfiguration('mindreader.connection').get('portPath');
|
let portPath: string | undefined = vscode.workspace.getConfiguration('mindReader.connection').get('portPath');
|
||||||
|
|
||||||
if (!portPath) {
|
if (!portPath) {
|
||||||
let slots: vscode.QuickPickItem[] = [];
|
let slots: vscode.QuickPickItem[] = [];
|
||||||
|
@ -7,13 +7,13 @@ import CommandNodeProvider from './commandNodeProvider';
|
|||||||
import Logger from './log';
|
import Logger from './log';
|
||||||
|
|
||||||
// Output Logger
|
// Output Logger
|
||||||
const outputChannel = vscode.window.createOutputChannel("SPIKE Prime Output");
|
const product: string = vscode.workspace.getConfiguration('mindReader').get('productType')!;
|
||||||
|
const outputChannel = vscode.window.createOutputChannel(product + " Output");
|
||||||
export const logger = new Logger(outputChannel);
|
export const logger = new Logger(outputChannel);
|
||||||
|
|
||||||
let parser: pl.Parser = new pl.Parser();
|
let parser: pl.Parser = new pl.Parser();
|
||||||
|
|
||||||
export function activate(context: vscode.ExtensionContext) {
|
export function activate(context: vscode.ExtensionContext) {
|
||||||
console.log('Congratulations, your extension "mind-reader" is now active!');
|
|
||||||
vscode.window.showInformationMessage('Mind_Reader is loaded!');
|
vscode.window.showInformationMessage('Mind_Reader is loaded!');
|
||||||
|
|
||||||
parser.parse('Beep Boop');
|
parser.parse('Beep Boop');
|
||||||
|
@ -190,7 +190,6 @@ export default class HubManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ========================= Hub Methods =========================
|
// ========================= Hub Methods =========================
|
||||||
// TODO: only spike is supported rn -> m_strType
|
|
||||||
//
|
//
|
||||||
// These methods each handle a single RPC method's communication.
|
// These methods each handle a single RPC method's communication.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user