better-cpp-syntax icon indicating copy to clipboard operation
better-cpp-syntax copied to clipboard

objc and obj-cpp highlighting failed when used as embedded grammar in markdown

Open Zaxzeng opened this issue 3 years ago • 1 comments

Grammar files for objective-c (and -cpp) could not properly work while been used as an embedded grammar, for example, a code block in a markdown file.

The code with a problem is:

Open vs-code, create an empty markdown file, insert following code block of objective-c:

    In a markdown file:
    ```objc
    //highlight ok
    first = [[Cat alloc] initWithAge:12]
    
    //highlight failed
    second = [[Cat alloc] initWithAge:13]
    ```

It looks like:

lookslike

It should look like:

shouldbe

More comments

Seems those grammar files should replace all uses of "$base" as "$self".

I'm not expert in text-mate nor vs-code, Afraid these changes may bring unexpected effect on other related parts or features. Just report this and wishing anyone who is more familiar with these tech could give a fix.

Zaxzeng avatar Dec 24 '21 04:12 Zaxzeng

Hmm this is a strange reoccurring issue. I wonder if something was undone.

You're right it's related to $base and $self, and there can be some nuances with it.

Could you try installing the Better Obj-C++ Syntax? If it's still an problem, if you can post an issue on that repo that'll help me put it on a Todo list for later

https://github.com/jeff-hykin/better-objcpp-syntax

jeff-hykin avatar Jan 10 '22 17:01 jeff-hykin