Skip to content

Commit

Permalink
v5.1.0 🧪 (#467)
Browse files Browse the repository at this point in the history
* Add pre-release template

* Stop ignoring submodule

* Stop ignoring submodule for formatting

* Ignore ahk2 files again

Submodule will format and lint itself moving forward

* Add nested formatting

* Fixup nested eslint

* Document openHelp todo

* Update package.json contributes with ahk2 stuff

* fixup v2 integration docs

* Default to switch to v1

* update subproject

* restore pre-commit hook

* Add output language

* Update docs

* update submodule

* Update submodule to tip of main

* Update docs

* Deploy pre-releases

* Update docs

* Cleanup docs

* Pre-releases don't get their own emoji 😤

* Fix grammar tests

* Update readme with pre-release details

* thanks to thqby!

* Bump to 5.1.0

* Add formatting test

* Compile grammar before packaging

* Document known issue with global recognition

* Remove ahk2.help, restore ahk++.help

* Update sub to tip of main

* Final updates!

* #lastminute

* it's tomorrow!

* Use prettier 3.3.3 for consistency with submodule

* Disable format check
  • Loading branch information
mark-wiemer authored Aug 22, 2024
1 parent 8a6bf1e commit d3e5b50
Show file tree
Hide file tree
Showing 18 changed files with 901 additions and 75 deletions.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/pre-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Issues with AHK v2 support
about: Issues specific to AutoHotkey v2.
title: '[Pre-release] '
labels: pre-release
assignees: mark-wiemer
---

- [ ] My issue is different from [other reported pre-release issues](https://github.com/mark-wiemer-org/ahkpp/issues?q=sort%3Aupdated-desc+label%3Apre-release+is%3Aopen)

**Is your issue related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
with:
# Generated via https://open-vsx.org/user-settings/tokens, valid forever?
pat: ${{ secrets.OPEN_VSX_TOKEN }}
prerelease: true
- name: Publish to Visual Studio Marketplace
uses: HaaLeo/publish-vscode-extension@v1
with:
Expand All @@ -25,3 +26,4 @@ jobs:
# Saved locally as "CI VS Code Marketplace Publish Token", expires 2024-06-22
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
prerelease: true
12 changes: 5 additions & 7 deletions .vscode/dev.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,14 @@
" tests.forEach(([name, args, expected]) =>",
" test(name, () => assert.strictEqual($1(...args), expected)),",
" );",
"});"
"});",
],
"description": "Generate tests for Mocha."
"description": "Generate tests for Mocha.",
},
"Issue link (ahkpp)": {
"scope": "markdown",
"prefix": "[#",
"body": [
"[#$1](https://github.com/mark-wiemer-org/ahkpp/issues/$1)"
],
"description": "Link an ahkpp issue"
}
"body": ["[#$1](https://github.com/mark-wiemer-org/ahkpp/issues/$1)"],
"description": "Link an ahkpp issue",
},
}
19 changes: 19 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 5.1.0 - 2024-08-22 🧪

