Jump to content

Another AutoIt extension for Visual Studio Code


Recommended Posts

Hi @genius257,

thank you very much 👍 . I will evaluate your extension during the next days/weeks,
I guess I will have a deeper look to do a good comparison between the extension of "Damien" (which is extented and maintained by @LoganCH) and yours.

Spoiler

vscode-autoit-extensions.png

I am very excited and grateful @genius257 😊 .

Best regards
Sven

Edited by SOLVE-SMART

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Link to comment
Share on other sites

Hi @genius257,

What's your road map look like for this project? I see that you have a repo for a separate Debug Adapter. Do you anticipate maintaining these separately or eventually merging them?

If you are interested, there are some features that I've submitted to @LoganCH's project that could be included here as well.

Regards,

DanP

Link to comment
Share on other sites

Hi @SOLVE-SMART :)

15 hours ago, SOLVE-SMART said:

I will evaluate your extension during the next days/weeks,
I guess I will have a deeper look to do a good comparison between the extension of "Damien" (which is extented and maintained by @LoganCH) and yours.

Many thanks! :D This will help me a lot, for knowing what to focus on 😃

 


Hi @Danp2 :)

1 hour ago, Danp2 said:

What's your road map look like for this project?

Great question! :D I will absolutely need to document a road map soon, to better prioritize features, and help people see what's to come! :) My goal so far, have been to have the "common" features available, that most other language extensions provide, like:

  • Syntax checking
  • Function/variable declaration lookup
  • Information on hover for functions, variables, macro's, etc...
  • Basic type checking (both in function calls and with operator usage)
  • DocBlock support
  • Reference lookup
  • Proper working call signature information
  • General intellisense (undefined varaibles, unreachable code)

But the list above is only for this extension. I have MANY plans for the AutoIt3 language :)

1 hour ago, Danp2 said:

I see that you have a repo for a separate Debug Adapter. Do you anticipate maintaining these separately or eventually merging them?

Originally i intended to have the debugger in this extension, but i could not find a way to do that without removing web extension runtime support.

Reluctantly it was moved to it's own extension, to have it both ways. 😩

1 hour ago, Danp2 said:

If you are interested, there are some features that I've submitted to @LoganCH's project that could be included here as well.

I always welcome suggestions and pull requests, but looking at the pull requests opened on https://github.com/loganch/AutoIt-VSCode/ I am not sure i see many currently applying to my extension (i might just not yet know/understand some issues you might have found in my extension already :P)

 

I think i need to explicitly say that importantly this extension does not use regular expressions to parse AutoIt3. Instead a generated parser is being used, based on a grammar file in the pegjs/peggyjs language/syntax.

Whilst i agree the supported grammar syntax resembles regex a lot, it is an important difference to keep in mind :)

Link to comment
Share on other sites

2 hours ago, genius257 said:

I am not sure i see many currently applying to my extension

These are the ones I was thinking of --

https://github.com/loganch/AutoIt-VSCode/pull/73

https://github.com/loganch/AutoIt-VSCode/pull/74

https://github.com/loganch/AutoIt-VSCode/pull/85

Let me know if any of these interest you and I will refactor as needed.

Quote

i might just not yet know/understand some issues you might have found in my extension already

No problems encountered as of yet. Give it some time... 😉

Link to comment
Share on other sites

19 hours ago, Danp2 said:

This is implemented without the use of a command by the document link provider feature like so:

image.png.7f0a3f56339b736d7a48a80013682c6b.png

As you can see, hover will give you the path information and a simple ctrl+click is all that is needed for opening the file ;)

 

19 hours ago, Danp2 said:

I don't mind this feature, for people expecting to work on AutoIt3, the way they always have :)

What my extension eventually will support is a almost 1 to 1 implementation of the DocBlock in languages like JavaScript (jsdoc) and PHP (phpdoc).

But this feature is good for anyone who prefer the standard, so if you want it, it is a welcome addition :)

 

19 hours ago, Danp2 said:

This one is a no go for 2 reasons:

  1. The limitation of the web extension support prevents spawning processes from a file path, so the chm links would only be displayed in the editor as information, and a manual copy/paste would be required to find the file on disk.
  2. I'm trying to push for a better in editor code documentation experience with the not yet implemented DocBlocks and online documentation for found in the same place as the hosted code, for documentation that needs more than in code documentation can offer.

If the second reason sounds like something you consider bad or wrong, i am happy to discuss it further :D

 

19 hours ago, Danp2 said:

No problems encountered as of yet. Give it some time... 😉

Alright :D looking forward to your help, making a better product :D

 

19 hours ago, Danp2 said:

I wasn't aware of this limitation. Can you point me to where this is documented?

It's more of a problem with the webpack and typescript transpiling. It is being transpiled as a in browser script (webworker to be precise), so node enviroment modules and functions are either not available, or is poly-filled with a browser alternative implementation.

