danipen / TextMateSharp

A port of tm4e to bring TextMate grammars to dotnet ecosystem
MIT License
87 stars 15 forks source link

How to parse embedded languages? #4

Closed pengsongkun741 closed 2 years ago

pengsongkun741 commented 2 years ago

I am trying to parse the vue file . It is found that the embedded language inside cannot be parsed normally. What configuration is needed to achieve this goal?

In your sample code I see that the GetFilePath(string scopeName) method is automatically called in IRegistryOptions. I can see that some embedded languages ​​needed by vue will find its tmlanguage files in this way. Is this related to the problem I mentioned?

danipen commented 2 years ago

Checkout the RegistryOptions provided for AvaloniaEdit. This may help. It supports loading dependent grammars.

https://github.com/AvaloniaUI/AvaloniaEdit/blob/feature/textmate-support/src/AvaloniaEdit.TextMate/RegistryOptions.cs