Jump to content

Recommended Posts

Posted

I think I have two bugs to report. I'm currently using VS Code 1.101.0 and v1.8.4 of your extension.

  1. The extension gives an error about the With syntax found in Excel.au3 in _Excel_BookNew. The error is: Syntax error: Expected "_", [\t ], or end of line but "I" found.
  2. The extension will silently stop displaying suggestions and won't load any function documentation if you reference a file that contains function documentation that is incorrectly formatted. In my case, I was referencing my Acro.au3 file which has a split Syntax line and an empty remarks line. It requires both to stop functioning, but I haven't been able to figure out exactly what the conditions are. It looks like this:
  Reveal hidden contents

I don't always follow the "proper" documentation (due to laziness about learning it), but I don't think the extension should crash because of it :D It'd be fantastic if it reported an error, great if it displayed just the information it understood, and perfectly acceptable if it displayed nothing and waited for me to update the documentation to something valid (hahahahaha!)

Also, if anyone knows how to quickly restart extensions, I'd love to know. I spent a while testing by deleting some code, closing, and then reopening VS Code to find this bug. The "Extensions: Refresh" does nothing in the case of this not-quite-an-error. Disabling and enabling the extension via the menu is slow, but works -- as I found out later.

As always, thank you so much for your work on this extension!

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

  Reveal hidden contents
Posted (edited)

Hi @seadoggie01! :D

Thanks for the heads up! :D

  On 6/17/2025 at 3:10 PM, seadoggie01 said:

The extension gives an error about the With syntax found in Excel.au3 in _Excel_BookNew. The error is: Syntax error: Expected "_", [\t ], or end of line but "I" found.

Expand  

This is due to the incomplete parser. Currently With...EndWith blocks are not supported. Anything inside the block will fail, since i haven't added any rules to it yet. The reason is that EVERY rule needs to be copied with the small change, that ".property" is a valid syntax within that or child code blocks.
It is low priority, since With...EndWith is rarely seen used, but will be supported in the future at some point (depending on how urgent it is).

  On 6/17/2025 at 3:10 PM, seadoggie01 said:

The extension will silently stop displaying suggestions and won't load any function documentation if you reference a file that contains function documentation that is incorrectly formatted. In my case, I was referencing my Acro.au3 file which has a split Syntax line and an empty remarks line. It requires both to stop functioning, but I haven't been able to figure out exactly what the conditions are. It looks like this

Expand  

That's an interesting bug! ;) From quick testing, the issue seems to be caused by the empty line in the remarks:

; Remarks .......: Use like: _Acro_DocBookmarkProperties($oBookmark) to get an array of values
;
;                  Default means values won't be changed.

My guess is some of my code is stuck in an infinite loop... I will look into it and fix it soon, since it can deadlock the extension.
"Legacy" documentation blocks was implemented quick, since I'm trying to move towards the more cross language familiar docBlock syntax, but that still does not mean the code should fail this spectacularly😅

 

  On 6/17/2025 at 3:10 PM, seadoggie01 said:

Also, if anyone knows how to quickly restart extensions, I'd love to know. I spent a while testing by deleting some code, closing, and then reopening VS Code to find this bug. The "Extensions: Refresh" does nothing in the case of this not-quite-an-error. Disabling and enabling the extension via the menu is slow, but works -- as I found out later.

Expand  

>Developer: Reload Window
Should be your solution. It's not great, but faster than restarting the entire application 😉

 

Thank you for the kind words and the bug reporting! 😄

 

Edit:

found the line causing problems with the function documentation: https://github.com/genius257/vscode-autoit/blob/0f1bb89f8af77ee7a005d1d5a9da429e5f344700/server/src/autoit/docBlock/DocBlockFactory.ts#L84

It's my regular expression to test if the content matches the UDF documentation format. It causes catastrophic backtracking, never getting past that regex check. Prevention in JS seems to time a new worker, child-process or a regex library, from a quick google search...
I don't want to do any of that currently, so I've updated the regex, so it no longer has issues with your example, and if my test parses, I will push the change, and hope this issue does not come back 😜

Edited by genius257
Posted
  On 6/17/2025 at 9:38 PM, genius257 said:

This is due to the incomplete parser. Currently With...EndWith blocks are not supported. Anything inside the block will fail, since i haven't added any rules to it yet. The reason is that EVERY rule needs to be copied with the small change, that ".property" is a valid syntax within that or child code blocks.
It is low priority, since With...EndWith is rarely seen used, but will be supported in the future at some point (depending on how urgent it is).

Expand  

Would it instead be possible to have some sort of state such that you enable or disable the possibility of having ".Property" as valid? It seems like nested rules would be much more difficult/annoying to implement. Then again, I know very little of parsers having only ever made ~1/2 to 3/4 of one myself :)

After skimming your parser: :blink: I might look up PegJS later tonight, but I don't think that my idea will work there.

  On 6/17/2025 at 9:38 PM, genius257 said:

>Developer: Reload Window

Expand  

This. Is. Fantastic! :D

1.8.5 does fix my issue, thank you!

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

  Reveal hidden contents
Posted
  On 6/20/2025 at 1:49 PM, seadoggie01 said:

Would it instead be possible to have some sort of state such that you enable or disable the possibility of having ".Property" as valid? It seems like nested rules would be much more difficult/annoying to implement. Then again, I know very little of parsers having only ever made ~1/2 to 3/4 of one myself :)

Expand  

Sadly it does not seem like i can. A limitation of the simplicity of the parser grammar. Maybe a script could generate the grammar like that, but that would ruin the point of trying to keep a (relatively) "simple" parser solution.
And yes it will be annoying not only to implement, but also to update.

 

  On 6/20/2025 at 1:49 PM, seadoggie01 said:

After skimming your parser: :blink: I might look up PegJS later tonight, but I don't think that my idea will work there.

Expand  

The original Peg.js project is abandoned. PeggyJS is the version that is still being worked on ;)

 

Good to hear my extension is working again ;)

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