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

Release 2.6.0 #27

Merged
merged 34 commits into from
Jan 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5012d2f
Fix bullet in README 'why' section
mark-wiemer Nov 8, 2020
eb3b66d
Make dev note to confirm md files render correctly
mark-wiemer Nov 8, 2020
01f6a76
Remove redundant references to AHK in commands
mark-wiemer Nov 9, 2020
98faa17
Change "the original author" to "cweijan"
mark-wiemer Nov 10, 2020
c3428f0
Update 'why' section of README
mark-wiemer Nov 10, 2020
849f94e
Capitalize keybindings internally
mark-wiemer Nov 13, 2020
ddc8b9f
Clarify "execute path" and "compile path" settings
mark-wiemer Nov 13, 2020
40956d4
Clarify license as MIT license
mark-wiemer Nov 14, 2020
4b53164
Fix coloring of funcs with keyword names
mark-wiemer Dec 13, 2020
ef9c1ce
Merge pull request #13 from mark-wiemer/misc
mark-wiemer Dec 13, 2020
0ae3c74
Merge branch 'master' into dev
mark-wiemer Dec 13, 2020
d682668
Organize gitignore
mark-wiemer Dec 13, 2020
ad6c399
Support functions with space before call
mark-wiemer Dec 13, 2020
05c8650
Refactor code, init document service
cweijan Nov 17, 2020
91f3c96
Implement `Open Help` and fix command names
cweijan Nov 17, 2020
77ade63
Support running selection as standalone script
cweijan Nov 17, 2020
0e79a07
Update README and remove unused images
cweijan Nov 17, 2020
f137e30
Make indentation consistent for return and ExitApp
cweijan Nov 19, 2020
342b82d
Remove variables from outline
cweijan Nov 19, 2020
961dcb1
Remove deprecation warning from StrSplit function
fade2gray Dec 5, 2020
43e71ae
Simplify creation of block comments
fade2gray Dec 5, 2020
934964e
Fix getLabelByLine to allow tab characters
tmplinshi Dec 6, 2020
e1510f6
Allow some nesting in regions
fade2gray Dec 13, 2020
b433bac
Add tests and known bug references
mark-wiemer Jan 18, 2021
8573154
Add Run Selection test
mark-wiemer Jan 18, 2021
7e34a0d
Improve Development documentation
mark-wiemer Jan 18, 2021
e94be24
Update Development.md
mark-wiemer Jan 18, 2021
17218b5
Fix and remove unused links in README
mark-wiemer Jan 18, 2021
6a85f60
Add note to confirm links in README work
mark-wiemer Jan 18, 2021
5fa77dc
Change `Open Help` to `Ctrl + F1`
mark-wiemer Jan 18, 2021
709d124
Update README.md
mark-wiemer Jan 18, 2021
184479e
v2.6.0
mark-wiemer Jan 18, 2021
2b0e4c3
Remove unnecessary comment
mark-wiemer Jan 18, 2021
b92e13a
Update changelog
mark-wiemer Jan 18, 2021
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
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