Re: JScript syntax higlihting in VIntDev

From: Roland Hall (nobody_at_nowhere)
Date: 02/12/04


Date: Wed, 11 Feb 2004 18:23:14 -0600


"Roland Hall" wrote:
: "Ron Hinds" wrote:'
: : Is there a way in Visual InterDev 6 to make the editor recognize
different
: : file name extensions and provide syntax highlighting/intellisense?
: : Specifically, I have several JScript library files in a project with the
: : extension ".JS". It would be very useful if InterDev recognized them as
: : JScript files and highlighted the syntax.
:
: In Project Explorer, right-click a .js file and choose Open With. Then
: select the HTML Editor and set the editor to come up in Source View. To
do
: this, select Tools/Options/HTML->HTML Editor. Under Initial View, Select
: Start HTML pages in Source, instead of the default, 'Design'.
:
: If your .js has:
: <script type="text/jscript"> or <script type="text/javascript"> then you
: will get the color syntax coding and intellisense. However, generally
these
: files are used as links so you will have to comment those out before using
: them in your code as a linked .js file.
:
: There is a ZD Journal Tip that says you can use just //SCRIPT to activate
it
: but that doesn't work for me.
: http://msdn.microsoft.com/vinterdev/technical/tips.asp - The heading is:
: Color-Coding in Script-Only Files
:
: I use my .js files as:
:
: <!--
: function ...
:
: //-->
:
: If I include //SCRIPT, I get the color of the comment codes and the
default
: comment color, but the syntax is not color coded.
:
: If I use:
:
: <script type="text/jscript">
: function ...
:
: </script>
:
: ..then I do.
:
: However, to use the code linked in a file, then I have to remove the
script
: tags or comment them out.
:
: Document to link script (*.html, *.asp)
: <script type="text/jscript" src="somescript.js"></script>
:
: somescript.js - design time
: <script type="text/jscript">
: <!--
: function doThis() {
: ...
: }
: //-->
: </script>
:
: somescript.js - run time
: <!--
: function doThis() {
: ...
: }
: //-->

Dayum. You would know I'd figure it out after I posted! grrrrrr....

Ok, you have to do this in the following order. I can't tell you why.

You still have to set the IDE as I mentioned but on your page...

Start with:
<script

After you press the t, the color will enable.
Now, put js comment marks before the tag...
You should have this:
//<script
You cannot put the <!-- before it or it will comment the code and you'll get
that default color.
You also cannot start with // and then type in <script. So, it appears it's
FIWINS (First In Wins!)

HTH...

-- 
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp


Relevant Pages

  • Re: JScript syntax higlihting in VIntDev
    ... JScript files and highlighted the syntax. ... select the HTML Editor and set the editor to come up in Source View. ... However, to use the code linked in a file, then I have to remove the script ... function doThis() { ...
    (microsoft.public.scripting.jscript)
  • Re: JScript syntax higlihting in VIntDev
    ... > Is there a way in Visual InterDev 6 to make the editor recognize ... > different file name extensions and provide syntax ... If you include the *.js and *.vbs extensions, ... To install the optional Microsoft Script Editor ...
    (microsoft.public.scripting.jscript)
  • Re: UDF/SP Editor
    ... I just wrote a UDF in QA and purposely wrote in some syntax ... executed a script to use the function, I got an error telling me there was a ... How is this better than EM's editor? ... Display Estimated Execution Plan ...
    (microsoft.public.sqlserver.programming)
  • ANN: Castalia 2.2 released
    ... I am excited to announce the immediate availability of Castalia 2.2. ... after the editor is idle for a moment. ... Live syntax checking - syntax errors are marked in the editor. ... Fast, powerful code templates ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Trailing blanks in batch file
    ... Same applies to parentheses and quotes, ... problem as there *being* a trailing space whose presence creates a problem. ... If someone exclusively used an editor that displayed blanks as grey dots, ... can never be sure that one's script will never be edited by someone else ...
    (microsoft.public.win2000.cmdprompt.admin)

Quantcast