Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Added .ASP files highlighting #5010

Merged
merged 4 commits into from
Sep 4, 2013
Merged

Added .ASP files highlighting #5010

merged 4 commits into from
Sep 4, 2013

Conversation

dananichev
Copy link
Contributor

Issue #4883. Maps .ASP files to "htmlmixed" highlighting.

@ghost ghost assigned redmunds Sep 3, 2013
@jasonsanjose
Copy link
Member

Thanks @fr3nzzy. Can you sign the CLA http://dev.brackets.io/brackets-contributor-license-agreement.html before we merge?

@dananichev
Copy link
Contributor Author

@jasonsanjose ofc, i will sign it tomorrow (i need to read it before, right?:)). If it's alright. I'm going to sleep now.

@dananichev
Copy link
Contributor Author

Turns out, it's very small CLA. Signed.

"mode": "vbscript",
"fileExtensions": ["vbscript"],
"blockComment": ["/*", "*/"],
"lineComment": ["//"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line comments for VBScript are delimited with a single-quote, so this should be:

        "lineComment": ["'"]

@redmunds
Copy link
Contributor

redmunds commented Sep 4, 2013

Done with code review.

@dananichev
Copy link
Contributor Author

Fixed. My bad.
But, also, i have a question about multiline comments. As far as i know, there are no multiline comments in VBScript. But it's been a while...

@redmunds
Copy link
Contributor

redmunds commented Sep 4, 2013

Good catch. Correct there are no block comments in VBScript. There is also the REM single-line comment statement.

@dananichev
Copy link
Contributor Author

I've removed block comments array for VBScript. Also REM added to list of line comments.

@redmunds
Copy link
Contributor

redmunds commented Sep 4, 2013

I'll merge this to get coloring for .vbs files and .asp files get HTML tag coloring.

Unfortunately, VBScript blocks in .asp file are not colored correctly, but it's not working for .aspx files, either.

Note that detecting script block delimiters is tricky because there are many delimiters types:

  • <%@LANGUAGE="VBSCRIPT"%> at top of page with <% ... %> in page
  • <script type="(text|application)\/(x-)?vb(a|script)">
  • <script runat="server">

redmunds added a commit that referenced this pull request Sep 4, 2013
@redmunds redmunds merged commit 348272a into adobe:master Sep 4, 2013
@dananichev
Copy link
Contributor Author

@redmunds Damn, i missed custom MIME declaration for "text/x-brackets-html". I can add <script type="(text|application)\/(x-)?vb(a|script)"> for "text/x-brackets-html" (it will enable VBScript highlighting in htmlmixed mode for <script type="text/vbscript"></script>.

Is there any way to enable <script runat="server"></script> and <%@LANGUAGE="VBSCRIPT"%>too? Because, right now it's partial solution and i want to do it right :) Can't reach codemirror.net for some reasons.

@redmunds
Copy link
Contributor

redmunds commented Sep 4, 2013

I already merged this pull request, so start a new one.

Since <%@LANGUAGE="VBSCRIPT"%> is specified at the top of the page, it won't work the same. You would have to assume that all <% ... %> and <script runat="server"> are VBScript (which is usually true).

@peterflynn
Copy link
Member

To do it right I think you'd really want a new Language declaration specifically for asp/aspx -- probably based on CodeMirror's newer "htmlembedded" mode. We're shoehorning a lot of file types into the basic HTML mode right now not because it's the best answer, but just because no one has implemented the custom mode that's needed yet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants