codefori / vscode-rpgle

RPGLE language tools for VS Code
MIT License
39 stars 20 forks source link

Content Assist sometimes not Picking up local workfields #294

Open Wikus86 opened 8 months ago

Wikus86 commented 8 months ago

Here is an exmaple of it not picking up the local workfield.

image

Another thing i noticed, linter picks up that it has not been references

image

worksofliam commented 8 months ago

@Wikus86 I have tried recreating this with no luck.

Are you able to paste your code (not take a screenshot of it) so I can copy and paste it directly?

image image

Thanks, Liam

Wikus86 commented 8 months ago

Yeah, I can also not reproduce it, only happens in some programs. Let me try doing a debug on the program giving the issue. Will advise if I find something

Wikus86 commented 8 months ago

I found something, looks like it gets confused with a procedure in my copybook.

This is an example of the code

image

in completionItem.ts, in the completionItemProvider function, it picks up i am on line 318 which is almost correct, actually on line 319

Screenshot 2024-01-30 112042

Then it tries to find the procedure based on the line number

image

The problem is, in my copy book I have a procedure in that line range

Screenshot 2024-01-30 111944

and the index is before the actual procedure I am in

Screenshot 2024-01-30 112015

I hope this makes a bit of sense :)

EVLSDE commented 1 month ago

The problem is, in my copy book I have a procedure in that line range

I just stumbled over this sentence. Could it be I accidentally posted a duplicate issue in #323? If yes then I'm sorry! The code in pull request #324 worked it out for me.