loganch / AutoIt-VSCode

AutoIt Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=Damien.autoit
MIT License
74 stars 25 forks source link

More refined syntax check w/ #AutoIt3Wrapper_AU3Check_Parameters #216

Closed vanowm closed 2 months ago

vanowm commented 5 months ago

same as #215 but with ability overwrite settings via #AutoIt3Wrapper_AU3Check_Parameters

loganch commented 5 months ago

Messed with it a little bit and I think there's a small issue that the flags actually include a space, e.g., the flag to enable local var used in global scope is "-w 4", so the comma separation in the initial variable and the regex/logic to parse from the script need to be adjusted.

vanowm commented 5 months ago

I don't believe I understand you...which variable and regex you are referring to?

Sven-Seyfert commented 4 months ago

Hi @loganch, hi @vanowm 👋 .

I don't believe I understand you...which variable and regex you are referring to?

I guess line 48 is meant by Logan. But I also don't see the problem.

The RegEx pattern (-w-?)\s+([0-9]+) matches the following variants, as far as I can say and understood:

As image (visualization)

grafik

As text form

;~ ----
;~ Okay
;~ ----
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7

#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w    3 -w 4 -w 5 -w 6 -w 7

#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w- 3 -w 4 -w 5 -w 6 -w 7

#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w-   3 -w 4 -w 5 -w 6 -w 7

;~ --------
;~ Not okay
;~ --------
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w3 -w 4 -w 5 -w 6 -w 7

#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w-3 -w 4 -w 5 -w 6 -w 7

#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 w 3 -w 4 -w 5 -w 6 -w 7

#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 w- 3 -w 4 -w 5 -w 6 -w 7

My manual tests for this PR were successful 😀 . But I hope I do not miss something 🤔 ?

Best regards Sven

loganch commented 2 months ago

No, I was mistaken, merging it now.