As a result, the compile command won't let me transpile without changing the target runtime enviroment to node, resulting in the code crashing when running in a web context, even if i pretended like it could via my package.json file.

A compromise some make is a extension with partial features available in web browsers, but i can't find much documentation for a working example with this and also feel like it would result in more and more features being excluded from the web extension runtime, not ideal in my opinion :sweating:

Edited by genius257
spelling mistake
Link to comment
Share on other sites

45 minutes ago, genius257 said:

This is implemented without the use of a command by the document link provider feature. As you can see, hover will give you the path information and a simple ctrl+click is all that is needed for opening the file

Nice. Is there a way to specify a "user include folder" ala SciTE Config so that the extension can locate the include files without needing to supply the full path? Perhaps this functionality is already in VSCode and I need to spend more time with it to better learn its settings.

Quote

Alright :D looking forward to your help, making a better product :D

Just opened my first issue. 😉

Quote

A compromise some make is a extension with partial features available in web browsers

Ideally, we could have a single extension that was able to identify when it was running in a browser and adjust accordingly.

Link to comment
Share on other sites

42 minutes ago, Danp2 said:

Is there a way to specify a "user include folder" ala SciTE Config so that the extension can locate the include files without needing to supply the full path?

Yes my extension does have an option you can apply in your user or workspace settings named autoit3.userDefinedLibraries

It does however not affect the registry value, that the AutoIt3 runtime uses to resolve included files from user included folders. and for 3 reasons.

  1. As always, it breaks web compatibility.
  2. It breaks the any OS supported promise.
  3. It needs some hacky nodejs specific JavaScript code to even be able to read from the windows registry (more info here)

You can see the configuration options available for my extension if you open the extension store page in vscode and look under the Feature Contributions tab:

image.thumb.png.d1e94930c48d2d799f3044936ae3c8f3.png

1 hour ago, Danp2 said:

Ideally, we could have a single extension that was able to identify when it was running in a browser and adjust accordingly.

True, but it is not something i currently am planing to pursue currently. But if it ends up being a repeat request from users, i will be forced to look into it i guess :P

Link to comment
Share on other sites

  • 1 year later...

New version 1.4.0 released with many changes! here are a few highlights:

  • Added completion suggestions for PreProc options, like: #cs and #NoTrayIcon
  • Added support for function DocBlock summary and description on hover, completion suggestions and function signature help
  • Added support for function UDF header description and remarks on hover and completion suggestions
  • Fixed issue with function signature help not tracking parameter position based on text cursor position.
  • Fixed issue with hover information for variables using the Default or Null keywords resulted in error messages.
  • Fixed some issues with variable declaration lookup within functions
  • Improved information for built-in functions on hover

Full list of changes here: https://github.com/genius257/vscode-autoit/blob/master/CHANGELOG.md#140---2024-02-28

 

As always if you find problems, please let me know, here or via an issue ;)

Link to comment
Share on other sites

Thank you very much @genius257, please keep on working on the extension.
I will use (test) the new version more and more in the next weeks to get a feeling in comparison of the extension of Damien (maintained by
@LoganCH).

Best regards
Sven

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Link to comment
Share on other sites

  • 3 months later...

First, this is awesome! I don't use AutoIt much anymore, but I appreciate being able to use VS Code as a multipurpose tool now.

I have a few suggestions and questions...

  • Can the output be colorized like in SciTE? Previously all of my debug messages were green if they started with +, red with !, and yellow with... I never used yellow.
  • Can the file links in the output jump to specific lines/characters in the file? With SciTE, you could use this: "full/path/to/file.au3" (Line, Char)
  • What do you think about folding multiple lines of single-line-comments? I like adding documentation and this is usually through multi-line comments, mimicking what UDF functions use
  • It looks like #include <Filename.au3> doesn't search like #include "Filename.au3" does. Per the help docs, both can be used, but the search order is reversed

And this is probably out of scope of this extension, but... is there any way to collapse all collapsible sections in VS Code? In VS I use Output/Collapse to Definitions all the time, but there doesn't seem to be an equivalent in VS Code

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Link to comment
Share on other sites

Posted (edited)
8 hours ago, seadoggie01 said:

First, this is awesome! I don't use AutoIt much anymore, but I appreciate being able to use VS Code as a multipurpose tool now.

Hi @seadoggie01 :) Thank you! Always happy to know i made something useful for others :D

8 hours ago, seadoggie01 said:

Can the output be colorized like in SciTE? Previously all of my debug messages were green if they started with +, red with !, and yellow with... I never used yellow.

Yes i can look into adding it as a option via the plugin settings :)

8 hours ago, seadoggie01 said:

Can the file links in the output jump to specific lines/characters in the file? With SciTE, you could use this: "full/path/to/file.au3" (Line, Char)

