Visual Studio Community 2015 PRGs/CHs syntax coloring

User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Visual Studio Community 2015 PRGs/CHs syntax coloring

Post by Antonio Linares »

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- ... 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/ ... 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: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Post by Antonio Linares »

Simplified version with better colors support

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

Image
regards, saludos

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

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Post by Antonio Linares »

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: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Post by Antonio Linares »

You can try using different colors:

Harbour.tmLanguage

Code: Select all

<?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?|(?=\?>))</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
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Post by TimStone »

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
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Post by Antonio Linares »

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
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Post by TimStone »

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
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Post by Antonio Linares »

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
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Post by TimStone »

I have a long list of random names. Where can I find the proper one for the project ?
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Post by Antonio Linares »

Tim,

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

Antonio Linares
www.fivetechsoft.com
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Post by TimStone »

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
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Post by Antonio Linares »

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
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Post by TimStone »

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
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Post by Antonio Linares »

Tim,

Lets have a TeamViewer session
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: Visual Studio Community 2015 PRGs/CHs syntax coloring

Post by vilian »

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
Post Reply