codefori / vscode-rpgle

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

Content assist issues (punctuation characters) #285

Open Wikus86 opened 9 months ago

Wikus86 commented 9 months ago

Not sure if this is know, but I am experiencing two issues with content assist

  1. If you declare a procedure starting with '#', it seems to break the code completion.

Example

dcl-proc #testProc;
  dcl-pi *n ind;
    param char(30) const;
  end-pi;
end-proc;
  1. If you have a qualified ds that is an array, it seems to only pick up the reference to where the array is defined

Example

dcl-ds t_template template qualified;
  elem likeds(t_array) dim(10);
end-ds;

dcl-ds t_array template qualified;
  elem1 char(10);
  elem2 char(3);
  elem3 char(1);
end-ds;

dcl-ds ds_template likeds(t_template);

ds_template.elem(1)
worksofliam commented 9 months ago

@Wikus86

it seems to break the code completion.

What does this mean?

Wikus86 commented 9 months ago

@Wikus86

it seems to break the code completion.

What does this mean?

Hi @worksofliam ,

So break probably not the correct words :).

So first thing i noticed is that when you hover over the proc and it it starts wih a '#' it does not pop up as below

image

and here is example with proc without the #

image

Then also, when hit "ctrl + space" it shows the proc in the list

image

but when you start typing '#t', it goes missing

image

Hope this clarifies it a bit.

worksofliam commented 9 months ago

Note to self: there is a VS Code to add these characters to be treated as possible symbol characters in the VS Code API.

worksofliam commented 9 months ago

Made an issue here: https://github.com/barrettotte/vscode-ibmi-languages/issues/136

chrjorgensen commented 8 months ago

@Wikus86

IMHO it's not a good practice to use the special characters #, @ and $ in variable and procedure names - actually, any name at all - due to the characters not being consistent across CCSID's.

For additional information, read this article by Bob Cozzi...

Wikus86 commented 8 months ago

@worksofliam ,

I am happy with that. I will just remove it from my procedures.

Btw, the issue I raised about the qualified data structure with an array, is not exactly accurate. Seems like if you have a qualified DS in a qualified DS, it only picks up until the second level. ie ds_example.field

Also picked up another small issue. Only on some of my internal procedures, if I declare a local work field, content assist does not pick up the work field, but in other internal proc's it works. I tried looking for a pattern why this will happen, but no luck as yet. Should I open a separate issue for this?

Otherwise the work you guys are doing is freaking awesome. Really enjoying using vs code these days.

worksofliam commented 8 months ago

@Wikus86 no separate issue required, but if you could provide more examples I can test with that'd be great.

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 Sorry to be a pain. Would you actually put that into a new issue for me? :)

Wikus86 commented 8 months ago

@Wikus86 Sorry to be a pain. Would you actually put that into a new issue for me? :)

No worries, will do