Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3f1c60c
feat: Added new strings
claycuy Jul 9, 2026
9faf893
feat: New strings
claycuy Jul 9, 2026
08a6eb8
fix
claycuy Jul 9, 2026
176dca0
fix: Missing string key
claycuy Jul 9, 2026
f9d402a
feat(sponsors): Added new strings
claycuy Jul 9, 2026
ed4a69b
format
claycuy Jul 9, 2026
5dd0fc0
feat(sponsors): Added new strings
claycuy Jul 9, 2026
e80fa97
feat(lsp dialog): Added new strings
claycuy Jul 9, 2026
9f096d6
fix: Wrong string key value
claycuy Jul 9, 2026
97bfa7c
fix: Wrong string key value
claycuy Jul 9, 2026
32263b2
feat: Added new strings
claycuy Jul 9, 2026
3722cfb
linting
claycuy Jul 9, 2026
a172d63
fix: hyphenated keys
claycuy Jul 9, 2026
7143387
feat: Added some new strings
claycuy Jul 9, 2026
0496d3a
i18n(id): Translate new key
claycuy Jul 9, 2026
6d65f1b
fix: Status label
claycuy Jul 9, 2026
03f7432
fix: Missing key
claycuy Jul 9, 2026
7c7299d
i18n(id): Translate key
claycuy Jul 9, 2026
b4c7d75
Merge branch 'Acode-Foundation:main' into feat/new-strings
claycuy Jul 9, 2026
5ba2092
feat: Added missing key
claycuy Jul 9, 2026
214bfbe
feat: Added missing key
claycuy Jul 9, 2026
27f511e
Merge branch 'Acode-Foundation:main' into feat/new-strings
claycuy Jul 9, 2026
8a1d630
Merge branch 'Acode-Foundation:main' into feat/new-strings
claycuy Jul 10, 2026
7871741
fix merge conflicts
claycuy Jul 10, 2026
bf45a50
Merge branch 'main' into feat/new-strings
claycuy Jul 10, 2026
88fc777
fix merge conflicts
claycuy Jul 10, 2026
94846d6
fix linting error
claycuy Jul 10, 2026
bc25ccb
Merge branch 'main' into feat/new-strings
claycuy Jul 10, 2026
e501397
i18n: Generate typings
claycuy Jul 10, 2026
171f9e7
format
claycuy Jul 10, 2026
79526a7
fix
claycuy Jul 10, 2026
3b9083f
fix merge conflicts
claycuy Jul 10, 2026
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
109 changes: 76 additions & 33 deletions src/components/lspInfoDialog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ function getServerStatus(serverId) {
}
}

function getStatusLabel(status) {
const map = {
active: strings["lsp:active status"],
connecting: strings["lsp:connecting status"],
stopped: strings["lsp:stopped status"],
};
return map[status] || status;
}

