1. Sublime Text 4 Euphoria Package

Hi all, today I decided to work on a Package for the Sublime Text 4 editor to add syntax highlighting and support for the Euphoria programming language I haven't uploaded it to GitHub yet, and it's meant to be installed manually - how? First, install the Sublime Text 4 editor (free to try, costs money to use permanently) Then download the zip file I am sharing here from Dropbox and read the README.md file it explain everything: Here is the constant of the README.md file

      1. Installation Guide - Euphoria Package for Sublime Text
    1. Quick Installation
      1. Method 1: Manual Installation (Recommended)

1. Download all files from the artifacts provided 2. Locate your Sublime Text Packages directory: - Windows: `%APPDATA%\Sublime Text\Packages` - macOS: `/Library/Application Support/Sublime Text/Packages` - Linux: `/.config/sublime-text/Packages`

3. Create the package directory:

4. Copy all files into the `Euphoria` directory with this structure:

5. Restart Sublime Text or use `Ctrl+Shift+P` → "Package Control: Reload"

      1. Method 2: User Package Installation

1. Place all files directly in the User package directory: - Windows: `%APPDATA%\Sublime Text\Packages\User` - macOS: `/Library/Application Support/Sublime Text/Packages/User` - Linux: `/.config/sublime-text/Packages/User`

2. Restart Sublime Text

    1. Verification

1. Open a Euphoria file (create a test file with `.e` extension) 2. Check syntax highlighting is applied 3. Try code completion by typing `puts` and pressing Tab 4. Test build system: `Tools` → `Build System` → select "Euphoria - Run" 5. Test snippets: type `func` and press Tab

    1. File Extensions Supported

The package will automatically activate for files with these extensions: - `.e` - Euphoria source files - `.ex` - Euphoria executable files - `.exw` - Euphoria Windows executable files - `.eu` - Euphoria unit files - `.ew` - Euphoria Windows unit files

    1. Requirements for Build Systems

To use the build systems, ensure you have: - eui (Euphoria Interpreter) in your PATH - euc (Euphoria Translator) in your PATH - gcc (C Compiler) for translated programs

Test by running these commands in your terminal:

    1. Troubleshooting
      1. Syntax highlighting not working - Check that files are saved in the `Packages/Euphoria/` directory - Verify file has correct extension (.e, .ex, .exw, .eu, .ew) - Restart Sublime Text
      1. Build system not found - Ensure `.sublime-build` files are in the package directory - Check `Tools` → `Build System` menu for "Euphoria" options
      1. Completions not appearing - Verify `Euphoria.sublime-completions` is in the package directory - Check that file scope is `source.euphoria` - Try typing a function name and pressing Ctrl+Space
      1. Snippets not working - Ensure all `.sublime-snippet` files are in the package directory - Type trigger word (e.g., `func`) and press Tab - Verify snippet scope is `source.euphoria`
    1. Manual Activation

If automatic detection fails, manually set the syntax: 1. Open a Euphoria file 2. View → Syntax → Euphoria 3. Or press Ctrl+Shift+P → "Set Syntax: Euphoria"

    1. Getting Help

If you encounter issues: 1. Check the Console: `View` → `Show Console` 2. Look for error messages related to Euphoria package 3. Verify all files are correctly placed and named 4. Ensure Sublime Text version is 3.0 or higher

The package should work immediately after proper installation!

    1. #

DropBox Sublime Text Package for euphoria programming lanaguage

new topic     » topic index » view message » categorize

2. Re: Sublime Text 4 Euphoria Package

Hi Ron

You may be interested in the euphoria archive, as you've duplicated a couple of things here (no bad thing, and learning etc).

However, if you go here http://phix.x10.mx/pmwiki/pmwiki.php?n=Main.HomePage that contains the archive, but not all programs, as some reference the RDS archive which is 'deteriorating'

However, I have acquired the entire archive of programs from JMDuro, for preservation purposes, and one day may even make it searchable and uploadable - one of the many vapourware projects on the go, so if you want a a specific program, just let me know.

You can also vist the old RDS archive on the wayback machine :-

http://rapideuphoria311.free.nf/archive/www-rapideuphoria-com/www.rapideuphoria.com/archive.html

And a discussion about it here

https://openeuphoria.org/forum/138709.wc#138709

Cheers

Chris

new topic     » goto parent     » topic index » view message » categorize

3. Re: Sublime Text 4 Euphoria Package

Hi all, here is a Phix Sublime Text 4 Build file code to run/compile Phix in Sublime Text 4

Phix.sublime-build

{ 
    "shell_cmd": "taskkill /f /im \"$file_base_name.exe\" 2>nul & del \"$file_base_name.exe\" 2>nul & p -c \"$file\"", 
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", 
    "working_dir": "$file_path", 
    "selector": "source.phix", 
    "shell": true, 
    "variants": [ 
        { 
            "name": "Run in External CMD (Interpret)", 
            "shell_cmd": "start \"Phix\" cmd /k \"cd /d \"$file_path\" && p \"$file_name\" && pause\"" 
        }, 
        { 
            "name": "Compile Only", 
            "shell_cmd": "taskkill /f /im \"$file_base_name.exe\" 2>nul & del \"$file_base_name.exe\" 2>nul & p -c \"$file\"" 
        }, 
        { 
            "name": "Compile and Run in External CMD", 
            "shell_cmd": "start \"Phix\" cmd /k \"cd /d \"$file_path\" && taskkill /f /im \"$file_base_name.exe\" 2>nul && del \"$file_base_name.exe\" 2>nul && p -c \"$file_name\" && if exist \"$file_base_name.exe\" (\"$file_base_name.exe\" && pause) else (echo Compilation failed && pause)\"" 
        }, 
        { 
            "name": "Run Compiled in External CMD", 
            "shell_cmd": "if exist \"$file_base_name.exe\" (start \"Phix\" cmd /k \"cd /d \"$file_path\" && \"$file_base_name.exe\" && pause\") else (echo Executable not found. Compile first.)" 
        } 
    ] 
} 
new topic     » goto parent     » topic index » view message » categorize

4. Re: Sublime Text 4 Euphoria Package

Hi all, I found that the shortcut key Ctrl + / to toggle comments doesn't work, but I found a solution to that... The solution is to create a file called `Comments.tmPreferences` and put it in both the Euphoria and Phix Sublime package folders with this code:

Comments.tmPreferences :

<?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>name</key> 
    <string>Comments</string> 
    <key>scope</key> 
    <string>source.euphoria</string> 
    <key>settings</key> 
    <dict> 
        <key>shellVariables</key> 
        <array> 
            <dict> 
                <key>name</key> 
                <string>TM_COMMENT_START</string> 
                <key>value</string> 
                <string>-- </string> 
            </dict> 
        </array> 
    </dict> 
</dict> 
</plist> 

This works, I tested it on both euphoria and phix source files in Sublime Text editor 4

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu