asciidoctor-vscode icon indicating copy to clipboard operation
asciidoctor-vscode copied to clipboard

lowlight parts that are not executed due to preprocessor directives

Open CWempe opened this issue 3 years ago • 1 comments

To follow up on my idea from #70, I think this feature would be really useful when working with a multi language document.

The idea is to lowlight (opposite of highlight?!) the parts that are not executed because of preprocessor directives.

I know this feature form the PlatformIO addon for my Arduino projects. It might be a C++ thing.

The result looks like this:

image

AsciiDoc example code:

:lang: "de"

ifeval::["{lang}" == "de"]
Das ist mein Text.
Das ist mein Text.
Das ist mein Text.
Das ist mein Text.
endif::[]
ifeval::["{lang}" == "en"]
This is my text.
This is my text.
This is my text.
This is my text.
endif::[]

I am aware it might be complicated to get support this feature for complex projects where a document attribute is defined in an external file that got includes. But for a first step I think this feature would be good enough with support for "local" document attributes.

Another feature that could be combined with this one is to visually link ifdef and endif. Kind of like Bracket Pair Colorizer does.

image

CWempe avatar Jun 18 '21 20:06 CWempe

I just saw Bracket Pair Colorizer (and v2) are depricated now. But I think the second part of my request might be better suited for the recommended replacements Highlight Matching Tag or blockman directly. So I created an issue for blockman.

EDIT: I also created a feature request for Highlight Matching Tag.

CWempe avatar Jun 19 '21 11:06 CWempe