-
-
Notifications
You must be signed in to change notification settings - Fork 324
Closed
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
Please read the FAQ for the bug you encountered.
- I have read the existing FAQ
⏯ Playground Link
💻 Code
Using expandStart and / or expandEnd causes the quick fix to no longer be shown in my JetBrains IDE (that I integrated with ast-grep using LSP via the LSP4IJ plugin for JetBrains IDEs).
Code to test (also see Playground)
type MyType<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Arg = any,
> = { arg: Arg };ast-grep YAML rule:
# yaml-language-server: $schema=https://raw.githubusercontent.com/ast-grep/ast-grep/main/schemas/rule.json
# A single rule definition that will be applied to both Java and Kotlin files.
id: rewrite-lsp-inline-eslint-disable
language: tsx
severity: hint
rule:
kind: type_parameter
pattern: $FOLLOWING_WITH_POSSIBLE_TRAILING_COMMA
follows:
kind: comment
regex: ^//\s*eslint-disable-next-line\s+[@\w]
pattern: $ORIGINAL_COMMENT
transform:
MODIFIED_COMMENT:
replace:
source: $ORIGINAL_COMMENT
replace: ^//\s*eslint-disable-next-line\s+(?<DISABLED_ESLINT_RULES>[@\w].*)$
by: '// eslint-disable-line $DISABLED_ESLINT_RULES'
fix:
# fix only works in the Playground and CLI,
# but using LSP no quickfix is known unless I comment out `expandStart` and `expandEnd`
- title: change into `// eslint-disable-line` comment
template: |-
$FOLLOWING_WITH_POSSIBLE_TRAILING_COMMA, $MODIFIED_COMMENT
expandStart: { kind: comment }
expandEnd: { regex: ',' }🙁 Actual behavior
No quick fix is shown in my IDE
🙂 Expected behavior
A quick fix is shown in my IDE
Additional information about the issue
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request