This should be supported in vscode, by holding ctrl and hovering/clicking file paths. VScode supports path/to/file.ext:line:char and maybe others, but it does not seem to support path/to/file (line, char) it seems.

8 hours ago, seadoggie01 said:

What do you think about folding multiple lines of single-line-comments? I like adding documentation and this is usually through multi-line comments, mimicking what UDF functions use

Most of the current folding support was unintended functionality provided by VScode out of the box, but i can look into adding collapse support for groups of single line comments :)

8 hours ago, seadoggie01 said:

It looks like #include <Filename.au3> doesn't search like #include "Filename.au3" does. Per the help docs, both can be used, but the search order is reversed

Yes it should function like the docs specify. Please report any problem with this in detail, so any bugs can be reproduced and fixed ;) If you have trouble with including files relative to include library directory, please first verify that you filled the "autoit3.installDir" setting with the AutoIt installation directory. Other registered User-defined libraries can be added via the "autoit3.userDefinedLibraries" setting

8 hours ago, seadoggie01 said:

And this is probably out of scope of this extension, but... is there any way to collapse all collapsible sections in VS Code? In VS I use Output/Collapse to Definitions all the time, but there doesn't seem to be an equivalent in VS Code

VScode provides fold and unfold commands. You can see them via F1 and typing Fold. One of the commands is "Fold All" and you can see your current key binding for triggering the command at the right side of the list item. You can change the key bindings to your preference under Preferences > Keyboard Shortcuts.

Edited by genius257
Link to comment
Share on other sites

On 6/14/2024 at 2:14 AM, genius257 said:

You can see them via F1 and typing Fold.

YES!! Thank you so much! :D (I hate the F1 menu, so of course it's hidden there!)

On 6/14/2024 at 2:14 AM, genius257 said:

Please report any problem with this in detail, so any bugs can be reproduced and fixed ;)

I think it was related to my installation; I had the installDir and userDefinedLibraries settings set, but I failed to add a trailing backslash to the UDF folder. :blink:

On 6/14/2024 at 2:14 AM, genius257 said:

path/to/file.ext:line:char

Awesome, that works perfectly.

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Link to comment
Share on other sites

  • 1 month later...
Posted (edited)

An update to the related debug extension (1.2.0 )

Colors in output based on the first character on a line, like what it does with SciTE. Partially, so this is only for single characters.

By default "!" is red, ">" is blue, "-" is orange and "+" is green.

Characters and colors can be changed via the setting "autoit3.output.colors", or disabled, if you just set it to an empty object.

 

For anyone that does not know, the extension currently only runs scripts and displays the output. Actual debugging is the goal if i ever finish a working AutoIt3 parser.

Edited by genius257
Link to comment
Share on other sites

Where do I declare where my autoit portable path is at ? what file and where ? 
Also, how do I move the extension to "C:\Utilities\VSCode-win32-x64\resources\app\extensions" where my portable VSCode is at ?

Thanks

Edited by argumentum
more

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

4 hours ago, argumentum said:

Where do I declare where my autoit portable path is at ? what file and where ? 

In vscode press F1 and type "open settings json" you can the choose user or workspace settings to open/edit. in here you can add a key "autoit3.installDir" with the value equal to your AutoIt path, for example: "C:\\Program Files (x86)\\AutoIt3". The backslashes need to be escaped with a backslash.

4 hours ago, argumentum said:

how do I move the extension to "C:\Utilities\VSCode-win32-x64\resources\app\extensions" where my portable VSCode is at ?

You can use the extensions tab in the primary side bar (default located on the left) and search for either "genius257.autoit" or "genius257.autoit3-debug", depending on your needs.
If you downloaded the vsix file manually instead, you press F1 and type "install extension from location", locate the vsix file and select it.

Link to comment
Share on other sites

Version 1.6.0 has just been released. This release adds snippets for loops, function declarations and UDF sections. Please let me know your experiences good or bad if you use it :D, Thanks

Link to comment
Share on other sites

Is it a typo that the function snippet is 'fun'? I tried typing Func and almost missed it. The snippets are very cool and I super appreciate the colorized output. You're making me sad that I mostly work in C# now

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Link to comment
Share on other sites

1 hour ago, seadoggie01 said:

Is it a typo that the function snippet is 'fun'?

No, it was based on the snippets declared in the vscode built-in extension "PHP Language Basics"

I did consider using "func" instead, but did change it right away and forgot about it as i kept working :sweating:

2 hours ago, seadoggie01 said:

I tried typing Func and almost missed it.

Based on your feedback, it is clear it could cause some to miss out on the option. I will add the change for the next release ;), thanks :)

2 hours ago, seadoggie01 said:

The snippets are very cool and I super appreciate the colorized output.

Happy to hear! :D

3 hours ago, seadoggie01 said:

You're making me sad that I mostly work in C# now

C# is a pretty great language, i think ;) But i don't think i can help make that developer experience any better :P

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...