Skip to content
Discussion options

You must be logged in to vote

I am afraid, this is a too complicated use case for built-in t because it uses Lua patterns. Account for a Select<string> as a tag name is very not trivial with the Lua pattern surrounding specification (because it needs to "know" that > after string does not close the tag).

As always the case with tag surrounding and textobject, the suggestion is to use tree-sitter to define them. This might or might not require writing custom tree-sitter queries, which is not trivial.

Now if I put the cursor before the <Item key="1" />, on that line, and type srt, i would like for surround to realize I'm talking about the Select tag. Ideally it would then allow me to replace the whole Select<string> of…

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
7 replies
@emmanueltouzery
Comment options

@emmanueltouzery
Comment options

@emmanueltouzery
Comment options

@echasnovski
Comment options

@emmanueltouzery
Comment options

Answer selected by echasnovski
Comment options

You must be logged in to vote
2 replies
@emmanueltouzery
Comment options

@echasnovski
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested mini.surround wiki Solution is present (or should be present) in wiki
3 participants