Skip to content

Commit

Permalink
add ports to tree grepper outline jumping
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Mar 1, 2021
1 parent 08edf2a commit eb62260
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkgs/kak-tree-grepper/rc/kak-tree-grepper.kak
Expand Up @@ -18,7 +18,7 @@ define-command -override -docstring "jump somewhere in an Elm file's definition
SESSION=$6

# do the magic!
QUERY="(function_declaration_left (lower_case_identifier)@function) (type_declaration (type) (upper_case_identifier)@type) (type_alias_declaration (type) (alias) (upper_case_identifier)@alias) (union_variant (upper_case_identifier)@constructor) (field_type (lower_case_identifier)@field) (lower_pattern)@pattern (exposed_type)@exposed_type (exposed_value)@exposed_value (as_clause (as) (upper_case_identifier)@module_alias)"
QUERY="(function_declaration_left (lower_case_identifier)@function) (type_declaration (type) (upper_case_identifier)@type) (type_alias_declaration (type) (alias) (upper_case_identifier)@alias) (union_variant (upper_case_identifier)@constructor) (field_type (lower_case_identifier)@field) (lower_pattern)@pattern (exposed_type)@exposed_type (exposed_value)@exposed_value (as_clause (as) (upper_case_identifier)@module_alias) (port_annotation (port) (lower_case_identifier)@port)"

EDIT_LOCATION="$("$TREE_GREPPER" --language elm "$QUERY" "$FILE" | fzf --with-nth 4,5 --nth 2,1 --delimiter=: --query "$FZF_QUERY" --select-1 | cut -d : -f 1-3 | tr : ' ')"
printf "evaluate-commands -client %s edit %s\n" "$CLIENT" "$EDIT_LOCATION" | indiekak -p "$SESSION"
Expand Down
8 changes: 7 additions & 1 deletion sample-projects/elm/src/KitchenSink.elm
@@ -1,4 +1,4 @@
module KitchenSink exposing (..)
port module KitchenSink exposing (..)


type Id
Expand Down Expand Up @@ -30,3 +30,9 @@ deconstructions =
"nope"
in
b


port outgoingPort : Int -> Cmd msg


port incomingPort : Sub Int

0 comments on commit eb62260

Please sign in to comment.