Skip to content
This repository was archived by the owner on Dec 8, 2024. It is now read-only.

TypeScript issue #225

Open
rogierschouten opened this issue Jul 24, 2014 · 1 comment
Open

TypeScript issue #225

rogierschouten opened this issue Jul 24, 2014 · 1 comment

Comments

@rogierschouten
Copy link

We use TypeScript which is compiled to JavaScript. Unfortunately, the typescript compiler removes any 'floating' comments, even with all comment-preservation compiler options on.
Unfortunately, the /* istanbul ignore next */ comment often occurs 'floating', e.g. above a case statement.

Of course this issue should really be fixed in TypeScript but that is simply not happening. Therefore, would it be an idea to introduce a /* istanbul ignore block */ comment that I can insert e.g. INSIDE a case statement so that it is not floating?

If it does not require too much refactoring I'd be happy to take a few hints from you and implement this myself.

switch (boo) {
  case 1: {
     flep();
  } break;
  case 2: {
    /* istanbul ignore block Ignore this entire case */
    baz();
  } break;
}
@gotwarlost
Copy link
Owner

I believe I wanted to do something like this in my original implementation but gave up because of performance reasons. In particular, figuring out whether the comment occurs just after the block starts might be tricky.

Need to look at the code again. It's been awhile since I made changes to the instrumenter.

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

No branches or pull requests

2 participants