Comments (8)
Okay. Writing a TextMate Grammar: Some Lessons Learned gives a fairly good explanation about "begin..end" and "begin...while".
I am wondering is there a plan for vscode-textmate to support "begin...while"?
from vscode-textmate.
I believe we currently only support injecting into a begin
end
rule. This grammar ends up getting injected into a begin
while
instead (meta.paragraph.markdown
) and ends up not being applied after the first line
from vscode-textmate.
@mjbvz thanks. But would you explain a little bit more about it. What is a "begin...while". TextMate's documentation language_grammars talks about "begin ... end", but it says nothing about "begin...while". What's the difference? Some document for "begin...while" would be perfect for me.
Additionally, can I take your comment for that vscode currently doesn't support multi-line grammar injection?
from vscode-textmate.
Well, I've figured out another way to fullfill my need, which is using a markdown-it plugin, according to the api-markdown document.
@mjbvz I think this issue can be closed. Thanks very much.
from vscode-textmate.
Related: #41
from vscode-textmate.
@zh4ui AFAIK we support "begin...while".
Closing this issue as requested.
from vscode-textmate.
@zh4ui How does markdown-it help here? Doesn't it only deal with the markdown preview?
@alexandrudima If it is not "begin...while" issue, what went wrong?
I tried
{
"begin": "begin",
"end": "end",
"name": "AAA",
"patterns": [
{
"name": "BBB",
"match": ".+"
}
]
}
The above pattern correctly recognises each line in the body as BBB
However replacing match
to .*
, it only recognises the first line. The rest lines are parsed as markdown instead.
from vscode-textmate.
Yes, markdown-it only deals with markdown preview. So I gave up trying.
I've got an impression that currently grammar injection is just a hack, rather than a useable feature.
from vscode-textmate.
Related Issues (20)
- Add Option to Format in often used match expression parts HOT 1
- Vscodes TextMate doesn't support the any scope selector `*` in `injections` HOT 2
- lacks of some type export on latest version
- Unable to exclude elements with "textmate" scope selectors in custom themes HOT 1
- Textmate engine bug for `\k<>` backreferences HOT 2
- Please add back IRawGrammar as top level export!
- YAML Syntax interprets IP-Style Strings as numbers HOT 1
- Tagging releases HOT 4
- Cannot read property 'INITIAL' of undefine.
- Consider using end pattern as bail out for embedded languages HOT 12
- Scopes on Recursive Regex Cause Problems
- Nested `begin`/`while` rules do not continue past begin match HOT 3
- Misclassification of PHP syntax tokens HOT 3
- Matching multiline text HOT 2
- How to find all local variables? HOT 2
- JSON grammar without `filePath` parsed incorrectly as PList
- How to make the embedded language have corresponding language id
- Clarification about concurrent tokenization using multiple themes
- PHPdoc highlighting issue HOT 1
- Incorrect 'no more matches'? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-textmate.