Jump to content

Another AutoIt extension for Visual Studio Code


Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 4 weeks later...

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