Skip to content

Commit

Permalink
Merge pull request #4 from DanielHuey/dev
Browse files Browse the repository at this point in the history
Various Improvements to the extension
  • Loading branch information
DanielHuey authored Oct 31, 2024
2 parents 53023bb + 59446e3 commit 1c57000
Show file tree
Hide file tree
Showing 17 changed files with 1,682 additions and 16,951 deletions.
48 changes: 48 additions & 0 deletions .github/actions/build_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Extension Builder Action

on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
build:
name: Build Extension
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Node.js Version
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Check and setup caches
uses: actions/cache@v3
id: npm-cache
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != true
run: npm install

- name: Run build script
run: npm run avr-utils

- name: Rename application entry file
run: sed -i "s#./extension.js#out/main.js#" package.json

- name: Package Extension
run: vsce pack

- name: Save artifact
uses: actions/upload-artifact@v3
with:
name: extension-latest.vsix
path: "*.vsix"
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
/node_modules
/test
/vsc-extension-quickstart.md
/out/storage/data.json
/src/storage/data.json
/out/storage/data.json
/out/main.js
.vscode/settings.json
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

All notable changes to the "avr-utils" extension will be documented in this file.

### [0.1.4]
- Fix error where commands like "Create New Project" in the command palette claim that they are missing ( Would happen especially on VSCode version < 1.75 ).
- Added a progress bar when downloading the toolchain, so that you (the user) are aware of the process.
- Better error message diagnostics, the extension was really lacking in this area as compilations were not giving useful error messages in case errors existed.
- Added necessary configurations to allow VSCode's keybinds `Ctrl+/` and `Alt+Shift+A` to quickly comment and uncomment lines and blocks of code respectively.
- There was also a (slightly annoying) visual bug where the compile button would render at ALL times. This has also been fixed.
- Changed the quick action for compiling from `F5` to `F4` because F5 is usually used for debugging.
- Moving from manual builds of minified js file to a CI based workflow (Thank you, GitHub Actions!)

### [0.1.2]

- Refactored Code to get the proper list of devices directly from `io.h` file in the avr toolchain. [#3](https://github.com/DanielHuey/avr-utils/issues/3)
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ Welcome to **`avr-utils`**.

This extension helps users to write and compile code for their avr microcontrollers straight from the comfort of their favourite Code editor, **VScode**

## !! New !!
- Progress bar when downloading toolchain.
- Better error message diagnostics (Big Improvement!)
- Simplified Commenting of code.

More in [Changelog.md](./CHANGELOG.md)

## Features

- ### Projects: Creating and importing
Expand Down
35 changes: 35 additions & 0 deletions extension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
// eslint-disable-next-line no-unused-vars
const vscode = require("vscode");
const { init } = require("./src/init");
const registerCommands = require("./src/registerCommands");
const registerProviders = require("./src/registerProviders");
const { dataObject } = require("./src/utils");

// This method is called when your extension is activated
// Your extension is activated the very first time the command is executed

/**
* @param {vscode.ExtensionContext} context
*/
async function activate(context) {
dataObject(); // To initialize the data.json file
registerCommands();
// DO NOT MOVE THESE LINES ABOVE. THESE 2 LINES MUST BE FIRST
await init(context);

registerProviders(context);

console.log('"avr-utils" is now active!');
}

// This method is called when your extension is deactivated
function deactivate() {
vscode.commands.executeCommand('setContext', 'avr-utils.isAvrC', false);
}

module.exports = {
activate,
deactivate,
};
Loading

0 comments on commit 1c57000

Please sign in to comment.