function getClientState(serverId) {
const activeClients = getActiveClients();
return activeClients.find((c) => c.server?.id === serverId) || null;
Expand All @@ -51,7 +60,7 @@ function getStatusColor(status) {
function copyLogsToClipboard(serverId, serverLabel) {
const logs = getLspLogs(serverId);
if (logs.length === 0) {
toast("No logs to copy");
toast(strings["lsp:no logs to copy"]);
return;
}

Expand All @@ -71,18 +80,18 @@ function copyLogsToClipboard(serverId, serverLabel) {

if (navigator.clipboard?.writeText) {
navigator.clipboard.writeText(header + text).catch(() => {
toast("Failed to copy");
toast(strings["lsp:failed to copy"]);
});
} else if (cordova?.plugins?.clipboard) {
cordova.plugins.clipboard.copy(header + text);
} else {
toast("Clipboard not available");
toast(strings["lsp:clipboard not available"]);
}
}

async function restartServer(serverId) {
addLspLog(serverId, "info", "Restart requested by user");
toast("Restarting server...");
toast(strings["lsp:restarting server"]);

try {
const clientState = getClientState(serverId);
Expand All @@ -96,16 +105,16 @@ async function restartServer(serverId) {
window.editorManager?.restartLsp?.();

addLspLog(serverId, "info", "Server restarted successfully");
toast("Server restarted");
toast(strings["lsp:server restarted"]);
} catch (err) {
addLspLog(serverId, "error", `Restart failed: ${err.message}`);
toast("Restart failed");
toast(strings["lsp:restart failed"]);
}
}

async function stopServer(serverId) {
addLspLog(serverId, "info", "Stop requested by user");
toast("Stopping...");
toast(strings["lsp:stopping"]);

try {
const clientState = getClientState(serverId);
Expand All @@ -117,20 +126,20 @@ async function stopServer(serverId) {
stopManagedServer(serverId);

addLspLog(serverId, "info", "Server stopped");
toast("Server stopped");
toast(strings["lsp:server stopped"]);
} catch (err) {
addLspLog(serverId, "error", `Stop failed: ${err.message}`);
toast("Failed to stop");
toast(strings["lsp:failed to stop"]);
}
}

async function startAllServers() {
toast("Starting LSP servers...");
toast(strings["lsp:starting lsp servers"]);
try {
window.editorManager?.restartLsp?.();
toast("Servers started");
toast(strings["lsp:servers started"]);
} catch (err) {
toast("Failed to start servers");
toast(strings["lsp:failed to start servers"]);
}
}

Expand All @@ -142,31 +151,43 @@ async function restartAllServers() {
}

const count = activeClients.length;
toast(`Restarting ${count} LSP server${count > 1 ? "s" : ""}...`);
const key =
count > 1
? "lsp:restarting lsp server plural"
: "lsp:restarting lsp server singular";
const message = strings[key].replace("{count}", count);

toast(message);

try {
await lspClientManager.dispose();
window.editorManager?.restartLsp?.();
toast("All servers restarted");
toast(strings["lsp:all servers restarted"]);
} catch (err) {
toast("Failed to restart servers");
toast(strings["lsp:failed to restart servers"]);
}
}

async function stopAllServers() {
const activeClients = getActiveClients();
if (!activeClients.length) {
toast("No LSP servers are currently running");
toast(strings["lsp:no lsp servers are currently running"]);
return;
}

const count = activeClients.length;

try {
await lspClientManager.dispose();
toast(`Stopped ${count} LSP server${count > 1 ? "s" : ""}`);
const key =
count > 1
? "lsp:stopped lsp server plural"
: "lsp:stopped lsp server singular";
const message = strings[key].replace("{count}", count);

toast(message);
} catch (err) {
toast("Failed to stop servers");
toast(strings["lsp:failed to stop servers"]);
}
}

Expand All @@ -187,7 +208,7 @@ function showLspInfoDialog() {
<div className="prompt lsp-info-dialog">
<div className="title">
<span className="icon zap" style={{ marginRight: "8px" }} />
Language Servers
{strings["lsp:language servers"]}
</div>
<div className="lsp-dialog-body" />
</div>
Expand Down Expand Up @@ -230,7 +251,9 @@ function showLspInfoDialog() {
}}
>
<span className="icon autorenew" />
<span>{hasRunning ? "Restart All" : "Start All"}</span>
<span>
{hasRunning ? strings["lsp:restart all"] : strings["lsp:start all"]}
</span>
</button>
{hasRunning && (
<button
Expand All @@ -242,7 +265,7 @@ function showLspInfoDialog() {
}}
>
<span className="icon power_settings_new" />
<span>Stop All</span>
<span>{strings["lsp:stop all"]}</span>
Comment thread
greptile-apps[bot] marked this conversation as resolved.
</button>
)}
</div>
Expand Down Expand Up @@ -270,7 +293,7 @@ function showLspInfoDialog() {
/>
<div className="lsp-server-info">
<span className="lsp-server-name">{server.label}</span>
<span className="lsp-server-status">{status}</span>
<span className="lsp-server-status">{getStatusLabel(status)}</span>
</div>
{errorCount > 0 && (
<span className="lsp-error-badge">{errorCount}</span>
Expand Down Expand Up @@ -312,6 +335,22 @@ function showLspInfoDialog() {
capabilities.push("Diagnostics");
}

function getCapabilityLabel(capability) {
const map = {
Completion: strings["lsp:capabilities completion"],
Hover: strings["lsp:capabilities hover"],
"Go to Definition": strings["lsp:capabilities definition"],
"Find References": strings["lsp:capabilities references"],
Rename: strings["lsp:capabilities rename"],
Format: strings["lsp:capabilities format"],
"Signature Help": strings["lsp:capabilities signature"],
"Inlay Hints": strings["lsp:capabilities inlay hints"],
"Code Actions": strings["lsp:capabilities code actions"],
Diagnostics: strings["lsp:capabilities diagnostics"],
};
return map[capability] || capability;
}

const logs = getLspLogs(server.id);

const $details = (
Expand Down Expand Up @@ -369,21 +408,25 @@ function showLspInfoDialog() {

{isRunning && (
<div className="lsp-section">
<div className="lsp-section-label">Capabilities</div>
<div className="lsp-section-label">
{strings["lsp:capabilities"]}
</div>
<div className="lsp-chip-container">
{capabilities.length > 0
? capabilities.map((cap) => (
<span className="lsp-chip">{cap}</span>
<span className="lsp-chip">{getCapabilityLabel(cap)}</span>
))
: !hasCapabilities && (
<span className="lsp-chip">Initializing...</span>
<span className="lsp-chip">
{strings["lsp:capabilities initializing"]}
</span>
)}
</div>
</div>
)}

<div className="lsp-section">
<div className="lsp-section-label">Supported</div>
<div className="lsp-section-label">{strings["lsp:supported"]}</div>
<div className="lsp-chip-container">
{server.languages.map((lang) => (
<span className="lsp-chip ext">.{lang}</span>
Expand All @@ -393,25 +436,25 @@ function showLspInfoDialog() {

{isRunning && (
<div className="lsp-section">
<div className="lsp-section-label">Project</div>
<div className="lsp-section-label">{strings["lsp:project"]}</div>
<div className="lsp-project-path">
{clientState?.rootUri || "(workspace folders mode)"}
{clientState?.rootUri || strings["lsp:workspace folders mode"]}
</div>
</div>
)}

{isRunning && (
<div className="lsp-section">
<div className="lsp-section-label">Resources</div>
<div className="lsp-section-label">{strings["lsp:resources"]}</div>
<div className="lsp-stats-container">
<div className="lsp-stat">
<span className="lsp-stat-label">Memory</span>
<span className="lsp-stat-label">{strings["lsp:memory"]}</span>
<span className="lsp-stat-value" id={`lsp-mem-${server.id}`}>
—
</span>
</div>
<div className="lsp-stat">
<span className="lsp-stat-label">Uptime</span>
<span className="lsp-stat-label">{strings["lsp:uptime"]}</span>
<span className="lsp-stat-value" id={`lsp-uptime-${server.id}`}>
—
</span>
Expand Down Expand Up @@ -448,7 +491,7 @@ function showLspInfoDialog() {
>
<div className="lsp-logs-title">
<span className="icon expand_more lsp-expand-icon" />
<span>LSP Logs</span>
<span>{strings["lsp:logs"]}</span>
{logs.length > 0 && (
<span className="lsp-log-count">({logs.length})</span>
)}
Expand Down Expand Up @@ -483,7 +526,7 @@ function showLspInfoDialog() {
</div>
<div className="lsp-logs-container">
{logs.length === 0 ? (
<div className="lsp-logs-empty">No logs yet</div>
<div className="lsp-logs-empty">{strings["lsp:no logs yet"]}</div>
) : (
logs.slice(-50).map((log) => {
const time = log.timestamp.toLocaleTimeString("en-US", {
Expand Down
73 changes: 72 additions & 1 deletion src/lang/ar-ye.json
Original file line number Diff line number Diff line change
Expand Up @@ -811,5 +811,76 @@
"hour plural": "{count} hours ago",
"min plural": "{count} minutes ago",
"settings-category-builtin-servers": "Built-in servers",
"settings-category-plugin-servers": "Plugin servers"
"settings-category-plugin-servers": "Plugin servers",
"new name": "New name",
"enter new name": "Enter new name",
"code actions": "Code Actions",
"active processes": "Active Processes",
"total memory": "Total Memory",
"uptime": "Uptime",
"note": "Note",
"acode main process": "Acode main process",
"ppid parent": "PPID (Parent)",
"unknown": "Unknown",
"just started": "Just Started",
"diff days": "{days}d {hr}h ago",
"diff hr": "{hr}h {min}m ago",
"diff min": "{min}m {sec}s ago",
"diff sec": "{sec}s ago",
"command": "Command",
"managed": "Managed",
"acode service": "Acode Service",
"sponsors": "Sponsors",
"sponsors:join-our-community": "Join our community of supporters and help shape the future of mobile development",
"sponsors:become-a-sponsor": "Become a Sponsor",
"sponsors:acode-sponsors": "Acode's SponsorsAcode's Sponsors",
"sponsors:be-the-first": "Be the first {tier} Sponsor!",
"unable to load sponsors": "Unable to load sponsors...",
"lsp:clipboard not available": "Clipboard not available",
"lsp:restarting server": "Restarting server...",
"lsp:no logs to copy": "No logs to copy",
"lsp:failed to copy": "Failed to copy",
"lsp:server restarted": "Server restarted",
"lsp:restart failed": "Restart failed",
"lsp:stopping": "Stopping...",
"lsp:server stopped": "Server stopped",
"lsp:failed to stop": "Failed to stop",
"lsp:servers started": "Servers started",
"lsp:starting lsp servers": "Starting LSP servers...",
"lsp:failed to start servers": "Failed to start servers",
"lsp:failed to stop servers": "Failed to stop servers",
"lsp:no lsp servers are currently running": "No LSP servers are currently running",
"lsp:failed to restart servers": "Failed to restart servers",
"lsp:restarting lsp server singular": "Restarting {count} LSP server...",
"lsp:restarting lsp server plural": "Restarting {count} LSP servers...",
"lsp:stopped lsp server singular": "Stopped {count} LSP server",
"lsp:stopped lsp server plural": "Stopped {count} LSP servers",
"lsp:restart all": "Restart All",
"lsp:start all": "Start All",
"lsp:supported": "Supported",
"lsp:logs": "LSP logs",
"lsp:stopped status": "stopped",
"lsp:active status": "active",
"lsp:connecting status": "connecting",
"lsp:stop all": "Stop All",
"lsp:all servers restarted": "All servers restarted",
"lsp:language servers": "Language Servers",
"lsp:project": "Project",
"lsp:capabilities": "Capabilities",
"lsp:capabilities initializing": "Initializing...",
"lsp:memory": "Memory",
"lsp:uptime": "Uptime",
"lsp:capabilities completion": "Completion",
"lsp:capabilities hover": "Hover",
"lsp:capabilities definition": "Go to Definition",
"lsp:capabilities references": "Find References",
"lsp:capabilities rename": "Rename",
"lsp:capabilities format": "Format",
"lsp:capabilities signature": "Signature Help",
"lsp:capabilities inlay hints": "Inlay Hints",
"lsp:capabilities code actions": "Code Actions",
"lsp:capabilities diagnostics": "Diagnostics",
"lsp:workspace folders mode": "(workspace folders mode)",
"lsp:resources": "Resources",
"lsp:no logs yet": "No logs yet"
}
Loading