Code Monkey home page Code Monkey logo

Comments (8)

revlaf avatar revlaf commented on May 22, 2024 1

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.

mjbvz avatar mjbvz commented on May 22, 2024

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.

revlaf avatar revlaf commented on May 22, 2024

@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.

revlaf avatar revlaf commented on May 22, 2024

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.

kumarharsh avatar kumarharsh commented on May 22, 2024

Related: #41

from vscode-textmate.

alexdima avatar alexdima commented on May 22, 2024

@zh4ui AFAIK we support "begin...while".

Closing this issue as requested.

from vscode-textmate.

colinfang avatar colinfang commented on May 22, 2024

@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.

revlaf avatar revlaf commented on May 22, 2024

@colinfang

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.