-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support indented here-docs (fix incorrect string highlighting) #26
Comments
From @roblourens on October 20, 2017 17:31 @mjbvz This is perl, not PHP :D |
Maybe I can help? |
Really, could you please point me to the relevant source file, or docs, or anything and I'll try squash that motherfbug. I'm a bit pissed by it at the moment. I have to create a multiline comment and write inside specific incantation to make syntax highlighting happy, and that looks ugly. |
@skaurus: perl.tmbundle/Syntaxes/Perl.plist Lines 2042 to 2113 in 7390bf7
I believe you'll need to add a regex to match the indented terminator. An example can be found in the ruby bundle: |
Thanks! |
So I finally got to it. It seems that regexes that match the start of the here-docs can have one capture group less, since groups 1 and 2 are identical. So line 2044 from the code fragment above would be: Now, to actually support indented here-docs it would be nice to use regex conditionals: if opening here-doc identifier have Right now we can allow spaces regardless of Which way is better do you think? |
Commit with an extra capture groups removed (only in here-docs definitions) and spaces allowed regardless of tilda presence would look like this: skaurus@bba43a9 With regex conditionals, |
Hey? |
m(._.)m |
Looks like there's another pull request for the same thing #41, (though it's just as neglected) |
There's also #42, which is a bit more thorough than 41. |
Any movement on this PR? |
I believe #42 (merged) has addressed this issue. |
I see thanks!
…On Fri, Jul 26, 2024 at 7:11 AM Patrick Cronin ***@***.***> wrote:
I believe #42 <#42>
(merged) has addressed this issue.
—
Reply to this email directly, view it on GitHub
<#26 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADJNXAHSI3WLVQQE3JPTUTZOI4FJAVCNFSM6AAAAABLPYIOVWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJSGYZTAMJUGM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Ryan Perry
Technology Director
www.pharmetika.com
800-222-4767 x700
Middleton, WI 53562
|
From @skaurus on October 20, 2017 14:34
I'm talking about this: http://perldoc.perl.org/perlop.html#Indented-Here-docs
Steps to Reproduce:
EOF
will be colored as if it's still inside the string.Currently it works only if opening here-doc marker does not have a tilde; AND closing marker is not indented (at all).
Reproduces without extensions: Yes
Copied from original issue: microsoft/vscode#36640
The text was updated successfully, but these errors were encountered: