Просмотр исходного кода

Syntax highlighting changes based on what file you are editing (#1176)

Co-authored-by: Robert Brennan <accounts@rbren.io>
Justus 1 год назад
Родитель
Сommit
8472436fe8
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      frontend/src/components/CodeEditor.tsx

+ 5 - 1
frontend/src/components/CodeEditor.tsx

@@ -61,7 +61,11 @@ function CodeEditor(): JSX.Element {
         <div className="flex grow">
           <Editor
             height="100%"
-            defaultLanguage="python"
+            path={
+              selectedFileName === ""
+                ? "welcome.txt"
+                : selectedFileName.toLocaleLowerCase()
+            }
             defaultValue="# Welcome to OpenDevin!"
             value={code}
             onMount={handleEditorDidMount}