Jump to content

Recommended Posts

Posted

Hi, thanks for your great work. I tried to find something to use VS Code, as I am used to it.

For some reason, Damien's extension is highlighting a lot of my code due to unreachable functions, since I'm developing in multiples files at once and calling functions outside their files. As I couldn't find a fix, I tried yours.

 

I have to say that it fills all my needs. Lack of debug console was a problem for me ; I fixed it by making a task in my tasks.json that runs Au3Check.exe, and a custom launch.json that runs the task and the script. It works like a charm ! I can even ctrl+click on the error in debug console to get on it.

 

The only trouble I'm struggling to fix is I cannot manage to print special chars in my debug console. My files all are encoded in UTF-8, I've searched in extension settings, tried few parameters in settings.json,... Here's what kind of thing I get :

D�marrage de l'application

Also, is there any quick way to access to the doc while hovering a function ? just like Damien's extension by pressing ctrl+f1 or SciTE by pressing F1 ?
I tried some shortcuts but didn't manage to get it working.

 

Thanks again for your work @genius257 !

May the force be with you.

Open AutoIt Documentation within VS Code

Posted

Hi @ValentinM :D

Many thanks for your kind words and feedback! :)

10 hours ago, ValentinM said:

For some reason, Damien's extension is highlighting a lot of my code due to unreachable functions, since I'm developing in multiples files at once and calling functions outside their files. As I couldn't find a fix, I tried yours.

I have not implemented code for warning against undefined variables or functions yet, so it might become an issue later on, but I'll try to keep in mind adding a way to disable it ;)

10 hours ago, ValentinM said:

Lack of debug console was a problem for me

I provide console support via another extension Name: AutoIt3 Debug

10 hours ago, ValentinM said:

The only trouble I'm struggling to fix is I cannot manage to print special chars in my debug console. My files all are encoded in UTF-8, I've searched in extension settings, tried few parameters in settings.json,... Here's what kind of thing I get :

D�marrage de l'application

My extension currently also have the same issue, but i think i just fixed it, and will release an update today or tomorrow :)

10 hours ago, ValentinM said:

Also, is there any quick way to access to the doc while hovering a function ? just like Damien's extension by pressing ctrl+f1 or SciTE by pressing F1 ?
I tried some shortcuts but didn't manage to get it working.

No i currently do not have added a feature to access AutoIt3 documentation. I do plan to add links for the online version, for native/built-in functions, but have not finished my doc parser support for tags containing the links.

Posted (edited)

Hi genius257,

Thanks for your fast reply !

8 hours ago, genius257 said:

I have not implemented code for warning against undefined variables or functions yet, so it might become an issue later on, but I'll try to keep in mind adding a way to disable it ;)

I don't know much about VS Code Extension, would it be hard (or even possible) to detect variables in other files, especially those who are included (#include) ?

8 hours ago, genius257 said:

I provide console support via another extension Name: AutoIt3 Debug

I did a lot of things yesterday, so I don't remember exactly what was the problem I experienced, but I had an issue with it. I'll try it again by the end of the week.

8 hours ago, genius257 said:

My extension currently also have the same issue, but i think i just fixed it, and will release an update today or tomorrow :)

I'm very happy to read this ! It will be so useful.

8 hours ago, genius257 said:

No i currently do not have added a feature to access AutoIt3 documentation. I do plan to add links for the online version, for native/built-in functions, but have not finished my doc parser support for tags containing the links.

I found an alternative way by installing AutoIt VS Code Extension by crstein, and disable all extension's shortcuts in settings to avoid conflicts with yours, except the one who's opening the doc. The only inconvenience is I need to select the entire function and then press Ctrl+F1, instead of just having my cursor anywhere on the function.

Edited by ValentinM

May the force be with you.

Open AutoIt Documentation within VS Code

Posted
3 hours ago, ValentinM said:

I don't know much about VS Code Extension, would it be hard (or even possible) to detect variables in other files, especially those who are included (#include) ?

If the current file contains the include statement, and there are no syntax errors detected, then variable and function definitions will be detected. Currently you can ctrl+click or goto definition via right click context menu for variables and functions, if included like previously mentioned.

Currently i have not made a good implementation for fast lookup, so when my code currently finds the definition it looks through each syntax tree for each relevant file, until the match is found. The issue is not making the lookup part itself, the hard part for me is finding a good way to be able to update the lookup data when files change, without parsing everything from scratch every time.

3 hours ago, ValentinM said:

I did a lot of things yesterday, so I don't remember exactly what was the problem I experienced, but I had an issue with it. I'll try it again by the end of the week.

