Intellisense doesn't seem to recognize prototypes in copy books #1476
-
In the attached video, I tried to demonstrate a simple copybook where I have a prototype. Then I try to get intellisense to suggest that prototype for me. This works in RDi (as demonstrated in the video), however, I cannot seem to get it to work in Code for i. Am I missing an important setting or something? On occasion (haven't been able to put my finger on it), code for i will suggest a procedure for me and I press enter - meaning to go to the next line, but instead it adds some procedure I don't want and it adds the prototype to my source. This will cause a compiler error since the prototype is now in my source twice; once that was auto inserted and once in the copybook. Is there a way to turn off the auto insert of the prototype? I've also attached my code example. Thanks in advance, https://github.com/halcyon-tech/vscode-ibmi/assets/132368707/22d7fbd9-1c16-489d-8fbe-493050111cbb |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
So as of today, copybooks will only be picked up if it's the same library as the source you're editing. We have a PR to add library list support but it has not yet been merged. You are welcome to try it. You can determine if the copybook has been resolved or not by hovering your mouse over the copy or include statement, and the hover text will tell you where it has been found or not.
VS Code will show auto-imports in the content assist, which automatically defines the prototype and adds the call to it if the prototype has not been defined before - this sounds like what you were experiencing. There is no way to turn them off, but you can escape the content assist with Escape to resume editing. |
Beta Was this translation helpful? Give feedback.
Looking forward to the added library list support for copy books!
In my video example, the copybook is not only in my library (which is my current library), but it's also in the same source physical file.
It seems like, to me at least, that auto inserting a prototype that's already defined in the copybook is a waste. Or at least, I'm not understanding why/when doing so would be a good thing.