1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:37:44 +00:00

HackStudio: Use Syntax::Language instead of our own one

The one behavior difference here is that the statusbar used to display
"Unknown" for unknown file types, and "Markdown" for md, but we now
display "Plain Text" for all file types without syntax highlighters.
This commit is contained in:
Sam Atkins 2023-03-08 20:59:05 +00:00 committed by Sam Atkins
parent ffce6cc977
commit 08c1effc04
9 changed files with 35 additions and 160 deletions

View file

@ -7,9 +7,9 @@
#pragma once
#include "Language.h"
#include <AK/LexicalPath.h>
#include <LibGUI/TextDocument.h>
#include <LibSyntax/Language.h>
namespace HackStudio {
@ -25,8 +25,7 @@ public:
void set_execution_position(size_t line) { m_execution_position = line; }
void clear_execution_position() { m_execution_position.clear(); }
DeprecatedString const& file_path() const { return m_file_path; }
DeprecatedString const& language_name() const { return m_language_name; };
Language language() const { return m_language; }
Optional<Syntax::Language> const& language() const { return m_language; }
virtual bool is_code_document() const override final { return true; }
@ -35,8 +34,7 @@ private:
explicit CodeDocument(Client* client = nullptr);
DeprecatedString m_file_path;
DeprecatedString m_language_name;
Language m_language { Language::Unknown };
Optional<Syntax::Language> m_language;
Vector<size_t> m_breakpoint_lines;
Optional<size_t> m_execution_position;
};