Closed samfisherirl closed 1 year ago
update: I've tested on a new install, it appears some setting is conflicting. Unsure what it is,
https://github.com/thqby/vscode-autohotkey2-lsp#codeformat
set editor.formatOnType
and brace_style
property of AutoHotkey2.FormatOptions
.
Try adding editor.autoIndent
to your settings.
These are some of my ahk2 settings:
"[ahk2]":
{
// Aligns cursor with if statment when enter is pressed
"editor.autoIndent": "brackets",
// Always search/replace in a selection if one is made
"editor.find.autoFindInSelection": "always",
// Prevents closing brace while in strings (usually)
"editor.autoClosingBrackets": "beforeWhitespace",
// Prevents second quotation mark while in strings (usually)
"editor.autoClosingQuotes": "beforeWhitespace"
},
editor.autoIndent
only takes effect on indentationRules
defined in the ahk2.configuration.json
file, but there are limitations.
Assuming you have the auto-closing Bracket enabled (and the cursor is in between them after entering {, i.e. {|}, try using Shift-Enter to split the line. It should move your cursor down and indent it with the bracket on the third line. If not, it may be some other setting.
Unsure all of the potential variable for indent to have issues.
No other extensions for ahk, only ahkv2lsp
I have enabled Editor onEdit formatting support.
Situation: When I write a function
myfunction()
I add the open Bracket{
and press ENTER. The moment I press enter is where the issue occurs. All examples below will share where my CURSOR ends up, and how the page formats.In a nut shell: I cant get the cursor and brackets to end where we all generally expect them to.
ideal
broken formatting
Right now Im getting this:
when I add editorFormat settings it indents but doesnt linebreak after bracket
all cases require at least a few steps to return back to coding and arent a click away. makes me want to pull my hair out but its likely my fault. Here are my custom settings in vscode incase needed.
settings
ALL settings here with the name "bracket" or "indent" in the EXTENSION name have been REMOVED