> 🧪 means this is a [pre-release](https://code.visualstudio.com/updates/v1_63#_pre-release-extensions)!
This is a very early pre-release, expect significant issues. Commands may not work as expected and features may be missing.

### Breaking changes

For [technical reasons](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions), this is tagged with `5.1.0`, but it is a breaking release and the full release will be tagged `6.0.0`

- I haven't found any yet! Please [🐛 report any issues](https://github.com/mark-wiemer-org/ahkpp/issues/new/choose) you find 🤓

### Other changes

- Add full v2 support via [thqby's AutoHotkey v2 Language Support](https://marketplace.visualstudio.com/items?itemName=thqby.vscode-autohotkey2-lsp)
- No need to install that extension, all features are bundled into this extension
- Future work will de-dupe commands like "debug", "run selection", and "open help"
- Known issues and all new features are documented at [full v2 integration](docs/FullV2Integration.md)

## 5.0.7 - 2024-08-17 😬

- Fix readme: v2 debugger works via commands, just not via "run and debug" viewlet
Expand Down
4 changes: 2 additions & 2 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ See [language-specific editor settings](https://code.visualstudio.com/docs/getst
"editor.defaultFormatter": "esbenp.prettier-vscode",
"terminal.integrated.defaultProfile.windows": "Git Bash",
"[ahk]": {
"editor.defaultFormatter": "mark-wiemer.vscode-autohotkey-plus-plus"
}
"editor.defaultFormatter": "mark-wiemer.vscode-autohotkey-plus-plus",
},
}
```

Expand Down
2 changes: 1 addition & 1 deletion ahk2
Submodule ahk2 updated from bfda9c to f7548c
File renamed without changes.
4 changes: 4 additions & 0 deletions demos/manualTests/formatting.ahk2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#Requires AutoHotkey v2

; Shift+Alt+F to format
ExitApp()
2 changes: 1 addition & 1 deletion demos/manualTests/run.ahk2
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

MsgBox("You did it!")

ExitApp()
ExitApp()
2 changes: 1 addition & 1 deletion demos/manualTests/runSelection.ahk2
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ MsgBox("1")

; Select the following two lines and hit `Ctrl + F8` to run selection
MsgBox("2")
ExitApp()
ExitApp()
143 changes: 143 additions & 0 deletions docs/FullV2Integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Full v2 integration

This doc covers all the new features as a result of integrating with thqby's AHK v2 Language Support extension. See [known issues](#known-issues) at the bottom of this file

## The big changes

- Formatting support
- Better v2 IntelliSense support: rename, hover, and more

## package.json contributions

### Commands

- ahk2.debug (dupe of ahk++.debug)
- ahk2.debug.attach
- ahk2.debug.params
- ahk2.diagnostic.full
- ahk2.export.symbols
- ahk2.run (dupe of ahk++.run)
- ahk2.selection.run (dupe of ahk++.runSelection)
- ahk2.stop
- ahk2.compile (dupe of ahk++.compile)
- ahk2.generate.comment
- ahk2.updateversioninfo
- ahk2.switch
- ahk2.selectSyntaxes
- ahk2.setscriptdir

### Configuration

- AutoHotkey2.AutoLibInclude
- AutoHotkey2.CommentTags
- AutoHotkey2.CompilerCMD
- AutoHotkey2.CompleteFunctionParens
- AutoHotkey2.DebugConfiguration
- AutoHotkey2.Diagnostics.ClassNonDynamicMemberCheck
- AutoHotkey2.Diagnostics.ParamsCheck
- AutoHotkey2.Warn.VarUnset
- AutoHotkey2.Warn.LocalSameAsGlobal
- AutoHotkey2.Warn.CallWithoutParentheses
- AutoHotkey2.ActionWhenV1IsDetected (now defaults to "Switch to v1" instead of "Warn")
- AutoHotkey2.CompletionCommitCharacters
- AutoHotkey2.Files.Exclude
- AutoHotkey2.Files.ScanMaxDepth
- AutoHotkey2.FormatOptions
- AutoHotkey2.InterpreterPath
- AutoHotkey2.SymbolFoldingFromOpenBrace
- AutoHotkey2.WorkingDirs
- AutoHotkey2.Syntaxes

### Configuration defaults

```json
{
"[ahk2]": {
"editor.defaultFormatter": "mark-wiemer.vscode-autohotkey-plus-plus",
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": true
}
}
}
```

### Grammars

- Added `embeddedLanguages` to `ahk2`
- Added `~ahk2-output` (debug output syntax)

### Keybindings

See [commands](#commands) for duplicates

- ahk2.run
- ahk2.selection.run
- ahk2.compile
- ahk2.debug
- ahk2.debug.params
- ahk2.help
- ahk2.stop

### Languages

- ahk2.configuration.json

### Menus

See [commands](#commands) for duplicates

editor/context:

- ahk2.debug
- ahk2.debug.attach
- ahk2.debug.params
- ahk2.selection.run
- ahk2.run
- ahk2.compile
- ahk2.help
- ahk2.stop
- ahk2.generate.comment
- ahk2.updateversioninfo

editor/title:

- ahk2.run
- ahk2.stop
- ahk2.debug

### Semantic token scopes

New, added:

```json
[
{
"language": "ahk2",
"scopes": {
"operator": ["keyword.operator.wordlike.ahk2"]
}
}
]
```

## Known issues

### Blocking

These issues will be resolved before a full release

- Several [commands](#commands) are duplicated. The plan is to retain the current visual style.
- Globals like `MsgBox` and `ExitApp` are not recognized in any file, e.g. [compile.ahk2](../demos/manualTests/compile.ahk2)
- `common.ts#loadahk2` needs work
- Needs more tests!! Many features have not been tested at all, hence the pre-release!
- [Release pipeline](../.github/workflows/deploy.yml) has been changed to push pre-releases. Definitely fix this for the final release 😉

### Low priority

These issues will be backlogged and resolved after a full release

- App is bloated, including source map files that can be removed. See [ahk2/webpack.config.js](../ahk2/webpack.config.js)
- No newline at end of file when formatting (inconsistent with v1 and industry standards)
- Format check is [failing in the pipeline](https://github.com/mark-wiemer-org/ahkpp/actions/runs/10503320004/job/29096451649?pr=467)
4 changes: 1 addition & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ import tseslint from 'typescript-eslint';
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
ignores: ['out', 'dist', '**/*.d.ts', 'src/ahk2'],
},
{ ignores: ['out', 'dist', '**/*.d.ts', 'ahk2'] },
);
64 changes: 64 additions & 0 deletions language/ahk2-output.tmLanguage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: ahk2-output
scopeName: ahk2.output
patterns:
- include: '#url'
- captures:
'1':
name: token.info-token
'2':
name: string
match: "^(\\[Running\\])(.*)$"
name: ahk2.running
- captures:
'1':
name: token.info-token
'2':
name: string
'3':
name: token.debug-token
'4':
name: token.error-token
'5':
name: string
'6':
name: constant.numeric
'7':
name: string
match: "^(\\[Done\\])(.+)(?:(code=0)|(code=\\d+))([^\\d]+)(\\d+(?:\\.\\d+)?)([^\\d]+)$"
name: ahk2.done
- match: "\\d{1,3}(\\.\\d{1,3}){3}(:\\d+)"
name: constant.numeric
- match: "^(?i:(\\[error\\])|(\\[info\\])|(\\[warn\\]))(.*)"
captures:
'1':
name: token.error-token
'2':
name: token.info-token
'3':
name: token.warn-token
name: ahk2.log
- include: '#numbers'
- include: '#operators'
- include: '#string'
repository:
url:
match: "\\b((?i:(https?|ws)://\\S+))\\b"
name: string.url
numbers:
match: "\\b(\\d+(?:\\.\\d+)?|0[xX][\\da-fA-F]+)\\b"
name: constant.numeric
operators:
patterns:
- match: "&=|\\^=|<<=|>>=|\\|=|\\.=|\\+=|-=|\\*=|(?<!\\()/=|--|\\+\\+|<<|>>|!=|<=|>=|=?=|<|>|&&|!|\\|\\||&|\\||\\^|~|:=|\\*|/|-|\\+"
name: keyword.operator
string:
patterns:
- begin: (['"])(?=.*\1)
beginCaptures:
'1':
name: punctuation.definition.string.begin
end: "(\\1)"
endCaptures:
'1':
name: punctuation.definition.string.end
name: string.quoted
Loading

0 comments on commit d3e5b50

Please sign in to comment.