Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert launch.json properties to camelCase #21

Merged
merged 2 commits into from
Nov 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ To work on this extensions, you first need to install VS Code and nodejs. Afterw
```bash
yarn
```
- Install a VS Code extension necessary for development:
```bash
code --install-extension amodio.tsl-problem-matcher
```
- Install the extensions VS Code recommends
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like doing this on the command line, since it is also used in the previous steps. Maybe we can just say something like "Install the recommended extensions in VS Code, or run the following command line: "?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would work, but then we'd have to update this README every time we have some new extension required (like the discussions about enforcing code formatting. I have a suggestion that might help both of us. Let me push into this PR and you can see if you are OK with it.

- Open VS Code
- Press F5 to start a new VS Code instance where the extension can be debugged. You can also open the "Run and Debug" panel in the left sidebar, and then start the "Extension" debug configuration.

Expand All @@ -47,5 +44,20 @@ To work on this extensions, you first need to install VS Code and nodejs. Afterw
* Select the debug environment `probe_rs Server Test`.
* Press `F5` to start debugging.


## Generating and releasing the extension
Because the extension is still regarded as being in 'Alpha' state, it is NOT being released on the Microsoft Visual Studio Code Extension Marketplace. The only way to get access to updated versions of the extension is to build it yourself, or to download it from the [GitHub release page](#development-setup) for this extension.

### Build the extension
Building the extension refers to the process that generates the installable `.vsix` package.
* Follow the instructions to [setup your development environment](#development-setup).
* In a terminal window, execute the following command:
```
yarn probe-rs:package
```
* This will generate a .vsix file in the root of the repository

### Updating the GitHub release page
After any PR has been merged, you need to consider if it is necessary to update the `.vsix` in the repository's [release page](https://github.com/probe-rs/vscode/releases).
* For minor fixes and changes, just update the asset for the latest release.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should always create a new release, updating an existing release can be very confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can align with that. Ideally I'd like bors to compile and create the release, but I don't know enough about bors to automate that.

* For significant fixes and changes, please update the version number [see the Semantic Versioning guidelines](https://semver.org/), and create a new release tag.

74 changes: 37 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"configurationAttributes": {
"launch": {
"required": [
"program_binary",
"programBinary",
"chip"
],
"properties": {
Expand All @@ -100,7 +100,7 @@
"description": "Optionally onnect to an existing `probe-rs-debugger` session on IP and Port, e.g. '127.0.0.1:50000'",
"default": "127.0.0.1:50000"
},
"program_binary": {
"programBinary": {
"type": "string",
"description": "The path (relative to `cwd` or absolute) to the binary for your target firmware",
"default": "./target/debug/thumbv7em-none-eabihf/${workspaceFolderBasename}"
Expand All @@ -114,7 +114,7 @@
"type": "string",
"description": "Please specify the appropriate chip from the list of supported chips reported by running `probe-rs-debugger list-chips`."
},
"core_index": {
"coreIndex": {
"type": "number",
"description": "The zero based index of the MCU core for this session",
"default": 0
Expand Down Expand Up @@ -143,15 +143,15 @@
"type": "number",
"description": "Specify the protocol speed in kHz."
},
"wire_protocol": {
"wireProtocol": {
"type": "string",
"description": "The correct wire Protocol to use.",
"enum": [
"Swd",
"Jtag"
]
},
"console_log_level": {
"consoleLogLevel": {
"type": "string",
"description": "The level of log info printed to the console. This also sets the RUST_LOG environment variable wherever possible.",
"enum": [
Expand All @@ -163,49 +163,49 @@
],
"default": "Error"
},
"connect_under_reset": {
"connectUnderReset": {
"type": "boolean",
"description": "This option will result in the target reset pin being held high during the attach operation.",
"default": false
},
"flashing_enabled": {
"flashingEnabled": {
"type": "boolean",
"description": "Flash the target before debugging.",
"default": true
},
"reset_after_flashing": {
"resetAfterFlashing": {
"type": "boolean",
"description": "Reset the target after flashing.",
"default": true
},
"halt_after_reset": {
"haltAfterReset": {
"type": "boolean",
"description": "Halt the target after reset.",
"default": true
},
"full_chip_erase": {
"fullChipErase": {
"type": "boolean",
"description": "Do a full chip erase, versus page-by-page erase.",
"default": false
},
"restore_unwritten_bytes": {
"restoreUnwrittenBytes": {
"type": "boolean",
"description": "Restore erased bytes that will not be rewritten from ELF.",
"default": false
},
"rtt_enabled": {
"rttEnabled": {
"type": "boolean",
"description": "If true, the debugger will open an RTT Terminal tab for each of the active channels on the target.",
"default": false
},
"rtt_channel_formats": {
"rttChannelFormats": {
"type": "array",
"items": {
"channel_number": {
"channelNumber": {
"type": "number",
"description": "The channel number to which this data format applies. If any active channel numbers are omitted, we will assume the default will be `format=String', and 'show_timestamps=false'."
"description": "The channel number to which this data format applies. If any active channel numbers are omitted, we will assume the default will be `dataFormat=String', and 'showTimestamps=false'."
},
"data_format": {
"dataFormat": {
"type": "string",
"description": "One of the supported data formats for RTT channels.",
"enum": [
Expand All @@ -220,10 +220,10 @@
],
"default": "String"
},
"show_timestamps": {
"showTimestamps": {
"type": "boolean",
"default": false,
"description": "Enable the inclusion of timestamps in the RTT output for `data_format=String`."
"description": "Enable the inclusion of timestamps in the RTT output for `dataFormat=String`."
}
}
}
Expand All @@ -232,15 +232,15 @@
"attach": {
"required": [
"chip",
"program_binary"
"programBinary"
],
"properties": {
"server": {
"type": "string",
"description": "Optionally onnect to an existing `probe-rs-debugger` session on IP and Port, e.g. '127.0.0.1:50000'",
"default": "127.0.0.1:50000"
},
"program_binary": {
"programBinary": {
"type": "string",
"description": "The path (relative to `cwd` or absolute) to the binary for your target firmware",
"default": "./target/thumbv7em-none-eabihf/debug/${workspaceFolderBasename}"
Expand All @@ -254,7 +254,7 @@
"type": "string",
"description": "Please specify the appropriate chip from the list of supported chips reported by running `probe-rs-debugger list-chips`."
},
"core_index": {
"coreIndex": {
"type": "number",
"description": "The zero based index of the MCU core for this session",
"default": 0
Expand Down Expand Up @@ -283,15 +283,15 @@
"type": "number",
"description": "Specify the protocol speed in kHz."
},
"wire_protocol": {
"wireProtocol": {
"type": "string",
"description": "The correct wire Protocol to use.",
"enum": [
"Swd",
"Jtag"
]
},
"console_log_level": {
"consoleLogLevel": {
"type": "string",
"description": "The level of log info printed to the console. This also sets the RUST_LOG environment variable wherever possible.",
"enum": [
Expand All @@ -303,19 +303,19 @@
],
"default": "Error"
},
"rtt_enabled": {
"rttEnabled": {
"type": "boolean",
"description": "If true, the debugger will open an RTT Terminal tab for each of the active channels on the target.",
"default": false
},
"rtt_channel_formats": {
"rttChannelFormats": {
"type": "array",
"items": {
"channel_number": {
"channelNumber": {
"type": "number",
"description": "The channel number to which this data format applies. If any active channel numbers are omitted, we will assume the default will be `format=String', and 'show_timestamps=false'."
"description": "The channel number to which this data format applies. If any active channel numbers are omitted, we will assume the default will be `dataFormat=String', and 'showTimestamps=false'."
},
"data_format": {
"dataFormat": {
"type": "string",
"description": "One of the supported data formats for RTT channels.",
"enum": [
Expand All @@ -330,10 +330,10 @@
],
"default": "String"
},
"show_timestamps": {
"showTimestamps": {
"type": "boolean",
"default": false,
"description": "Enable the inclusion of timestamps in the RTT output for `data_format=String`."
"description": "Enable the inclusion of timestamps in the RTT output for `dataFormat=String`."
}
}
}
Expand All @@ -345,12 +345,12 @@
"type": "probe-rs-debug",
"request": "launch",
"name": "probe-rs Test",
"program_binary": "./target/debug/thumbv7em-none-eabihf/${workspaceFolderBasename}",
"programBinary": "./target/debug/thumbv7em-none-eabihf/${workspaceFolderBasename}",
"chip": "STM32H745ZITx",
"connect_under_reset": true,
"flashing_enabled": true,
"reset_after_flashing": true,
"halt_after_reset": true
"connectUnderReset": true,
"flashingEnabled": true,
"resetAfterFlashing": true,
"haltAfterReset": true
}
],
"configurationSnippets": [
Expand All @@ -361,9 +361,9 @@
"type": "probe-rs-debug",
"request": "launch",
"name": "probe-rs Test",
"program_binary": "./target/debug/thumbv7em-none-eabihf/${workspaceFolderBasename}",
"programBinary": "./target/debug/thumbv7em-none-eabihf/${workspaceFolderBasename}",
"chip": "STM32H745ZITx",
"connect_under_reset": true
"connectUnderReset": true
}
}
]
Expand Down
14 changes: 7 additions & 7 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ class ProbeRSDebugAdapterServerDescriptorFactory implements vscode.DebugAdapterD
// Make sure we have a terminal window per channel, for RTT Logging
if (vscode.debug.activeDebugSession) {
let session = vscode.debug.activeDebugSession;
if (session.configuration.hasOwnProperty('rtt_enabled') &&
session.configuration.rtt_enabled) {
if (session.configuration.hasOwnProperty('rttEnabled') &&
session.configuration.rttEnabled) {
let channelWriteEmitter = new vscode.EventEmitter<string>();
let channelPty: vscode.Pseudoterminal = {
onDidWrite: channelWriteEmitter.event,
Expand Down Expand Up @@ -134,10 +134,10 @@ class ProbeRSDebugAdapterServerDescriptorFactory implements vscode.DebugAdapterD

switch (customEvent.event) {
case 'probe-rs-rtt-channel-config':
this.createRttTerminal(+customEvent.body?.channel_number, customEvent.body?.data_format, customEvent.body?.channel_name);
this.createRttTerminal(+customEvent.body?.channelNumber, customEvent.body?.dataFormat, customEvent.body?.channelName);
break;
case 'probe-rs-rtt-data':
let incomingChannelNumber: number = +customEvent.body?.channel_number;
let incomingChannelNumber: number = +customEvent.body?.channelNumber;
for (var [channelNumber, dataFormat, , channelWriteEmitter] of this.rttTerminals) {
if (channelNumber === incomingChannelNumber) {
switch (dataFormat) {
Expand Down Expand Up @@ -176,7 +176,7 @@ class ProbeRSDebugAdapterServerDescriptorFactory implements vscode.DebugAdapterD
}

async createDebugAdapterDescriptor(session: vscode.DebugSession, executable: vscode.DebugAdapterExecutable | undefined): Promise<vscode.DebugAdapterDescriptor | null | undefined> {
probeRsLogLevel = session.configuration.console_log_level;
probeRsLogLevel = session.configuration.consoleLogLevel;

// Initiate either the 'attach' or 'launch' request.
// We do NOT use DebugAdapterExecutable
Expand Down Expand Up @@ -210,8 +210,8 @@ class ProbeRSDebugAdapterServerDescriptorFactory implements vscode.DebugAdapterD
args.push(debugServer[1]);

var logEnv = 'error'; //This is the default
if (session.configuration.hasOwnProperty('console_log_level')) {
logEnv = session.configuration.console_log_level.toLowerCase();
if (session.configuration.hasOwnProperty('consoleLogLevel')) {
logEnv = session.configuration.consoleLogLevel.toLowerCase();
};

var options = {
Expand Down