Comments (7)
From @omochi on January 19, 2019 17:24
Oh, I found more.
should be:
"match": "--(?!>)",
"captures": {
"0": {
"name": "invalid.illegal.bad-comments-or-CDATA.xml"
}
}
from language-xml.
Thanks @alexr00 @omochi - can either of you share a specific code snippet that demonstrates the problem?
from language-xml.
I recorded video.
https://www.youtube.com/watch?v=UeCwolx7oW0&feature=youtu.be
First issue:
begin
and end
are not paired.
So punctuation.definition.comment.xml
scope does not constructed.
Second issue:
invalid.illegal.bad-comments-or-CDATA.xml
is single token and not scope.
So match
rule is better than begin
.
VSCode process begin
without end
as match
.
So no user level issue is. It is just for technically quality.
Because textmate syntax file is kinda interchangeable among some text editors.
from language-xml.
Thanks @omochi -
First issue:
begin
andend
are not paired.
Sopunctuation.definition.comment.xml
scope does not constructed.
It looks like your example is:
<%-- --%>
I think those are JSP comments, not XML comments? In Atom, if I set the language to JSP the closing --%>
is recognized correctly:
Let me know if I'm misunderstanding something here.
Second issue:
invalid.illegal.bad-comments-or-CDATA.xml
is single token and not scope.
Somatch
rule is better thanbegin
.
Your example here is:
<!-- -- -->
Related to the PR above, I believe this is already reported here: #91
from language-xml.
@rsese I just reports about syntax of grammar file.
report 1
See this current code.
{
'begin': '<%--'
'captures':
'0':
'name': 'punctuation.definition.comment.xml'
'end': '--%>'
'name': 'comment.block.xml'
}
language-xml/grammars/xml.cson
Lines 404 to 411 in 7bc75df
end
parameter is in object for captures
key.
It is wrong.
end
should be in same object with begin
key.
So it should be this.
{
"begin": "<%--",
"captures": {
"0": {
"name": "punctuation.definition.comment.xml"
}
},
"end": "--%>",
"name": "comment.block.xml"
},
Because JSP mode works correctly, JSP syntax is written as so.
'comment':
'begin': '<%--'
'captures':
'0':
'name': 'punctuation.definition.comment.jsp'
'end': '--%>'
'name': 'comment.block.jsp'
report 2
current definition is.
{
'begin': '--(?!>)'
'captures':
'0':
'name': 'invalid.illegal.bad-comments-or-CDATA.xml'
}
language-xml/grammars/xml.cson
Lines 420 to 425 in 7bc75df
I think that to replace begin
to match
is better.
So it should be this.
{
'match': '--(?!>)'
'captures':
'0':
'name': 'invalid.illegal.bad-comments-or-CDATA.xml'
}
Because this block is intended to match --
inside comment.
It is single token match and not scope creation.
If it works in atom and VSCode, it is by their flexible fallback that convert begin
to match
if it has no corresponded end
.
Changing match
is good for compatibility of this syntax file among other text editors.
from language-xml.
More information about report (2).
I reported same concept for PHP syntax.
They accept it and make PR to patch this.
This PR is also reviewed by @rsese . I say same things.
from language-xml.
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
from language-xml.
Related Issues (20)
- Syntax-based folding via Tree-sitter parsers
- Improvement: add support for msxml:script tags
- Attributes immediately after newline are not recognised
- Implement reasonable firstLineMatch pattern HOT 1
- Implement setting for additional file extensions
- Support for SLD HOT 2
- Grammar fails to highlight large, legal XML files HOT 6
- Code folding fails with multiline CDATA text HOT 1
- Code folds incorrectly with multiline CDATA sections HOT 1
- Highlighting fails for large XML files HOT 11
- XML Highlighter fails when using spaces after/before the equal sign in HOT 2
- Text underlining is wrong when using shorthanded tag closures HOT 1
- Highlighting for malformed comment looks like well-formed comment HOT 1
- Tag matching issue HOT 2
- XML DTD Improvements HOT 2
- XML syntax highlighting fails when double hyphens appear inside multi-line comments HOT 9
- XML colorizing incomplete for the too long line HOT 1
- Highlight CSS inside style tags and attributes (for example in SVGs) HOT 2
- Allow nested comments HOT 2
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 language-xml.