Syntax highlighting fixes, autocomplete overhaul, tui changes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { useState, useEffect, useRef } from 'react';
|
||||
import { Editor } from '@monaco-editor/react';
|
||||
import { registerMonacoCompletions } from '../utils/monacoCompletions';
|
||||
import { registerMonacoCompletions, getMonacoLanguage, getLanguageFileName } from '../utils/monacoCompletions';
|
||||
import {
|
||||
getChallenges,
|
||||
runCode,
|
||||
@@ -184,7 +184,7 @@ const Workspace: React.FC<WorkspaceProps> = ({ challengeId, onBack }) => {
|
||||
const inputToSend = overrideStdin !== undefined ? overrideStdin : stdinText;
|
||||
|
||||
try {
|
||||
const res = await runCode(currentChallenge.language.toLowerCase() || 'python', code, inputToSend);
|
||||
const res = await runCode(getMonacoLanguage(currentChallenge.language), code, inputToSend);
|
||||
if (res.exit_code === 0) {
|
||||
setOutput({
|
||||
status: 'success',
|
||||
@@ -210,7 +210,7 @@ const Workspace: React.FC<WorkspaceProps> = ({ challengeId, onBack }) => {
|
||||
setIsLinting(true);
|
||||
setOutput({ status: 'idle', text: 'Running syntax & style lint...' });
|
||||
try {
|
||||
const res = await lintCode(currentChallenge.language.toLowerCase() || 'python', code);
|
||||
const res = await lintCode(getMonacoLanguage(currentChallenge.language), code);
|
||||
if (res.exit_code === 0) {
|
||||
setOutput({ status: 'success', text: '✓ Syntax & Style clean! No linting errors detected.' });
|
||||
} else {
|
||||
@@ -237,7 +237,7 @@ const Workspace: React.FC<WorkspaceProps> = ({ challengeId, onBack }) => {
|
||||
try {
|
||||
const res = await getGuidance(
|
||||
cid,
|
||||
currentChallenge.language.toLowerCase() || 'python',
|
||||
getMonacoLanguage(currentChallenge.language),
|
||||
code,
|
||||
q
|
||||
);
|
||||
@@ -519,7 +519,7 @@ const Workspace: React.FC<WorkspaceProps> = ({ challengeId, onBack }) => {
|
||||
{/* Middle Column: Monaco Code Editor & Resizable Output Console */}
|
||||
<div className="flex-1 flex flex-col bg-[#1e1e1e] overflow-hidden min-w-0 min-h-0">
|
||||
<div className="bg-darkBg text-gray-400 px-4 py-2 text-xs flex justify-between items-center border-b border-darkBorder shrink-0">
|
||||
<span className="font-mono text-blue-400">main.py</span>
|
||||
<span className="font-mono text-blue-400">{getLanguageFileName(currentChallenge?.language)}</span>
|
||||
<span className="text-[11px] text-gray-500">TactiTerm IDE</span>
|
||||
</div>
|
||||
|
||||
@@ -527,8 +527,8 @@ const Workspace: React.FC<WorkspaceProps> = ({ challengeId, onBack }) => {
|
||||
<div className="flex-1 min-h-0 relative">
|
||||
<Editor
|
||||
height="100%"
|
||||
defaultLanguage={currentChallenge?.language.toLowerCase() || 'python'}
|
||||
language={currentChallenge?.language.toLowerCase() || 'python'}
|
||||
defaultLanguage={getMonacoLanguage(currentChallenge?.language)}
|
||||
language={getMonacoLanguage(currentChallenge?.language)}
|
||||
defaultValue=""
|
||||
value={code}
|
||||
theme="vs-dark"
|
||||
|
||||
Reference in New Issue
Block a user