question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Automatically try to remove scopes as if they're token, line, block, file if they have no removal behaviour

See original GitHub issue

I tried “pour element”, and found it quite bothersome that it tried to insert a space instead of making a new line, like the old behaviour. I would argue that we should detect if something stops at a line boundary and use newline delimiter if so.

Implementation

Where

Let’s start by putting it on SyntacticScopeTarget

What

If target has leading or trailing range, we use today’s behaviour.

Otherwise, we see if the “core removal range” corresponds to the entire file, then falling back to block, then line, then token. If it corresponds to one of these, we forward calls to removalRange to the upgraded target

The core removal range will be the value passed in to removalRange in constructor, otherwise content range.

Other thoughts

Alternately we could add this implementation to BaseTarget, so that things like SyntacticScopeTarget will get it, but not get LineTarget, TokenTarget, UntypedTarget (?) will override it, but let’s start with SyntacticScopeTarget for now

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
AndreasArvidssoncommented, Jul 19, 2022

Agreed. We should definitely have a proper look at an alternative solution. But just for now I think we should just add them to the delimiter list.

0reactions
pokeycommented, Jul 19, 2022

Yeah maybe for now let’s just add them to that switch statement, but I do worry it’s going to start feeling like a game of whack-a-mole

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitLab CI/CD job token
Control the job token access scope with an allowlist of other projects authorized to be accessed by authenticating with the current project's job...
Read more >
Address false positives/negatives in Microsoft Defender for ...
Learn how to handle false positives or false negatives in Microsoft Defender for Endpoint.
Read more >
Configuring code scanning - GitHub Docs
You can configure how GitHub scans the code in your project for vulnerabilities and errors.
Read more >
Using API tokens | Fastly Help Guides
Click the Delete button to permanently delete the token. Legacy API credentials. If you created a Fastly account before May 15th, 2017, you...
Read more >
Configure Hosting behavior | Firebase Hosting - Google
You can serve a custom 404 Not Found error when a user tries to access a page that doesn't exist. Create a new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found