Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No suggestion of built in variables without %% in include directive #108

Closed
RaptorX opened this issue Jun 29, 2022 · 4 comments
Closed

No suggestion of built in variables without %% in include directive #108

RaptorX opened this issue Jun 29, 2022 · 4 comments

Comments

@RaptorX
Copy link
Contributor

RaptorX commented Jun 29, 2022

Issue Type: Bug

Steps

  • Use the #include directive
  • Start typing a supported built in A_Variable

Expected

Suggestions should show up as percent signs are optional

image

Result

No suggestions are shown

image

Notes

After typing some variables errors are resolved (when the path exists)

image

Suggestions

One of the issues is that the lexer tries to validates paths and while they are not valid the lexer enters in to an error state and nothing else seems to work.

Probably the lexer should validate the path after a new line when the path is completed.
In the meantime suggestions should work as expected because according to the documentation:

Built-in variables may be used by enclosing them in percent signs (for example, #Include "%A_ScriptDir%"). Percent signs which are not part of a valid variable reference are interpreted literally. All built-in variables are valid, except for A_Args and built-in classes.

And as shown in the previous example the percent signs seem to be optional. I get no errors when not using the percent signs on variables while doing an include.

Extension version: 1.3.6
VS Code version: Code 1.68.1 (30d9c6cd9483b2cc586687151bcbcd635f373630, 2022-06-14T12:48:58.283Z)
OS version: Windows_NT x64 10.0.19044
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i5-4460 CPU @ 3.20GHz (4 x 3198)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.91GB (21.36GB free)
Process Argv D:\Cloud\RaptorX\OneDrive\Documents\AutoHotkey\lib\SQLite --crash-reporter-id 1eed22db-bc5c-446b-a877-f742be520d0c
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonvspyt551cf:30345471
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
vscscmwlcmt:30465135
cppdebug:30492333
vsclangdc:30486549

@thqby
Copy link
Owner

thqby commented Jun 29, 2022

And as shown in the previous example the percent signs seem to be optional. I get no errors when not using the percent signs on variables while doing an include.

This is not optional, .\XXXX\..\ is always equal to .\.

@RaptorX
Copy link
Contributor Author

RaptorX commented Jun 29, 2022

And as shown in the previous example the percent signs seem to be optional. I get no errors when not using the percent signs on variables while doing an include.

What I meant is that the autohotkey interpreter does not see A_LineFile\..\ as an error. So it should be suggested

thqby added a commit that referenced this issue Jun 30, 2022
@thqby
Copy link
Owner

thqby commented Jun 30, 2022

It's just that the wrong usage just doesn't cause an error in this case. Replacing A_LineFile with any \w+ string is the same, and this line is redundant

@thqby thqby closed this as completed Jul 1, 2022
@RaptorX
Copy link
Contributor Author

RaptorX commented Jul 1, 2022

It's just that the wrong usage just doesn't cause an error in this case. Replacing A_LineFile with any \w+ string is the same, and this line is redundant

Correct. I agree with that.

So in the meantime (until that changes) the lexer should be a bit laxed with that usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants