Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Commit

Permalink
Suggest objects for paginate (#686)
Browse files Browse the repository at this point in the history
### WHY are these changes introduced?

Fixes #683 

### WHAT is this pull request doing?

Treats `paginate` in a similar way as `echo`, so that suggestions are shown.

Use cases like `{% paginate customer.orders` will be treated in #687.
  • Loading branch information
Julien Poitrin committed Dec 14, 2022
1 parent f7cf29f commit b587f7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module Constants
\s(?:
if|elsif|unless|and|or|#{Liquid::Condition.operators.keys.join("|")}
|echo
|paginate
|case|when
|cycle
|in
Expand Down
4 changes: 4 additions & 0 deletions test/language_server/variable_lookup_finder_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ def test_can_lookup_cycle_statements
assert_can_lookup_tag("cycle '', cart.error", "cart.error")
end

def test_can_lookup_paginate_statements
assert_can_lookup('{% paginate %}', '', -2)
end

def test_can_lookup_for_statements
assert_can_lookup_tag("for p in ", "")
assert_can_lookup_tag("for p in cart", "cart")
Expand Down

0 comments on commit b587f7d

Please sign in to comment.