ZIm/crates/languages/src/tsx/overrides.scm
Smit Barmase b88ba44b32
editor: Fix function completion expansion in string contexts and call expressions (#30351)
Closes #27582

Now, when accepting function completion, it doesn't expand with
parentheses and arguments in the following cases:
1. If it's in a string (like `type Foo = MyClass["sayHello"]` instead of
`type Foo = MyClass["sayHello(name)"]`)
2. If it's in a call expression (like `useRef<HTMLDivElement>(null)`
over `useRef(initialValue)<HTMLDivElement>(null)`)

This is a follow-up to https://github.com/zed-industries/zed/pull/30312,
more like cleaner version of it.

Release Notes:

- Fixed an issue where accepting a method as an object string in
JavaScript would incorrectly expand. E.g. `MyClass["sayHello(name)"]`
instead of `MyClass["sayHello"]`.
2025-05-09 14:52:52 +05:30

17 lines
254 B
Scheme

(comment) @comment.inclusive
[
(string)
(template_string)
] @string
(jsx_element) @element
[
(jsx_opening_element)
(jsx_closing_element)
(jsx_self_closing_element)
(jsx_expression)
] @default
(_ value: (call_expression) @call_expression)