Why the editor suggests those lines
How AI uses nearby code and comments to suggest a continuation as you type, and how to check that it fits the project’s SDK version and runtime constraints before keeping it.
As you type, AI code completion uses machine learning to predict what could come next. It draws on patterns and common syntax, using context such as nearby code and comments. The editor can show the proposed continuation inline, where you can accept, edit, or ignore it.
Suppose you write an S3 listing function. A nearby client declaration gives the model a variable to reuse, and a comment like return keys from every page; let access errors surface tells it what behavior to aim for. That's more useful than list objects, but it's still a clue for prediction, not proof that the suggestion works.
Check the suggestion separately. The project's installed SDK types can tell you whether a call exists in that version. An integration check under the workload's identity can tell you whether the call succeeds with the permissions the application actually has.
Next up: Sort the statements on what you just read.