2020-08-15 04:58:31 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
|
2022-02-15 17:28:01 -03:00
|
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
2020-08-15 04:58:31 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-08-15 04:58:31 -03:00
|
|
|
*/
|
2020-08-17 10:22:30 -03:00
|
|
|
|
2020-08-15 04:58:31 -03:00
|
|
|
#include "CodeDocument.h"
|
|
|
|
|
|
2020-08-17 10:22:30 -03:00
|
|
|
namespace HackStudio {
|
|
|
|
|
|
2022-04-01 14:58:27 -03:00
|
|
|
NonnullRefPtr<CodeDocument> CodeDocument::create(String const& file_path, Client* client)
|
2020-09-26 18:11:15 -03:00
|
|
|
{
|
2021-04-23 11:46:57 -03:00
|
|
|
return adopt_ref(*new CodeDocument(file_path, client));
|
2020-09-26 18:11:15 -03:00
|
|
|
}
|
|
|
|
|
|
2020-08-15 04:58:31 -03:00
|
|
|
NonnullRefPtr<CodeDocument> CodeDocument::create(Client* client)
|
|
|
|
|
{
|
2021-04-23 11:46:57 -03:00
|
|
|
return adopt_ref(*new CodeDocument(client));
|
2020-08-15 04:58:31 -03:00
|
|
|
}
|
2020-08-17 10:22:30 -03:00
|
|
|
|
2022-04-01 14:58:27 -03:00
|
|
|
CodeDocument::CodeDocument(String const& file_path, Client* client)
|
2020-09-26 18:11:15 -03:00
|
|
|
: TextDocument(client)
|
|
|
|
|
, m_file_path(file_path)
|
|
|
|
|
{
|
2022-01-18 00:42:07 -03:00
|
|
|
auto lexical_path = LexicalPath(file_path);
|
|
|
|
|
m_language = language_from_file(lexical_path);
|
|
|
|
|
m_language_name = language_name_from_file(lexical_path);
|
2020-09-26 18:11:15 -03:00
|
|
|
}
|
|
|
|
|
|
2020-08-15 04:58:31 -03:00
|
|
|
CodeDocument::CodeDocument(Client* client)
|
|
|
|
|
: TextDocument(client)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-17 10:22:30 -03:00
|
|
|
}
|