Jump to content

Another AutoIt extension for Visual Studio Code


Recommended Posts

So another vscode extension for the AutoIt language emerges!

I've tried the existing ones, and found small problems that i felt i could improve on, but it would require an entire new approach to the inner working of the existing extensions.

Also working on a complete AutoIt3 parser a vscode extension just made sense :P

Any feedback is appreciated, and i hope this project will benefit more than just me 🤡

 

Visual Studio Code Marketplace

GitHub repo

 

Some of the current features:

  • Basic AutoIt2 syntax highlighting, for fun 🤡
  • AutoIt3 syntax highlighting
  • Variable/Function hover gives declaration information if available.
  • Goto declaration
  • #include links
  • Syntax checking, as you type
  • Function signature help
  • Function and variable list in a file via the outline tab.
  • Works on desktop (any OS) and web version

⚠️ The parser used is not yet 100% complete (see issues for know problems), and the last thing to be implemented is the With code block.

 

Hope you like 😃

Edited by genius257
Link to comment
Share on other sites

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

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...