diff --git a/.vscode/launch.json b/.vscode/launch.json index 1dc895ad..11d0b2d6 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,4 +1,3 @@ -// A launch configuration that compiles the extension and then opens it inside a new window { "version": "0.1.0", "configurations": [ @@ -16,7 +15,7 @@ { "type": "ahk", "request": "launch", - "name": "Autohotkey v1 Debugger", + "name": "AutoHotkey v1 Debugger", "program": "${workspaceFolder}/demos/demo_for_ahk_v1.ahk", "runtime": "C:\\Program Files\\Autohotkey\\AutoHotkeyU64.exe", "stopOnEntry": false, @@ -27,9 +26,9 @@ { "type": "ahk", "request": "launch", - "name": "Autohotkey v2 Debugger", + "name": "AutoHotkey v2 Debugger", "program": "${workspaceFolder}/demos/demo_for_ahk_v2.ahk", - "runtime": "C:\\Program Files\\AutoHotkey\\v2-alpha\\x64\\AutoHotkey.exe", // Default value of Scite for ahk v2 + "runtime": "C:\\Program Files\\AutoHotkey\\v2-alpha\\x64\\AutoHotkey.exe", "stopOnEntry": false, "dbgpSettings": { "max_children": 149 diff --git a/CHANGELOG.md b/CHANGELOG.md index 61dc6f0c..31f94c75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## 2.5.12 - 2020-11-08 + +- Improve settings readability +- Fix bogus snippets +- Improve Marketplace presence + ## 2.5.11 - 2020-11-07 - Update icon diff --git a/LICENSE b/LICENSE index 451f547c..53d8954c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2020 weijan (https://github.com/cweijan), mark-wiemer (https://github.com/mark-wiemer) +Copyright 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: diff --git a/README.md b/README.md index a61586a6..28e82f29 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ -# AutoHotkey Plus Plus +# AutoHotkey Plus Plus (AHK++) -AutoHotkey language and debug support for VS Code. This extension is a fork of the deprecated [AutoHotkey Plus by cweijan](https://github.com/cweijan/vscode-autohotkey). +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). -> Visit the [project site](https://github.com/mark-wiemer/vscode-autohotkey) +> 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) - [Debug](#debug) @@ -18,12 +19,20 @@ AutoHotkey language and debug support for VS Code. This extension is a fork of t - [Hover Tip](#hover-tip) - [Code Format](#code-format) - [Context Menu](#context-menu) -- [Setting](#setting) - [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) +- **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 -If you like this this extension, consider [buying the orignal author a coffee](https://www.buymeacoffee.com/cweijan). Thank you! +If you like this extension, consider [buying the orignal author a coffee](https://www.buymeacoffee.com/cweijan). Thank you! ## Install @@ -85,7 +94,7 @@ Usage: Move mouse to function call or command. Supports standard VS Code formatting. -> Formatter is not currently customizable. +> The formatter is not currently customizable. ![Code Format](image/codeFormat.jpg) @@ -99,10 +108,6 @@ Right-click to open the context menu, then: - **Compile**: Compile script in same directory (`Ctrl + Shift + F9`). ![compile](image/compile.jpg) -## Setting - -Find more info in VS Code settings for `AutoHotkey Plus Plus`. - ## Credits Previous extensions: diff --git a/docs/Development.md b/docs/Development.md index 57e52e18..4b74191c 100644 --- a/docs/Development.md +++ b/docs/Development.md @@ -5,6 +5,8 @@ This document covers the development process, from writing code to publishing a 1. Write the code on the `dev` branch, or offshoots of that branch. Merge the changes to the `dev` branch as they become stable. 1. Once the `dev` branch has all the features for a new release, create a new release branch named `v-..` (e.g. `v-2.5.10`). 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) diff --git a/package.json b/package.json index 9608604f..6f18efda 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "vscode-autohotkey-plus-plus", "displayName": "AutoHotkey Plus Plus", - "description": "AutoHotkey language and debug support for VS Code, forked from AutoHotkey Plus by cweijan", - "version": "2.5.10", + "description": "AutoHotkey IntelliSense, debug, and language support for VS Code, forked from AutoHotkey Plus by cweijan", + "version": "2.5.12", "publisher": "mark-wiemer", "engines": { "vscode": "^1.30.0" @@ -20,12 +20,12 @@ "license": "See LICENSE file", "icon": "icon.png", "bugs": { - "url": "https://github.com/mark-wiemer/vscode-autohotkey/issues" + "url": "https://github.com/mark-wiemer/vscode-autohotkey-plus-plus/issues" }, - "homepage": "https://github.com/mark-wiemer/vscode-autohotkey/blob/master/README.md", + "homepage": "https://github.com/mark-wiemer/vscode-autohotkey-plus-plus/blob/master/README.md", "repository": { "type": "git", - "url": "https://github.com/mark-wiemer/vscode-autohotkey.git" + "url": "https://github.com/mark-wiemer/vscode-autohotkey-plus-plus.git" }, "galleryBanner": { "color": "#00769D", @@ -45,7 +45,7 @@ "debuggers": [ { "type": "ahk", - "label": "Autohotkey", + "label": "AutoHotkey", "program": "./out/debugger/DebugAdapter.js", "runtime": "\"C:\\Program Files\\Autohotkey\\AutoHotkeyU64.exe\"", "configurationAttributes": { @@ -98,18 +98,18 @@ { "type": "ahk", "request": "launch", - "name": "Autohotkey Debugger", + "name": "AutoHotkey Debugger", "program": "${file}", "stopOnEntry": true } ], "configurationSnippets": [ { - "label": "Autohotkey Debug: Launch", + "label": "AutoHotkey Debug: Launch", "body": { "type": "ahk", "request": "launch", - "name": "Autohotkey Debugger", + "name": "AutoHotkey Debugger", "program": "${file}", "stopOnEntry": true } @@ -148,12 +148,12 @@ }, { "command": "run.ahk", - "title": "Run Ahk Script", + "title": "Run AHK Script", "category": "AHK" }, { "command": "debug.ahk", - "title": "Debug Ahk Script", + "title": "Debug AHK Script", "category": "AHK", "icon": { "light": "./image/run.png", @@ -209,20 +209,20 @@ "type": "object", "title": "AutoHotkey Plus Plus", "properties": { - "vscode-ahk-plus.executePath": { + "ahk++.executePath": { "type": "string", - "default": "C:/Program Files/Autohotkey/AutoHotkeyU64.exe", - "description": "The execute path of ahk." + "default": "C:/Program Files/AutoHotkey/AutoHotkeyU64.exe", + "description": "The execute path of AHK." }, - "vscode-ahk-plus.compilePath": { + "ahk++.compilePath": { "type": "string", - "default": "C:/Program Files/autoHotkey/Compiler/Ahk2Exe.exe", - "description": "The compiler path of ahk." + "default": "C:/Program Files/AutoHotkey/Compiler/Ahk2Exe.exe", + "description": "The compiler path of AHK." }, - "vscode-ahk-plus.enableIntelliSense": { + "ahk++.intellisense": { "type": "boolean", "default": true, - "description": "EnableIntelliSense(Preview)." + "description": "Enable IntelliSense (Preview). Changes take effect after reload." } } } diff --git a/snippets/ahk.json b/snippets/ahk.json index cc134e1c..633322b7 100644 --- a/snippets/ahk.json +++ b/snippets/ahk.json @@ -1120,7 +1120,7 @@ }, "Exception()": { "prefix": "Exception", - "body": "Exception(${Message})", + "body": "Exception(${1:Message})", "description": "Creates an object with properties, also common to exceptions created by runtime errors." }, "Throw": { @@ -1335,17 +1335,17 @@ }, "ObjRelease()": { "prefix": "ObjRelease()", - "body": "ObjRelease($Ptr)", + "body": "ObjRelease(${1:Ptr})", "description": "Decrements an object's reference count." }, "ObjAddRef()": { "prefix": "ObjAddRef()", - "body": "ObjAddRef($Ptr)", + "body": "ObjAddRef(${1:Ptr})", "description": "Increments an object's reference count." }, "ComObject()": { "prefix": "ComObject()", - "body": "ComObject(${VarType}, ${Value} [, ${Flags}])", + "body": "ComObject(${1:VarType}, ${2:Value} [, ${3:Flags}])", "description": "Creates an object representing a typed value to be passed as a parameter or return value.." }, "ComObjCreate()": { diff --git a/src/common/global.ts b/src/common/global.ts index 41730f36..38245849 100644 --- a/src/common/global.ts +++ b/src/common/global.ts @@ -1,7 +1,7 @@ import * as vscode from 'vscode'; export class Global { - public static CONFIG_PREFIX = 'vscode-ahk-plus'; + public static CONFIG_PREFIX = 'ahk++'; private static statusBarItem: vscode.StatusBarItem; /** * get configuration from vscode setting. @@ -31,5 +31,5 @@ export class Global { export enum ConfigKey { compilePath = 'compilePath', executePath = 'executePath', - enableIntelliSense = 'enableIntelliSense', + intellisense = 'intellisense', } diff --git a/src/core/ScriptRunner.ts b/src/core/ScriptRunner.ts index 9cd91bc4..228bd4e5 100644 --- a/src/core/ScriptRunner.ts +++ b/src/core/ScriptRunner.ts @@ -20,8 +20,8 @@ export class ScriptRunner { vscode.debug.startDebugging(vscode.workspace.getWorkspaceFolder(cwd), { type: debugPlusExists ? 'autohotkey' : 'ahk', request: 'launch', - name: 'Autohotkey Debugger', - runtime: Global.getConfig(ConfigKey.executePath), + name: 'AutoHotkey Debugger', + runtime: Global.getConfig(ConfigKey.executePath), program: script, }); } @@ -39,7 +39,7 @@ export class ScriptRunner { debug: boolean = false, debugPort = 9000, ): Promise { - executePath = Global.getConfig(ConfigKey.executePath); + executePath = Global.getConfig(ConfigKey.executePath); if (!vscode.window.activeTextEditor.document.isUntitled) { vscode.commands.executeCommand('workbench.action.files.save'); } @@ -81,7 +81,7 @@ export class ScriptRunner { currentPath.substr(0, pos < 0 ? currentPath.length : pos) + '.exe'; if ( await Process.exec( - `"${Global.getConfig( + `"${Global.getConfig( ConfigKey.compilePath, )}" /in "${currentPath}" /out "${compilePath}"`, { cwd: `${res(currentPath, '..')}` }, diff --git a/src/debugger/debugDispather.ts b/src/debugger/debugDispatcher.ts similarity index 98% rename from src/debugger/debugDispather.ts rename to src/debugger/debugDispatcher.ts index 7fc15a02..4b6463e2 100644 --- a/src/debugger/debugDispather.ts +++ b/src/debugger/debugDispatcher.ts @@ -19,10 +19,10 @@ import { Out } from '../common/out'; import { Global, ConfigKey } from '../common/global'; /** - * A Ahk runtime debugger. + * An AHK runtime debugger. * refrence: https://xdebug.org/docs/dbgp */ -export class DebugDispather extends EventEmitter { +export class DebugDispatcher extends EventEmitter { private debugServer: DebugServer; private breakPointHandler: BreakPointHandler; private commandHandler: CommandHandler; @@ -100,7 +100,7 @@ export class DebugDispather extends EventEmitter { } if (!existsSync(runtime)) { - Out.log(`Autohotkey Execute Bin Not Found : ${runtime}`); + Out.log(`AutoHotkey Execute Bin Not Found: ${runtime}`); this.end(); return; } diff --git a/src/debugger/debugSession.ts b/src/debugger/debugSession.ts index a8c2612d..05b5a7b2 100644 --- a/src/debugger/debugSession.ts +++ b/src/debugger/debugSession.ts @@ -8,7 +8,7 @@ import { Thread, } from 'vscode-debugadapter'; import { DebugProtocol } from 'vscode-debugprotocol'; -import { DebugDispather } from './debugDispather'; +import { DebugDispatcher } from './debugDispatcher'; import { Continue } from './struct/command'; import { VscodeScope } from './struct/scope'; @@ -35,7 +35,7 @@ export interface LaunchRequestArguments */ export class DebugSession extends LoggingDebugSession { private static THREAD_ID = 1; - private dispather: DebugDispather; + private dispatcher: DebugDispatcher; public constructor() { super('ahk-debug.txt'); @@ -44,8 +44,8 @@ export class DebugSession extends LoggingDebugSession { this.setDebuggerLinesStartAt1(false); this.setDebuggerColumnsStartAt1(false); - this.dispather = new DebugDispather(); - this.dispather + this.dispatcher = new DebugDispatcher(); + this.dispatcher .on('break', (reason: string) => { this.sendEvent( new StoppedEvent(reason, DebugSession.THREAD_ID), @@ -94,7 +94,7 @@ export class DebugSession extends LoggingDebugSession { args: DebugProtocol.RestartArguments, request?: DebugProtocol.Request, ): void { - this.dispather.restart(); + this.dispatcher.restart(); this.sendResponse(response); } @@ -102,7 +102,7 @@ export class DebugSession extends LoggingDebugSession { response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments, ) { - this.dispather.start(args); + this.dispatcher.start(args); this.sendResponse(response); } @@ -111,7 +111,7 @@ export class DebugSession extends LoggingDebugSession { args: DebugProtocol.DisconnectArguments, request?: DebugProtocol.Request, ): void { - this.dispather.stop(); + this.dispatcher.stop(); this.sendResponse(response); } @@ -120,7 +120,7 @@ export class DebugSession extends LoggingDebugSession { args: DebugProtocol.SetBreakpointsArguments, ): Promise { response.body = { - breakpoints: this.dispather.buildBreakPoint( + breakpoints: this.dispatcher.buildBreakPoint( args.source.path, args.breakpoints, ), @@ -132,7 +132,7 @@ export class DebugSession extends LoggingDebugSession { response: DebugProtocol.StackTraceResponse, args: DebugProtocol.StackTraceArguments, ): Promise { - response.body = { stackFrames: await this.dispather.stack(args) }; + response.body = { stackFrames: await this.dispatcher.stack(args) }; this.sendResponse(response); } @@ -140,7 +140,7 @@ export class DebugSession extends LoggingDebugSession { response: DebugProtocol.ScopesResponse, args: DebugProtocol.ScopesArguments, ): void { - response.body = { scopes: this.dispather.scopes(args.frameId) }; + response.body = { scopes: this.dispatcher.scopes(args.frameId) }; this.sendResponse(response); } @@ -149,7 +149,9 @@ export class DebugSession extends LoggingDebugSession { args: DebugProtocol.VariablesArguments, request?: DebugProtocol.Request, ) { - response.body = { variables: await this.dispather.listVariables(args) }; + response.body = { + variables: await this.dispatcher.listVariables(args), + }; this.sendResponse(response); } @@ -159,7 +161,7 @@ export class DebugSession extends LoggingDebugSession { request?: DebugProtocol.Request, ): Promise { try { - response.body = await this.dispather.setVariable(args); + response.body = await this.dispatcher.setVariable(args); this.sendResponse(response); } catch (error) { this.sendErrorResponse(response, { @@ -174,7 +176,7 @@ export class DebugSession extends LoggingDebugSession { args: DebugProtocol.PauseArguments, request?: DebugProtocol.Request, ): void { - this.dispather.sendComand(Continue.BREAK); + this.dispatcher.sendComand(Continue.BREAK); this.sendResponse(response); } @@ -182,7 +184,7 @@ export class DebugSession extends LoggingDebugSession { response: DebugProtocol.ContinueResponse, args: DebugProtocol.ContinueArguments, ): void { - this.dispather.sendComand(Continue.RUN); + this.dispatcher.sendComand(Continue.RUN); this.sendResponse(response); } @@ -190,7 +192,7 @@ export class DebugSession extends LoggingDebugSession { response: DebugProtocol.NextResponse, args: DebugProtocol.NextArguments, ): void { - this.dispather.sendComand(Continue.STEP_OVER); + this.dispatcher.sendComand(Continue.STEP_OVER); this.sendResponse(response); } @@ -199,7 +201,7 @@ export class DebugSession extends LoggingDebugSession { args: DebugProtocol.StepInArguments, request?: DebugProtocol.Request, ): void { - this.dispather.sendComand(Continue.STEP_INTO); + this.dispatcher.sendComand(Continue.STEP_INTO); this.sendResponse(response); } @@ -208,7 +210,7 @@ export class DebugSession extends LoggingDebugSession { args: DebugProtocol.StepOutArguments, request?: DebugProtocol.Request, ): void { - this.dispather.sendComand(Continue.STEP_OUT); + this.dispatcher.sendComand(Continue.STEP_OUT); this.sendResponse(response); } @@ -225,10 +227,10 @@ export class DebugSession extends LoggingDebugSession { ): Promise { response.body = { targets: [ - ...(await this.dispather.listVariables({ + ...(await this.dispatcher.listVariables({ variablesReference: VscodeScope.LOCAL, })), - ...(await this.dispather.listVariables({ + ...(await this.dispatcher.listVariables({ variablesReference: VscodeScope.GLOBAL, })), ].map((variable) => { @@ -249,9 +251,9 @@ export class DebugSession extends LoggingDebugSession { const exp = args.expression.split('='); let reply: string; if (exp.length == 1) { - reply = await this.dispather.getVariableByEval(args.expression); + reply = await this.dispatcher.getVariableByEval(args.expression); } else { - this.dispather.setVariable({ + this.dispatcher.setVariable({ name: exp[0], value: exp[1], variablesReference: VscodeScope.LOCAL, diff --git a/src/extension.ts b/src/extension.ts index fabf6b8b..8258a93d 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -17,7 +17,7 @@ import { CompletionProvider } from './provider/CompletionProvider'; export function activate(context: vscode.ExtensionContext) { (async () => { - Global.updateStatusBarItems('Indexing Autohotkey Workspace...'); + Global.updateStatusBarItems('Indexing AutoHotkey Workspace...'); await Detecter.buildByPath(vscode.workspace.rootPath); Global.updateStatusBarItems('Index Workspace Success!'); Global.hide(); @@ -67,7 +67,7 @@ export function activate(context: vscode.ExtensionContext) { ), ); - if (Global.getConfig(ConfigKey.enableIntelliSense)) { + if (Global.getConfig(ConfigKey.intellisense)) { context.subscriptions.push( vscode.languages.registerCompletionItemProvider( language,