Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use Addition/DeletionInjection (and maybe "After" injections) with a language #100

Closed
Kocal opened this issue Apr 14, 2024 · 3 comments

Comments

@Kocal
Copy link

Kocal commented Apr 14, 2024

Hi,

I'm now trying addition and deletion injections but they don't work for the following code:

```yaml
on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]
{+ pull_request_target: +}
{+   types: [opened, synchronize, reopened, ready_for_review] +}

`

It's rendered like this, and this is not something expected:
image

You can see the $content received by AdditionInjection is already highlighted, and it makes sense since this injection is executed after (#[After]), but the regex (\{\+)((.|\n)*?)(\+}) can not work anymore:
image

What about moving those injections from after to before? It won't be perfect (you can see the line 5 is missing the green background behind its number), but that far better than nothing :)
image

WDYT?

@brendt
Copy link
Member

brendt commented Apr 15, 2024

I'm getting this fixed in v2. Still need to look at the weird gutter rendering, but it'll work even for After inections

@brendt
Copy link
Member

brendt commented Apr 15, 2024

Fixed in v2: #93

I plan on release it somewhere this week

@brendt brendt closed this as completed Apr 15, 2024
@Kocal
Copy link
Author

Kocal commented Apr 15, 2024

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants