Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion bucket/theia-ide.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,41 @@
"description": "A modern and open IDE for cloud and desktop. Theia platform based. Formerly “Theia Blueprint”.",
"homepage": "https://theia-ide.org/#theiaide",
"license": "EPL-2.0, GPL-2.0, MIT",
"notes": "Settings are stored in '%APPDATA%\\Theia IDE', and are not persisted by Scoop.",
"notes": [
"Added 'Open with Theia IDE' context menu entry for folders",
"To remove: reg import \"$dir\\uninstall-context.reg\"",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate manifest =="
git ls-files | rg '(^|/)bucket/theia-ide\.json$|(^|/)deprecated/theia-ide\.json$' || true

echo "== manifest excerpt =="
if [ -f bucket/theia-ide.json ]; then
  cat -n bucket/theia-ide.json | sed -n '1,120p'
fi

echo "== note/reference snippets in manifest and helpers =="
rg -n '\$dir|uninstaller|post_install|notes|uninstall-context\.reg|reg import' bucket/theia-ide.json .github/README.md .github/CONTRIBUTING.md 2>/dev/null || true

Repository: ScoopInstaller/Extras

Length of output: 4378


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import json
from pathlib import Path

path = Path("bucket/theia-ide.json")
try:
    text = path.read_text(encoding="utf-8", newline=None)
except Exception as e:
    print(f"read error: {e}")
    raise

print("cr_lf:", "\r\n" in text.split("\n")[7] if len(text.splitlines()) > 7 else "?")
print("lf_only_near_8:", any(line.endswith("\n") and not line.endswith("\r\n") for line in text.splitlines()[:10]))

data = json.loads(text)
print("version:", data["version"])
print("autoupdate_64_url:", data["autoupdate"]["architecture"]["64bit"]["url"])
print("top_url_has_version:", str(data["architecture"]["64bit"]["url"]) == str(data["autoupdate"]["architecture"]["64bit"]["url"]).replace("$version", data["version"]))
PY

Repository: ScoopInstaller/Extras

Length of output: 369


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import json
from pathlib import Path

path = Path("bucket/theia-ide.json")
raw = path.read_bytes()
print("has_crlf:", b"\r\n" in raw)
print("has_unterminated_lf:", any(line.endswith(b"\n") and not line.endswith(b"\r\n") for line in raw.split(b"\n")))

text = raw.decode("utf-8")
data = json.loads(text)
version = data["version"]
top_url = data["architecture"]["64bit"]["url"]
auto_url = data["autoupdate"]["architecture"]["64bit"]["url"]
print("version:", version)
print("autoupdate_64_url:", auto_url)
print("path_version_matches_versioned_top_url:", version in auto_url and auto_url.replace("$version", version) == top_url)
print("top_installer_uninstaller_exist:", bool(data.get("installer")) and bool(data.get("uninstaller")))
PY

python3 - <<'PY'
# Standalone probe for the manifest-script note semantics: $dir is only a variable
# during manifest script execution, so notes displayed to users after install do not
# resolve it to an installed path.
template = "reg import \"$dir\\uninstall-context.reg\""
user_shells = ["cmd.exe", "powershell.exe"]
for shell in user_shells:
    try:
        bytes(template.encode("unicode_escape"))
    except Exception:
        pass
    try:
        result = __import__("subprocess").run(
            [shell, "/c", template],
            encoding="utf-8",
            capture_output=True,
            text=True,
        )
        print(f"{shell}: exit={result.returncode} stdout={result.stdout!r} stderr={result.stderr!r}")
    except Exception as exc:
        print(f"{shell} probe failed: {exc}")
PY

Repository: ScoopInstaller/Extras

Length of output: 600


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== raw bytes for first 3 lines =="
xxd bucket/theia-ide.json | sed -n '1,20p'

echo "== line 8 raw representation =="
python3 - <<'PY'
from pathlib import Path
for n, line in enumerate(Path("bucket/theia-ide.json").read_bytes().split(b"\n")[:12], start=1):
    if n <= 12:
        print(f"{n}: {line!r} | decoded={line.decode('utf-8')!r}")
PY

echo "== autoupdate/top url version comparison =="
python3 - <<'PY'
import json
from pathlib import Path
data = json.loads(Path("bucket/theia-ide.json").read_text(encoding="utf-8"))
version = data["version"]
top = data["architecture"]["64bit"]["url"]
auto = data["autoupdate"]["architecture"]["64bit"]["url"]
print({"version": version, "top": top, "auto": auto, "auto_uses_version": "$version" in auto})
PY

echo "== standalone cmd-like $dir probe =="
python3 - <<'PY'
import subprocess
import tempfile, os
template = 'reg import "$dir\\uninstall-context.reg"'
with tempfile.TemporaryDirectory() as d:
    env = {**os.environ, "dir": d}
    r = subprocess.run(["powershell.exe", "-NoLogo", "-NoProfile", "-NonInteractive", "-Command", template], cwd=d, env=env, capture_output=True, text=True)
    print("exit:", r.returncode)
    print("stdout:", r.stdout.strip())
    print("stderr:", r.stderr.strip()[:500])
PY

Repository: ScoopInstaller/Extras

Length of output: 234


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== first 3 lines byte inspection =="
od -c bucket/theia-ide.json | sed -n '1,12p'

echo "== line 8 raw representation =="
python3 - <<'PY'
from pathlib import Path
for n, line in enumerate(next(Path("bucket/theia-ide.json").read_bytes().splitlines(keepends=True)), 1):
    continue
PY
python3 - <<'PY'
from pathlib import Path
text = Path("bucket/theia-ide.json").read_bytes()
lines = text.split(b"\n")[:12]
for i, line in enumerate(lines, start=1):
    print(f"{i}: {line!r} -> {line.decode('utf-8')!r}")
PY

echo "== autoupdate/top url version comparison =="
python3 - <<'PY'
import json
from pathlib import Path
data = json.loads(Path("bucket/theia-ide.json").read_text(encoding="utf-8"))
version = data["version"]
top = data["architecture"]["64bit"]["url"]
auto = data["autoupdate"]["architecture"]["64bit"]["url"]
print({"version": version, "top": top, "auto": auto, "auto_uses_version": "$version" in auto})
PY

echo "== standalone cmd-like $dir probe if powershell is available =="
python3 - <<'PY'
import subprocess, os, tempfile
template = 'reg import "$dir\\uninstall-context.reg"'
with tempfile.TemporaryDirectory() as d, tempfile.NamedTemporaryFile(prefix="reg_", suffix=".reg", delete=False) as f:
    f.write(b"Windows Registry Editor Version 5.00\r\n\r\n")
    path = f.name
env = {**os.environ, "dir": d}
try:
    # Create temp reg next line so we know if reg import actually executes and fails because path wrong.
    # Actually we can just run with non-existent file, as $dir is resolved in cmd-like expansion in powershell env var.
    r = subprocess.run(["powershell.exe", "-NoLogo", "-NoProfile", "-NonInteractive", "-Command", template], cwd=d, env=env, capture_output=True, text=True)
    print("powershell_exit:", r.returncode)
    print("powershell_stdout:", r.stdout.strip())
    print("powershell_stderr:", r.stderr.strip()[:500])
except FileNotFoundError as e:
    print("powershell.exe not available:", e)
PY

Repository: ScoopInstaller/Extras

Length of output: 235


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
from pathlib import Path
import json

raw = Path("bucket/theia-ide.json").read_bytes()
print("crlf_present:", b"\r\n" in raw)
print("lf_endings_present:", any(e == b"b''" in line for line in [raw.split(b"\n")]) or any(line.endswith(b"\n") and not line.endswith(b"\r\n") for line in raw.split(b"\n")))
lines = raw.decode("utf-8").splitlines()
for i in range(1, 12):
    print(f"{i}: {lines[i-1]!r}")

data = json.loads(raw)
top = data["architecture"]["64bit"]["url"]
auto = data["autoupdate"]["architecture"]["64bit"]["url"]
version = data["version"]
print({
    "version": version,
    "top": top,
    "autoupdate_64_url": auto,
    "autoupdate_uses_version": "$version" in auto,
    "expanded_match": auto.replace("$version", version) == top,
})
PY

python3 - <<'PY'
import subprocess, os, tempfile

template = 'reg import "$dir\\uninstall-context.reg"'
with tempfile.TemporaryDirectory() as d:
    env = {**os.environ, "dir": d}
    try:
        r = subprocess.run(["powershell.exe", "-NoLogo", "-NoProfile", "-NonInteractive", "-Command", template], cwd=d, env=env, capture_output=True, text=True)
        print("powershell_exit:", r.returncode)
        print("powershell_stdout:", r.stdout.strip())
        print("powershell_stderr:", r.stderr.strip()[:800])
    except FileNotFoundError:
        print("powershell.exe not available")

env = {**os.environ, "dir": d}
try:
    r = subprocess.run(["cmd.exe", "/c", template], cwd=d, env=env, capture_output=True, text=True, encoding="utf-16-n")
    print("cmd_exit:", r.returncode)
    print("cmd_stdout:", r.stdout.strip())
    print("cmd_stderr:", r.stderr.strip()[:800])
except Exception as e:
    print("cmd_probe_error:", type(e).__name__, e)
PY

Repository: ScoopInstaller/Extras

Length of output: 325


Make the removal note user-executable.

$dir is a manifest-script variable, so the displayed note is not a command a user can paste into their shell. Since uninstall already imports uninstall-context.reg, change this to state that Scoop removes the context menu entry automatically on uninstall.

Proposed wording
-				"To remove: reg import \"$dir\\uninstall-context.reg\"",
+				"Context-menu entry is removed automatically when Theia IDE is uninstalled",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"To remove: reg import \"$dir\\uninstall-context.reg\"",
"Context-menu entry is removed automatically when Theia IDE is uninstalled",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bucket/theia-ide.json` at line 8, Update the removal note in the manifest
entry to tell users that Scoop automatically removes the context-menu entry
during uninstall, instead of displaying the non-pasteable `$dir` registry
command; leave the existing uninstall behavior unchanged.

"Settings in '%APPDATA%\\Theia IDE' not persisted by Scoop"
],
"architecture": {
"64bit": {
"url": "https://www.eclipse.org/downloads/download.php?mirror_id=1&file=/theia/ide/1.73.100/windows/TheiaIDESetup-1.73.100.exe#/dl.7z",
"hash": "sha512:649b3c552f9a4d046ebc8d64eaee9b27c7bf156d23e5012ed91c299cafedde986f4967ee1e71aa9ec37d894809d15dbd72ce736fecac952fbf774955234cf1a6"
}
},
"post_install": [
"$theia_path = $dir -replace '\\\\', '\\\\'",
"$scriptsdir = \"$bucketsdir\\$bucket\\scripts\\$app\"",
"if (-not (Test-Path $scriptsdir)) {",
" Write-Host \"Warning: reg script source not found at $scriptsdir\" -ForegroundColor Yellow",
"} else {",
" Get-ChildItem -Path $scriptsdir -Filter '*.reg' -File | ForEach-Object {",
" $content = Get-Content -Path $_.FullName -Encoding utf8",
" if ($global) { $content = $content -replace 'HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE' }",
" $content -replace '{{theia_dir}}', $theia_path | Set-Content -Path \"$dir\\$($_.Name)\" -Encoding unicode",
" }",
" reg import \"$dir\\install-context.reg\"",
"}"
],
"uninstaller": {
"script": [
"if ($cmd -eq 'uninstall')",
"{",
" if (Test-Path \"$dir\\uninstall-context.reg\") {",
" reg import \"$dir\\uninstall-context.reg\"",
" }",
"}"
]
},
Comment on lines +17 to +40

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== file list candidates =="
fd -a 'theia-ide\.json$' . || true
fd -a 'theia-ide' . || true

echo "== manifest =="
if [ -f bucket/theia-ide.json ]; then
  cat -n bucket/theia-ide.json
fi

echo "== related files =="
git ls-files | rg 'theia|context\.reg|scripts|post_install|uninstall' || true

Repository: ScoopInstaller/Extras

Length of output: 7688


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== theia scripts =="
cat -n scripts/theia-ide/install-context.reg
printf '\n-- uninstall --\n'
cat -n scripts/theia-ide/uninstall-context.reg

echo "== line endings for manifest and scripts =="
python3 - <<'PY'
from pathlib import Path
for p in [Path('bucket/theia-ide.json'), Path('scripts/theia-ide/install-context.reg'), Path('scripts/theia-ide/uninstall-context.reg')]:
    blob=p.read_bytes()
    print(f'{p}: CRLF={b"\r\n" in blob}, LF={b"\n" in blob}, LF_without_CRLF={b"\n" not in blob or b"\r\n" in blob}')
PY

echo "== PowerShell error behavior probe =="
if command -v pwsh >/dev/null 2>&1; then
  pwsh -NoProfile -NonInteractive -Command '
    Set-StrictMode -Version Latest
    Write-Host "Available reg.exe: $(if ($env:windir -and (Test-Path ("$env:windir\system32\reg.exe"))){1}else{0})"
    try { reg import nonexistent.reg }
    catch { Write-Host "Caught"; Write-Host $_.FullyQualifiedErrorId }
  '
else
  echo "pwsh not available"
fi

Repository: ScoopInstaller/Extras

Length of output: 1653


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== manifest script blocks with call context =="
python3 - <<'PY'
from pathlib import Path
p=Path('bucket/theia-ide.json')
text=p.read_text(encoding='utf-8-sig')
for token in ['"post_install"', '"uninstaller"', '": {', '": [']:
    if token in text:
        idx=text.index(token)
        lines=text[:idx].splitlines()
        row=sum(1 for _ in range(len(lines)))+1
        print(f'{token}: near line {row}')
for i,l in enumerate(text.splitlines(),1):
    if 'reg import' in l or 'scriptsdir' in l or 'Write-Host' in l:
        print(f'{i}: {l}')
PY

echo "== line endings =="
python3 - <<'PY'
from pathlib import Path
for p in ['bucket/theia-ide.json','scripts/theia-ide/install-context.reg','scripts/theia-ide/uninstall-context.reg']:
    data=Path(p).read_bytes()
    has_crlf=b'\r\n' in data
    has_lf=b'\n' in data
    lf_without_crlf=has_lf and not has_crlf
    print(f'{p}: CRLF={has_crlf} LF={has_lf} LF_without_CRLF={lf_without_crlf}')
PY

echo "== PowerShell reg import error behavior =="
if command -v pwsh >/dev/null 2>&1; then
  pwsh -NoProfile -NonInteractive -Command '
    Set-StrictMode -Version Latest
    $hasReg=if ($env:windir -and (Test-Path "$env:windir\system32\reg.exe")){1}else{0}
    Write-Host "Available reg.exe: $hasReg"
    try {
      $output=& reg import "C:\ThisDoesNotExist.reg" 2>&1
      Write-Host "LastExitCode: $LASTEXITCODE"
      Write-Host "Output: $output"
    } catch {
      Write-Host "Caught exception in try block"
      Write-Host $_.FullyQualifiedErrorId
    }
    if (Test-Path C:\ThisDoesNotExist.reg -PathType Leaf) { Remove-Item C:\ThisDoesNotExist.reg -Force }
  '
else
  echo "pwsh not available"
fi

echo "== comparable manifests handling context reg import =="
python3 - <<'PY'
import json, re
needles = re.compile(r"reg import|reg import|\.reg'")
for p in ['uninstall-context.reg','install-context.reg']:
    pass
files = list(Path('scripts').glob('*/*.ps1')) + list(Path('scripts').glob('*/*.psm1'))
for p in files:
    txt=p.read_text(encoding='utf-8-sig')
    if 'reg import' in txt:
        print(f'--- {p} ---')
        for i,line in enumerate(txt.splitlines(),1):
            if 'reg import' in line:
                print(f'{i}: {line}')
PY

Repository: ScoopInstaller/Extras

Length of output: 1343


🌐 Web query:

PowerShell call operator ampersand non-existent command CommandNotFoundException

💡 Result:

When you use the PowerShell call operator (&) to execute a command that does not exist, PowerShell raises a CommandNotFoundException [1][2]. ### Understanding the Error By default, this is a non-terminating error [1][2]. This means that if the command fails, the PowerShell script or pipeline will continue executing the subsequent lines [1]. The error is reported to the error stream, but it does not stop the execution flow of your script [1][2]. ### How to Handle It If you need to treat this error as a terminating error or perform custom handling, you have several options: 1. Use $ErrorActionPreference: You can globally change the behavior by setting $ErrorActionPreference = 'Stop'. This will escalate all non-terminating errors, including CommandNotFoundException, into terminating errors [1][2]. powershell $ErrorActionPreference = 'Stop' & non_existent_command # This will now throw a terminating error 2. Use try/catch blocks: If you want to handle the error gracefully within a specific section of your code, wrap the call in a try/catch block. Note that you must either set $ErrorActionPreference to 'Stop' or use the -ErrorAction Stop parameter on the command for it to be caught [1][2]. powershell try { & non_existent_command -ErrorAction Stop } catch [System.Management.Automation.CommandNotFoundException] { Write-Warning "Command not found, skipping..." } 3. Global CommandNotFoundAction: For advanced scenarios, you can define a custom hook that runs whenever any command is not found [3][4]. This is set via the $ExecutionContext.InvokeCommand.CommandNotFoundAction property [3][4]. powershell $ExecutionContext.InvokeCommand.CommandNotFoundAction = { param($Name, $EventArgs) Write-Error "Command '$Name' was not found." $EventArgs.StopSearch = $true } ### Common Causes of Unexpected CommandNotFoundException * Path Parsing Issues: If your path contains spaces and is not properly quoted, PowerShell may truncate the path at the space, causing it to look for a partial command that does not exist [5][6]. Always ensure full paths are quoted, such as & "C:\Path With Spaces\script.exe". * Incorrect Input: If the expression after the & operator does not evaluate to a string, script block, or CommandInfo object, you may encounter an InvalidOperation error instead [7][8]. Ensure the variable or expression correctly resolves to the path or object you intend to execute [7].

Citations:


Fail clearly when registry integration cannot be completed.

reg import is invoked without checking failures, so missing scripts/templates, absent install-context.reg, or registry failures can leave Scoop reporting success while the context menu entries are not installed/removed. Require the scripts/theia-ide registry templates before copying and check the native command result for both install and uninstall imports, failing when registry integration cannot be completed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bucket/theia-ide.json` around lines 17 - 40, Update the post_install and
uninstaller scripts to fail explicitly when registry integration cannot
complete: require the expected scripts/theia-ide registry templates and
install-context.reg before copying or importing, and validate the native reg
import result for both install and uninstall, propagating failure instead of
allowing Scoop to report success.

"extract_dir": "$PLUGINSDIR",
"installer": {
"script": "Expand-7zipArchive \"$dir\\app-64.7z\" \"$dir\" -Removal"
Expand Down
17 changes: 17 additions & 0 deletions scripts/theia-ide/install-context.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Windows Registry Editor Version 5.00

; Register context menu entry: 'Open with Theia IDE'

[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with &Theia IDE]
@="Open with &Theia IDE"
"Icon"="{{theia_dir}}\\TheiaIDE.exe"

[HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with &Theia IDE\command]
@="\"{{theia_dir}}\\TheiaIDE.exe\" \"%V\""

[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Open with &Theia IDE]
@="Open with &Theia IDE"
"Icon"="{{theia_dir}}\\TheiaIDE.exe"

[HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Open with &Theia IDE\command]
@="\"{{theia_dir}}\\TheiaIDE.exe\" \"%V\""
7 changes: 7 additions & 0 deletions scripts/theia-ide/uninstall-context.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Windows Registry Editor Version 5.00

; Unregister context menu entry: 'Open with Theia IDE'

[-HKEY_CURRENT_USER\Software\Classes\Directory\shell\Open with &Theia IDE]

[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\Open with &Theia IDE]
Loading