AutoHotkey v2 Language Support, used in any editor that supports lsp
Re: vscode language server for ahk v2
For anyone following along, if you're curious about (neo)vim, here's a video backgrounder. It's not for everyone, obviously, but I'd love to get first-class AHK support into it.
Re: vscode language server for ahk v2
I have updated the issue.JoeSchmoe wrote: ↑23 Jan 2022, 11:35So what did you mean by "getDllExport currently implemented on client." Could you clarify that a bit more for us in the GitHub issue? Will it require an update to your LSP server's code? The reason I ask is that because neovim and lspconfig are linux oriented, I'd be surprised if they asked for getDllExport.
ahk2.getDllExport is used to obtain this capability.
Re: vscode language server for ahk v2
That's an awesome feature, and it makes total sense. Thanks for the great software.
When the software is updated, hopefully my Neovim skills will be a little stronger. There is also a plugin to automatically install LSP Servers. Ideally, we'd want to get your server on that list eventually, too. Lunarvim, the Neovim distribution I use, integrates all of these so that when I open a new document, and LSP server, linters, and syntax highlighting are automatically installed based on the file extension. For example, here are the options for TypeScript:
https://www.lunarvim.org/languages/typescript.html
Not bad for an open source project. With Windows Subsystem for Linux making it so easy to run Linux and Windows simultaneously on the same box, I'm imagining there will be more demand for this in the future, too.
When the software is updated, hopefully my Neovim skills will be a little stronger. There is also a plugin to automatically install LSP Servers. Ideally, we'd want to get your server on that list eventually, too. Lunarvim, the Neovim distribution I use, integrates all of these so that when I open a new document, and LSP server, linters, and syntax highlighting are automatically installed based on the file extension. For example, here are the options for TypeScript:
https://www.lunarvim.org/languages/typescript.html
Not bad for an open source project. With Windows Subsystem for Linux making it so easy to run Linux and Windows simultaneously on the same box, I'm imagining there will be more demand for this in the future, too.
Re: vscode language server for ahk v2
I tried it, very good. It helped me solve a problem (mastodontic shipwreck error a la helgef )
Thanks for sharing, cheers.
Thanks for sharing, cheers.
Re: vscode language server for ahk v2
Is there a way to run v1 on a certain workspace and v2 on another with both using the same .ahk extension?
Re: vscode language server for ahk v2
You can disable plug-ins or associate default languages in a workspace using workspace settings.
Re: vscode language server for ahk v2
ahk and ahk2
The next version(v1.7.4) will support detecting v1 scripts and automatically switching to ahk v1.
The next version(v1.7.4) will support detecting v1 scripts and automatically switching to ahk v1.
-
- Posts: 9
- Joined: 16 Feb 2023, 01:24
Re: AutoHotkey v2 Language Support, used in any editor that supports lsp
I'm using this and it is excellent! ty!
Are you aware of any way to generate the api documentation in html format from the javadoc style comments?
Are you aware of any way to generate the api documentation in html format from the javadoc style comments?
-
- Posts: 9
- Joined: 16 Feb 2023, 01:24
Re: AutoHotkey v2 Language Support, used in any editor that supports lsp
I get error...
» Unsupported source ignored: C:\AHK\test_gui\main\test_gui.ahk
Forcing to treat ahk files as js files also doesn't work...
"src": [
"./main/**/*.ahk:js"
],
Parsing 32 Javascript file(s)...
» Parsing (_def_): 32 files
Error: Output: There are no input files to process.
Any pointers?
Re: AutoHotkey v2 Language Support, used in any editor that supports lsp
This tool only works with javascript, ahk cannot be used directly. You need to convert it to a similar format. And the internal dependency library enforces files with .js suffix
Code: Select all
/** ... */
function fn(){}
Re: AutoHotkey v2 Language Support, used in any editor that supports lsp
Hi @thqby, been using this extension for a while and it's very helpful.
But, I just started getting lots of pop-up messages in vscode like:
of course, I just ignored it and carried on unthinkingly .
But then I realised that nearly all the code folding on braces "{ }" has disappeared. I know they were there yesterday 'cos I've been working through a very large script adding braces to allow code folding (amongst other things) so as to aid readability. And now hardly any of this folds .
Then I saw that 1.9.7 of your extension was release in the last day or 2. So I'm wondering if there is something in this update that is causing me a problem with code folding?
Many thanks for your help.
Edit(15-Apr-23 18:14): Sorry this might help: when I disable your extension, all the code folding at braces "{ }" comes back. Then when I re-enable your extension, the code very briefly (nano secs) shows the folding marks (> and downarrow), before then removing them.
But, I just started getting lots of pop-up messages in vscode like:
of course, I just ignored it and carried on unthinkingly .
But then I realised that nearly all the code folding on braces "{ }" has disappeared. I know they were there yesterday 'cos I've been working through a very large script adding braces to allow code folding (amongst other things) so as to aid readability. And now hardly any of this folds .
Then I saw that 1.9.7 of your extension was release in the last day or 2. So I'm wondering if there is something in this update that is causing me a problem with code folding?
Many thanks for your help.
Edit(15-Apr-23 18:14): Sorry this might help: when I disable your extension, all the code folding at braces "{ }" comes back. Then when I re-enable your extension, the code very briefly (nano secs) shows the folding marks (> and downarrow), before then removing them.
Re: AutoHotkey v2 Language Support, used in any editor that supports lsp
The information you provided is not enough for me to find out the problem.
Re: AutoHotkey v2 Language Support, used in any editor that supports lsp
Ooppss, sorry. Let me try and explain better. Consider this screenshot from my vscode screen that I made just now. Your extension is enabled. Notice that there are no code folding marks in the left hand column and there is a warning message as shown.
Until a few days ago with your extension enabled I had both code folding and no such warning messages. The screenshot below was taken just now but with your extension disabled. It shows full code folding marks in the left hand column.
Is it possible that your extension update to 1.9.7 has caused this change of behaviour, or possibly I'm doing something wrong. Do you have any advice?
Many thanks and best regards.
Re: AutoHotkey v2 Language Support, used in any editor that supports lsp
The above code alone should not cause any problems, but as this is v1 code, the extension may have different processing methods, resulting in different results.
1.Stop parsing - does not provide most features
2.Continue - Error reported at error point
3.Skipping this line - may not necessarily recognize a line correctly and may result in unexpected results
4.Switch to v1 extension
Therefore, the recommended approach is to install extensions for v1 and v2 separately, set the .ahk default association to ahk2(should be the default behavior), and set the v2 extension to switch to the v1 extension when v1 code is detected.
V2 extension also has commands to switch between v1/v2, which can be bound with hotkeys for use.
1.Stop parsing - does not provide most features
2.Continue - Error reported at error point
3.Skipping this line - may not necessarily recognize a line correctly and may result in unexpected results
4.Switch to v1 extension
Therefore, the recommended approach is to install extensions for v1 and v2 separately, set the .ahk default association to ahk2(should be the default behavior), and set the v2 extension to switch to the v1 extension when v1 code is detected.
V2 extension also has commands to switch between v1/v2, which can be bound with hotkeys for use.
Re: AutoHotkey v2 Language Support, used in any editor that supports lsp
Hi @thqby,
Thx so much for getting back.
I was using your v2 extension already alongside a v1 extension. But had managed to set them up so that your 'code folding with zero indents between "{}"' would work in v1 as well as v2.
I've just changed the v1 extension I was using, to a more popular one. It gives me much 'safer' control over running and debugging, but does not allow zero-indented code within "{}" to fold.
I use alot of "{}" to group together various sections of code. This is only for visual convenience, nothing that affects the working of the script. But I can get code folding back between "{}" if I indent the code between the braces. So I'll change my formatting style to adopt this new approach.
Many thanks for taking the time to help.
Thx so much for getting back.
I was using your v2 extension already alongside a v1 extension. But had managed to set them up so that your 'code folding with zero indents between "{}"' would work in v1 as well as v2.
I've just changed the v1 extension I was using, to a more popular one. It gives me much 'safer' control over running and debugging, but does not allow zero-indented code within "{}" to fold.
I use alot of "{}" to group together various sections of code. This is only for visual convenience, nothing that affects the working of the script. But I can get code folding back between "{}" if I indent the code between the braces. So I'll change my formatting style to adopt this new approach.
Many thanks for taking the time to help.
Re: vscode language server for ahk v2
If launch.json is abandoned, then how to suppress this debugger output ?
PS. When I use launch.json I no more needs F5 keybinding installed by extension - I just disable it, then the Code themselves suppress output shown above.
Please post your script code inside [code] ... [/code] block. Thank you.
Re: AutoHotkey v2 Language Support, used in any editor that supports lsp
Failed to load the picture. If you need custom functions, of course you need launch.json.