Menu ▾ ▴

Editor issue

2026-10-08
2026-10-10
  • Giacomo Casano

    Giacomo Casano - 2026-10-08

    The new release of the editor has this issue:
    when I insert a comment to highlight a line—such as //*—the editor interprets it as the start of a comment and stops displaying the list of routines.
    However, everything works fine during compilation.
    I am attaching a video.

     
  • Anobium

    Anobium - 2026-10-08

    Interesting.

    Found it, and it can be fixed.

    Root cause: the Outline is generated by the GCBASIC extension. It strips /* ... */-style block comments line-by-line before running the symbol regexes, tracking an inBlock flag across the whole file. So, a little change is required.

    Run the attached CMD. Restart GCODE or press F2 in GCODE choose 'RELOAD WINDOW'.

     
  • Anobium

    Anobium - 2026-10-08

    If you cannot download the CMD. Cut and paste this into a CMD file.

    @echo off
    setlocal
    
    rem ============================================================================
    rem  patch_gccode_outline_fix.cmd
    rem
    rem  Fixes a bug in the GCcode (MierEngineering.GreatCowBasic) VS Code extension's
    rem  Outline/Symbol provider: a comment line like "//*  ----- Configuration" is
    rem  misread as opening a real /* block comment (the second '/' of "//" doubles
    rem  as the first '/' of "/*"), which never closes, so every symbol below that
    rem  line silently disappears from the Outline for the rest of the file.
    rem
    rem  Usage:
    rem      patch_gccode_outline_fix.cmd [path_to_extension.js]
    rem
    rem  With no argument, patches the default install location:
    rem      C:\GCstudio\vscode\data\extensions\MierEngineering.GreatCowBasic\dist\extension.js
    rem
    rem  Safe to run more than once - if the fix is already present, it reports that
    rem  and makes no changes. A timestamped backup of the original file is made
    rem  before any change.
    rem ============================================================================
    
    set "TARGET=%~1"
    if "%TARGET%"=="" set "TARGET=C:\GCstudio\vscode\data\extensions\MierEngineering.GreatCowBasic\dist\extension.js"
    
    if not exist "%TARGET%" (
        echo [FAIL] File not found: %TARGET%
        exit /b 1
    )
    
    echo Target: %TARGET%
    
    powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command ^
        "$ErrorActionPreference = 'Stop';" ^
        "$target = '%TARGET%';" ^
        "$old = 'GCBDocumentSymbolProvider.stringRemBlock.test(text.slice(pos, start))';" ^
        "$new = 'GCBDocumentSymbolProvider.stringRemBlock.test(text.slice(pos, start + 1))';" ^
        "$enc  = New-Object System.Text.UTF8Encoding($false);" ^
        "$text = [System.IO.File]::ReadAllText($target, $enc);" ^
        "if ($text.Contains($new)) {" ^
        "    Write-Host '[OK] Already patched - no changes made.';" ^
        "    exit 0;" ^
        "}" ^
        "if (-not $text.Contains($old)) {" ^
        "    Write-Host '[FAIL] Expected original text not found - file may be a different version. No changes made.';" ^
        "    exit 2;" ^
        "}" ^
        "$count = ([regex]::Matches($text, [regex]::Escape($old))).Count;" ^
        "if ($count -ne 1) {" ^
        "    Write-Host \"[FAIL] Expected exactly 1 match, found $count - refusing to guess. No changes made.\";" ^
        "    exit 3;" ^
        "}" ^
        "$stamp = Get-Date -Format 'yyyyMMdd_HHmmss';" ^
        "$backup = \"$target.bak_$stamp\";" ^
        "Copy-Item -LiteralPath $target -Destination $backup -Force;" ^
        "Write-Host \"[OK] Backed up original to: $backup\";" ^
        "$patched = $text.Replace($old, $new);" ^
        "[System.IO.File]::WriteAllText($target, $patched, $enc);" ^
        "Write-Host '[OK] Patched successfully.';" ^
        "Write-Host 'Reload GCcode (Ctrl+Shift+P -> Developer: Reload Window) for the fix to take effect.';" ^
        "exit 0;"
    
    set "RC=%ERRORLEVEL%"
    if not "%RC%"=="0" (
        echo [FAIL] Patch script exited with code %RC%.
    )
    exit /b %RC%
    
     
  • Giacomo Casano

    Giacomo Casano - 2026-10-10

    It works perfectly now. Thanks.

     

    Last edit: Giacomo Casano 2026-10-10

Log in to post a comment.