Skip to content

Commit

Permalink
Merge pull request #27 from mark-wiemer/v-2.6.0
Browse files Browse the repository at this point in the history
Release 2.6.0
  • Loading branch information
mark-wiemer authored Jan 18, 2021
2 parents fd21808 + b92e13a commit 37074f8
Show file tree
Hide file tree
Showing 32 changed files with 354 additions and 265 deletions.
16 changes: 11 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
out
node_modules
.vscode-test/
*.vsix
# Folders
.idea/
package-lock.json
.vscode-test/
node_modules
out

# Files
.vscode/settings.json
package-lock.json

# Both
*.vsix
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# CHANGELOG

## 2.6.0 - 2021-01-18

### Features

- Add `Open Help` command
- Add `Run Selection` command
- Add foldable region comments

### Fixes

- Improve formatting for using `ExitApp` to end subroutines
- Fix function coloring for functions whose names were also keywords ([#11](https://github.com/mark-wiemer/vscode-autohotkey-plus-plus/issues/11))
- Fix function coloring for calls with a space before the parentheses (e.g. `foo ()`)
- Fix detection of labels indented with a tab
- Remove confusing deprecation warning from `StrSplit` function
- Remove variables from outline

## 2.5.12 - 2020-11-08

- Improve settings readability
Expand Down
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Copyright 2020 weijan (https://github.com/cweijan), Mark Wiemer (https://github.com/mark-wiemer)
Copyright (c) 2020 [weijan](https://github.com/cweijan), [Mark Wiemer](https://github.com/mark-wiemer)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
71 changes: 31 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,63 @@
# AutoHotkey Plus Plus (AHK++)

AutoHotkey Plus Plus (AHK++) provides actively maintained, comprehensive AutoHotkey language support for VS Code. This includes IntelliSense and debug support, along with the standard code highlighting. AHK++ is a fork of the deprecated [AutoHotkey Plus by cweijan](https://github.com/cweijan/vscode-autohotkey#readme).
AutoHotkey Plus Plus (AHK++) provides actively maintained, comprehensive AutoHotkey language support for VS Code. This includes IntelliSense and debug support, along with the standard code highlighting. AHK++ is a fork of the [once-deprecated AutoHotkey Plus by cweijan](https://github.com/AutoHotkey-Plus/vscode-autohotkey/commit/e87f12774692d4c0d792650c099e6071dc17b069).

> View this README on the [project site](https://github.com/mark-wiemer/vscode-autohotkey-plus-plus#readme)
## Contents

- [Why AutoHotkey Plus Plus?](#why-autohotkey-plus-plus)
- [Coffee](#coffee)
- [Install](#install)
- [Commands](#commands)
- [Debug](#debug)
- [Language Features](#language-features)
- [IntelliSense](#intellisense)
- [Function Symbol](#function-symbol)
- [Goto Definition](#goto-definition)
- [Find References](#find-references)
- [Code Symbol](#code-symbol)
- [Go To Definition](#go-to-definition)
- [Find References](#find-symbol-references)
- [Hover Tip](#hover-tip)
- [Code Format](#code-format)
- [Context Menu](#context-menu)
- [Credits](#credits)

## Why AutoHotkey Plus Plus?

AutoHotkey Plus Plus is one of many extensions that offer VS Code language support. So why should you use this one?

- **IntelliSense**: Smart code completion, syntax highlighting, code navigation, and more.
**Actively Maintained**: Any issues encountered while using this extension can be reported and fixed. With other extensions, anything that's broken will stay broken forever. You can report any issues (and view all issues) at [the issue tracker](https://github.com/mark-wiemer/vscode-autohotkey-plus-plus/issues)
- **Actively Maintained**: Any issues encountered while using this extension can be reported and fixed. With other extensions, anything that's broken will stay broken forever. You can report any issues with AHK++ (and view all issues) through the [issue tracker](https://github.com/mark-wiemer/vscode-autohotkey-plus-plus/issues).
- **Debug Support**: Run and debug AHK scripts from VS Code.
- **New Features**: Another benefit to active maintenance is that AHK++ can add new features as users request them.

## Coffee
## Install

If you like this extension, consider [buying the orignal author a coffee](https://www.buymeacoffee.com/cweijan). Thank you!
Install from VS Code or install from VS Code Marketplace: [Install AutoHotkey Plus Plus](https://marketplace.visualstudio.com/items?itemName=mark-wiemer.vscode-autohotkey-plus-plus).

## Install
## Commands

Install from VS Code Marketplace: [Install AutoHotkey Plus Plus](https://marketplace.visualstudio.com/items?itemName=mark-wiemer.vscode-autohotkey-plus-plus).
With AHK++, you can compile, debug, and run your scripts with keyboard shortcuts. You can also run a selection as a standalone script. Additionally, you can `Open Help` with `Ctrl + F1`.

- Compile: `Ctrl + Shift + F9`
- Debug: `F9`
- Open Help: `Ctrl + F1`
- Run: `Ctrl + F9`
- Run Selection: `Ctrl + F8`

## Debug

1. Click Run or press F9.
2. Debugger supports breakpoints, stack tracing, and variable watching
![Debug](image/debug.gif)

![Debug](image/debug.gif)

### Debug Features

1. **Output Message**: You can use `OutputDebug` command instead of `MsgBox` to log values.
![Output](image/output.jpg)

![Output](image/output.jpg)

2. **Evaluate**: Set and get variable values through the debug console.
![Evaluate](image/evalute.jpg)

![Evaluate](image/evalute.jpg)

This extension provides basic debugging functions. If you need more debugging functions (such as conditional breakpoints), you can add an additional extension: [Install vscode-autohotkey-debug](https://marketplace.visualstudio.com/items?itemName=zero-plusplus.vscode-autohotkey-debug).

Expand All @@ -61,33 +69,26 @@ Supports IntelliSense for variables and functions.

### Function Symbol

1. Detach source function as symbol
2. You can add a comment to the function using a semicolon on the line above the function declaration

![Function Symbol](image/functionSymbol.jpg)
1. You can add a comment to the function using a semicolon on the line above the function declaration

### Goto Definition
### Go to Definition

1. Support goto function and variable definition.
1. Supports navigation to symbol definition.
2. Usage: Ctrl-click on the symbol to navigate to its definition.

![Goto Definition](image/gotoDefinition.jpg)

### Find Symbol References

Usage: Move coordinates to symbol, then:
Select a symbol, then:

- Right-click on a symbol, then select `Find All References`.
- Right-click and select `Find All References`.
- Or press `Shift + F12`.

### Code Symbol

Usage: Add two semicolon to comment code block
![Code Symbol](image/codeSymbol.jpg)

### Hover Tip

Usage: Move mouse to function call or command.
Usage: Hover over symbol to see IntelliSense documentation.

![Hover](image/hover.png)

### Code Format
Expand All @@ -98,19 +99,9 @@ Supports standard VS Code formatting.
![Code Format](image/codeFormat.jpg)

## Context Menu

Run and compile code from the context menu.

Right-click to open the context menu, then:

- **Run**: Run script without debug (`Ctrl + F9`).
- **Compile**: Compile script in same directory (`Ctrl + Shift + F9`).
![compile](image/compile.jpg)

## Credits

Previous extensions:

- [AutoHotkey Plus](https://github.com/cweijan/vscode-autohotkey)
- [AutoHotkey](https://github.com/stef-levesque/vscode-autohotkey)
- [AutoHotkey Plus by cweijan](https://github.com/cweijan/vscode-autohotkey)
- [AutoHotkey by stef-levesque](https://github.com/stef-levesque/vscode-autohotkey)
5 changes: 2 additions & 3 deletions ahk.configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@
["'", "'"],
["%", "%"]
],
// Folding regions marked by ";region" and ";endregion" comments.
"folding": {
"markers": {
"start": "^\\s*\\;\\s*region\\b",
"end": "^\\s*\\;\\s*endregion\\b"
"start": "^(\\/\\*)?\\s*\\;\\s*region\\b",
"end": "^(\\*\\/)?\\s*\\;\\s*endregion\\b"
}
}
}
141 changes: 95 additions & 46 deletions demos/demo_for_ahk_v1.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,103 @@ function()
return
function()
{
globalVar := "Local"
SuperGlobalVar := "Local"
bool := true
str := "string"
if (str == "str") {
MsgBox Overwrite primitive variable!
}
str_multiline := "
(LTrim
line 1
line 2
line 3
)"
int := 123
float := 123.456

emptyArray := []
smallArray := [1, 2, { str: "string" }]
globalVar := "Local"
SuperGlobalVar := "Local"
bool := true
str := "string"
if (str == "str") {
MsgBox Overwrite primitive variable!
}
; Known bug: `line <n>` lines should be indented one level more
; https://github.com/mark-wiemer/vscode-autohotkey-plus-plus/issues/25
str_multiline := "
(LTrim
line 1
line 2
line 3
)"
int := 123
float := 123.456

emptyArray := []
smallArray := [1, 2, { str: "string" }]
sparseArray := { 1: 1, 3: 3 }
arrayLike := { 1: 1, 2: 2, 3: 3, length: 3 }
bigArray := []
Loop 150 {
bigArray.push(A_Index)
}
if (bigArray == "str") {
MsgBox Overwrite object variable!
}

obj := { str: str, int: int, float: float }
objobj := { str: str, obj: obj }
objobjobj := { str: str, int: int, obj: { str: str, obj: obj } }

circular := {}
circular.circular := circular
instance := new Cls()

enum := obj._NewEnum()
arrayLike := { 1: 1, 2: 2, 3: 3, length: 3 }
bigArray := []
Loop 150 {
bigArray.push(A_Index)
}
if (bigArray == "str") {
MsgBox Overwrite object variable!
}

obj := { str: str, int: int, float: float }
objobj := { str: str, obj: obj }
; Known bug: the entire body of a function should be indented
; https://github.com/mark-wiemer/vscode-autohotkey-plus-plus/issues/26
objobjobj := { str: str, int: int, obj: { str: str, obj: obj } }

circular := {}
circular.circular := circular
instance := new Cls()

enum := obj._NewEnum()
}
class Cls
{
instanceVar := "instance"
static str := "string"
static num := 123
static obj := { str: "string", int: 123, float: 123.456 }
property[] {
get {
}
}
method() {
}
instanceVar := "instance"
static str := "string"
static num := 123
static obj := { str: "string", int: 123, float: 123.456 }
property[] {
get {
}
}
method() {
}
}

; Block comments and nested regions
/* ;region
Collapse me!
{
Collapse me too!
}
*/ ;endregion

; Hotkeys and Keywords

<#Tab:: AltTab

; FUNCTIONS

; Method header comment accessible to IntelliSense
LAlt() {
; do a thing
}

; Function calls (with a space before parens)
foo()
bar ()
baz ()

; Functions with keyword names
LAlt()
Pause()
AppsKey()
CapsLock()

; SUBROUTINES

; ExitApp indentation for subroutines
MySub:
foo()
ExitApp

; RUN SELECTION

; Select the following line and hit `Ctrl + F8` to run selection
f1:: MsgBox, You hit F1

; The F2 hotkey will not work because it was not part of the selection
f2:: MsgBox, You hit F2
8 changes: 6 additions & 2 deletions docs/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
This document covers the development process, from writing code to publishing a new version.

1. Write the code on the `dev` branch, or offshoots of that branch. Merge the changes to the `dev` branch as they become stable.
- Test all added commands
- Perform the formatting tests
- Confirm README appears as intended
- Confirm links in README work
1. Once the `dev` branch has all the features for a new release, create a new release branch named `v-<major>.<minor>.<patch>` (e.g. `v-2.5.10`).
- Confirm the package version has been updated
- Confirm the changelog has been updated
1. Push the changes, open a PR, review the changes, and merge to `master`.
1. Confirm the package version has been updated
1. Confirm the changelog has been updated
1. Pull the new master branch
1. Package the new release using `vsce package`.
1. Publish the release through [Visual Studio Marketplace](https://marketplace.visualstudio.com/manage/publishers/mark-wiemer)
Expand Down
Binary file removed image/codeSymbol.jpg
Binary file not shown.
Binary file removed image/compile.jpg
Binary file not shown.
Binary file removed image/functionSymbol.jpg
Binary file not shown.
Loading

0 comments on commit 37074f8

Please sign in to comment.