UPDATE suggested after FOR UPDATE in SOQL Query builder

Issue #2255 resolved
René Görgens created an issue

Hi Scott,

I’m taking a look at SOQL Query builder after the recent fixes.

In the following query, when I position the cursor after FOR UPDATE and hit Ctrl+Shift, then I get the suggestion UPDATE | TRACKING | VIEWSTAT. This doesn't happen with FOR VIEW or FOR REFERENCE. When trying to force suggestions for those, “No suggestions” pops up.

SELECT Id, Subject
FROM Task
ORDER BY CreatedDate DESC
LIMIT 5
FOR UPDATE 

The rest all checks out.

Comments (4)

  1. Scott Wells repo owner

    This one is a little tricky because the following is valid:

    SELECT Id
    FROM Account
    FOR UPDATE
    UPDATE [TRACKING|VIEWSTAT]
    

    Yes, technically TRACKING and VIEWSTAT should not be offered after the UPDATE in a FOR UPDATE clause, but it’s completely valid for you to write one clause after another that’s not yet complete, hence why those are offered.

  2. Scott Wells repo owner

    This is working as designed if not necessarily as expected. It ultimately comes down to how completion must work in a situation where there might be incomplete/invalid statements/clauses/etc. preceding the current one and the fact that the same keyword can end one clause and begin a clause that's valid immediately after it.

  3. René Görgens reporter

    Ah I see, thanks for the clarification. I hadn’t explored the UPDATE [TRACKING|VIEWSTAT] clause yet.

  4. Log in to comment