If you still experience issues, let me know, it might be something that i can fix quickly and give everyone a better experience and setup flow :)

3 hours ago, ValentinM said:

I found an alternative way by installing AutoIt VS Code Extension by crstein, and disable all extension's shortcuts in settings to avoid conflicts with yours, except the one who's opening the doc. The only inconvenience is I need to select the entire function and then press Ctrl+F1, instead of just having my cursor anywhere on the function.

Very cool you found a solution that works for you :D

  • 4 weeks later...
Posted

Version 1.6.1 has just been released!

  • The function snippet, now uses "func" instead of "fun" for the string prefix.
  • Variables declared via for loops are now recognized by the extension.
  • include statements that fail to resolve, should no longer have links added to them.

Sorry for the slow release. Personal things, combined with my vscode and docker that keeps crashing due to running out of memory, have delayed this release by at least a month. 😕 

Anyway, i am currently looking into:

  • adding errors for things like include statements that fail to resolve.
  • improving the function signature helper (currently it disappears if the parser fails on that line, like when adding a comma within the parentheses, but there is nothing between the comma and the closing parenthesis)
  • adding setting for omitting included functions and variables with the "__" prefix from the completion suggestions.
  • 1 month later...
Posted (edited)

Version 1.7.0 has just been released!

Notable changes:

  • Peek/Goto build-in function declarations now works (will open my mock included file)
  • Include statements that fail to resolve will now be indicated with an error on that line
  • Absolute paths for include statements now resolves
  • New setting (autoit3.ignoreInternalInIncludes). When set to true, internal declarations (vars and funcs) within includes, will be ignored from completion suggestions

I have not picked my goals for 1.8 yet, so please let me know here or on GitHub, if you have any wishes.


The extension got it's first review on the visualstudio marketplace! So many thanks to Valentin for the glowing review! :D

And a personal achivement of making my repository auto publish to the visualstudio marketplace and Open VSX, whenever i create a new release! :D

Edited by genius257
  • 1 month later...
Posted (edited)

Hi all,

I just wanted to write about the current WIP release and future extension plans.

For the 1.8 release:

For anyone interested in the new DocBlock format, I've implemented support for @link tags, both as a stand alone tag and inline tag.

I also plan to implement syntax highlighting for both DockBlock format and the legacy UDF format.

I've been busy working on issues with the parser and auto-generated typescript types. This is, and my AutoIt3 parser in AutoIt3 project are the reason for the slow release of 1.8. When i resolve the last issues with type generation, i will finish and release 1.8! 🙂

For future releases:

The function signature helper for parameters in functions is currently too flaky for me, and i will spend time to try and improve the experience.

I will look into partial code AST object updates with the parser. I am not 100% sure how well i will be able to implement it, but i hope to improve performance when working in big script files.

I want to add a static typing to functions and variables. Type hinting or casting will be supported via a new comment syntax. Built-in functions and variables will be supported right away, when typing resolution is released. This should help with general development and allow warnings with for example, when doing implicit variable type casting via operators.

I also want to implement a formatter/linter. For now, the plan is to add it to this extension, but may end up being it's own thing, depending on configuration complexity and performance overhead.

Also, completion suggestions for DllStruct object members. DllStruct's (and maybe some COM objects) will be analyzed and allow completion suggestions and errors for use of non existing members. This MAY also include Map and Array objects, but it is unclear how easy it will be to infer size and members of those.

And finally for now, syntax highlighting and attempted analysis of strings given to Eval, Execute and Assign.

 

I cannot guarantee all will be implemented. Most will be exploratory implementations when the time comes, but hopefully it will result in the best editor experience i can offer! :D

Edited by genius257
Posted

Version 1.8.2 has just been released!

I should have been 1.8.0, but issues with deployment pipeline after bigger changes to how the parser code and types are generated (internally) meant that i had to increment patch version 2 times, to successfully be able to release to the extension marketplaces.

Notable changes:

  • Added au3 DocBlock `@link` tag support
  • Added syntax highlighting for au3 DocBlock and legacy UDF headers

2 things i would like feedback on, if possible:

  1. About the new syntax highlighting: Let me know if and/or how you like or dislike it.
  2. Performance: small changes to how the parser worked with some parser rules, to better generate types. Smaller tests indicated it was same or faster, but it can very much depend how it traverses through the code. Let me know if you notice any slow down, so I can look into fixing it ASAP! ;)

Feedback can be here, via an issue or via the discussion for the release.

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
×
×
  • Create New...