Visual Studio Community 2015 PRGs/CHs syntax coloring

Visual Studio Community 2015 PRGs/CHs syntax coloring

Postby Antonio Linares » Fri May 06, 2016 7:32 am

Look for *.tmLanguage in c:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\
and you will find the required below randomName. You may find some different ones. Try all them.

c:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\<randomName>\Starterkit\Extensions\

If so, I have found that creating a Harbour folder there, with this structure:

Harbour
+ Syntaxes

and placing there this file:
https://bitbucket.org/fivetech/fivewin-contributions/downloads/Harbour.tmLanguage
then we have automatic syntax coloring for PRG files.

That file was originally created and published by Rafa Carmona:
https://github.com/rafathefull/harbour/blob/master/Harbour.tmLanguage
but there are some sections that are not fine for Visual Studio, thats why I have modified it.

All credits to Rafa! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Postby Antonio Linares » Fri May 06, 2016 9:35 am

Simplified version with better colors support

Download Harbour.tmLanguage again from here:
https://bitbucket.org/fivetech/fivewin-contributions/downloads/Harbour.tmLanguage

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Postby Antonio Linares » Fri May 06, 2016 10:18 am

These are the different colors that I have identified:

storage.type.harbour BLUE
keyword.other.harbour BLUE

constant.other.harbour RED

constant.numeric.harbour LIGHT_BLUE

keyword.control.harbour PURPLE

comment.line.double-slash.harbour GREEN
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Postby Antonio Linares » Fri May 06, 2016 10:31 am

You can try using different colors:

