From 306c9ce3e8c18cb25c0024b8874c8e2ab8e5a57e Mon Sep 17 00:00:00 2001 From: Jacob Grossman Date: Wed, 1 Dec 2021 21:38:48 -0600 Subject: [PATCH] Use device specific language for output title --- README.md | 3 --- package.json | 18 +++++++++--------- src/commands.ts | 6 +++--- src/extension.ts | 4 ++-- src/hubManager.ts | 1 - 5 files changed, 14 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 074a459..ef81dc4 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,6 @@ Python programming with LEGO Mindstorms. Our goal is to: - [JAWS](https://www.freedomscientific.com/products/software/jaws/) - [Apple VoiceOver](https://support.apple.com/guide/voiceover-guide/welcome/web/) - -- Play audio alerts for syntax and runtime errors. - - 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 diff --git a/package.json b/package.json index a72c249..5e3c59d 100644 --- a/package.json +++ b/package.json @@ -268,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", @@ -296,16 +296,16 @@ "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.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": { + "mindReader.connection.clearOutputOnRun": { "type": "boolean", "description": "Whether to clear the output each time the program is run", "default": "true" diff --git a/src/commands.ts b/src/commands.ts index 3f1ab13..4aa8b0c 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -318,7 +318,7 @@ function createContextString(context: pl.LexNode[], line: number): string { } // 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 { let editor = vscode.window.activeTextEditor; if (!editor) { @@ -328,7 +328,7 @@ function runCursorContext(): void { const cursorPos: vscode.Position = editor.selection.active; 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 leadingWS = text.length - trimmedText.length; // # of characters of leading whitespace @@ -401,7 +401,7 @@ async function connectHub(): Promise { 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) { let slots: vscode.QuickPickItem[] = []; diff --git a/src/extension.ts b/src/extension.ts index 565df71..ebcdb92 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -7,13 +7,13 @@ import CommandNodeProvider from './commandNodeProvider'; import Logger from './log'; // 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); let parser: pl.Parser = new pl.Parser(); export function activate(context: vscode.ExtensionContext) { - console.log('Congratulations, your extension "mind-reader" is now active!'); vscode.window.showInformationMessage('Mind_Reader is loaded!'); parser.parse('Beep Boop'); diff --git a/src/hubManager.ts b/src/hubManager.ts index d976bf6..0bf29a1 100644 --- a/src/hubManager.ts +++ b/src/hubManager.ts @@ -190,7 +190,6 @@ export default class HubManager { } // ========================= Hub Methods ========================= - // TODO: only spike is supported rn -> m_strType // // These methods each handle a single RPC method's communication.