Harbour.tmLanguage
Code: Select all  Expand view
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>fileTypes</key>
    <array>
        <string>prg</string>
        <string>ch</string>
    </array>
    <key>name</key>
    <string>Harbour</string>
    <key>patterns</key>
    <array>
        <dict>
            <key>comment</key>
            <string>n�s</string>
            <key>match</key>
            <string>\b(((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?))</string>
            <key>name</key>
            <string>constant.numeric.harbour</string>
        </dict>
        <dict>
            <key>comment</key>
            <string>cadenas comillas simples</string>
            <key>match</key>
            <string>'[^']*'</string>
            <key>name</key>
            <string>string.quoted.single.harbour</string>
        </dict>
        <dict>
            <key>comment</key>
            <string>cadenas comillas dobles</string>
            <key>match</key>
            <string>("[^"]*")</string>
            <key>name</key>
            <string>string.quoted.double.harbour</string>
        </dict>
        <dict>
            <key>comment</key>
            <string>sentencias de control</string>
            <key>match</key>
            <string>(?i)\b(?:do|case|class|endclass|data|method|init|endcase|otherwise|switch|if|else|elseif|endif|while|end|enddo|exit|static function|function|return|for|next|stdout|ifndef)\b</string>
            <key>name</key>
            <string>keyword.control.harbour</string>
        </dict>
        <dict>
            <key>comment</key>
            <string>operadores</string>
            <key>match</key>
            <string>(?i)\b(?:and|or|not|!)\b</string>
            <key>name</key>
            <string>keyword.other.harbour</string>
        </dict>
        <dict>
            <key>comment</key>
            <string>declaraciones</string>
            <key>match</key>
            <string>(?i)\b(?:local|nil|default|field|static|public|static|external|request|private|global)\b</string>
            <key>name</key>
            <string>storage.type.harbour</string>
        </dict>
        <dict>
            <key>begin</key>
            <string>/\*</string>
            <key>captures</key>
            <dict>
                <key>0</key>
                <dict>
                    <key>name</key>
                    <string>punctuation.definition.comment.harbour</string>
                </dict>
            </dict>
            <key>comment</key>
            <string>in-line comment with /* */</string>
            <key>end</key>
            <string>\*/</string>
            <key>name</key>
            <string>comment.block.harbour</string>
        </dict>
    <dict>
      <key>comment</key>
            <string>in-line comment with //</string>
            <key>match</key>
            <string>(//).*?($\n?|(?=\?&gt;))</string>
            <key>name</key>
            <string>constant.other.harbour</string>
        </dict>
        <dict>
            <key>comment</key>
            <string>definicion de constantes caracter</string>
            <key>match</key>
            <string>(?i)\b(?:include|ifdef|ifndef)</string>
            <key>name</key>
            <string>variable.language.harbour</string>
        </dict>
        <dict>
            <key>comment</key>
            <string>boolean</string>
            <key>match</key>
            <string>(?i)(\.(t|f)\.)</string>
            <key>name</key>
            <string>constant.numeric.harbour</string>
        </dict>
        <dict>
            <key>comment</key>
            <string>BOOLEAN</string>
            <key>match</key>
      <string>(?i)(\.(T|F)\.)</string>
      <key>name</key>
            <string>constant.numeric.harbour</string>
        </dict>
        <dict>
      <key>comment</key>
      <string>FiveWin support</string>
      <key>match</key>
            <string>(?i)\b(?:define|window|dialog|activate|centered)\b</string>
      <key>name</key>
            <string>comment.line.double-slash.harbour</string>
        </dict>
        <dict>
            <key>match</key>
            <string>\:</string>
            <key>name</key>
            <string>constant.literal.harbour</string>
        </dict>
        <dict>
            <key>match</key>
      <string>(\:)|(\[)|(\])|(\()|(\))|(\{)|(\})</string>
            <key>name</key>
            <string>storage.type.harbour</string>
        </dict>
    </array>
    <key>scopeName</key>
    <string>source.harbour</string>
    <key>uuid</key>
    <string>56571807-d94d-4805-bbfc-87d347d189e4</string>
</dict>
</plist>


Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Postby TimStone » Mon May 16, 2016 10:28 pm

Actually, I just set VS to open the .prg files in UE Studio. I have the project open and VS open. I can click on either side and it opens the file in VS with all of its capabilities. It does work out fine.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Postby Antonio Linares » Mon May 16, 2016 10:55 pm

Tim,

The Visual Studio built in source code editor is very good and now it works great with Harbour syntax too
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Postby TimStone » Mon May 16, 2016 11:21 pm

I looked at the instructions and looked for the place to store that file ( VS 2015 ) and could not find it. Did you simply create a Harbour folder under the Extensions subfolder, or did you select one of the random names and put it there ?

I did create an ..\extensions\harbour\syntax folder, placed it there, and then tried to see if it would apply. I can't find how to specify that it should use that file.

Also, your file is for Apple ... and we use Windows on a regular PC. Does that make a difference ?

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Postby Antonio Linares » Tue May 17, 2016 8:34 am

Tim,

Look for *.tmLanguage in c:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\
and you will find the required below randomName. You may find some different ones. Try all them.


tmLanguage stands for TextMate language and it is the same format that SublimeText editor uses. I guess that
this started in Apple and still they use an Apple plist file format (it is a renamed XML file. You can use Visual
Studio to edit it).

Mine looks like this. Yours will have a different "random" name (1kztsa3m.wi0) folder:

c:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\1kztsa3m.wi0\Starterkit\Extensions\Harbour\Syntaxes\Harbour.tmLanguage
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Postby TimStone » Tue May 17, 2016 3:32 pm

I have a long list of random names. Where can I find the proper one for the project ?
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Postby Antonio Linares » Tue May 17, 2016 4:20 pm

Tim,

Look for *.tmLanguage in those folders and you will find the right folders
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Postby TimStone » Tue May 17, 2016 4:23 pm

I did that yesterday and there were about 30 defined in different folders with random names. None of them are the obviously correct one.

What identifies the proper folder for this project ? Can I find the random name in the IDE ?
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Postby Antonio Linares » Tue May 17, 2016 5:03 pm

In my Visual Studio installation there were three folders that contained *.tmLanguage files

I tried it in each of them, and in one of them, once you exit from Visual Studio and start it again, it worked fine
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Postby TimStone » Tue May 17, 2016 7:27 pm

I have 5 folders. I've put it in each of them with no success.

Each of those folders has many options for programming languages.

Where in the IDE do you setup so it knows it is to use the Harbour file you installed ? I don't recall any place where we setup Harbour as a language within Visual Studio.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Postby Antonio Linares » Tue May 17, 2016 7:29 pm

Tim,

Lets have a TeamViewer session
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Postby vilian » Tue Jul 26, 2016 7:35 pm

Antônio,

I have the same problem that Tim. I found two directories with *.tmlanguages and saved Harbour files in both, but i can't see colors highlight on Visual C editor. What else i need to do?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 977
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Next

Return to Utilities / Utilidades

Who is online

Users browsing this forum: No registered users and 6 guests