Serenity Operating System
at master 35 lines 820 B view raw
1/* 2 * Copyright (c) 2020, Itamar S. <itamar8910@gmail.com> 3 * Copyright (c) 2022, the SerenityOS developers. 4 * 5 * SPDX-License-Identifier: BSD-2-Clause 6 */ 7 8#include "CodeDocument.h" 9 10namespace HackStudio { 11 12NonnullRefPtr<CodeDocument> CodeDocument::create(DeprecatedString const& file_path, Client* client) 13{ 14 return adopt_ref(*new CodeDocument(file_path, client)); 15} 16 17NonnullRefPtr<CodeDocument> CodeDocument::create(Client* client) 18{ 19 return adopt_ref(*new CodeDocument(client)); 20} 21 22CodeDocument::CodeDocument(DeprecatedString const& file_path, Client* client) 23 : TextDocument(client) 24 , m_file_path(file_path) 25{ 26 auto lexical_path = LexicalPath(file_path); 27 m_language = Syntax::language_from_filename(lexical_path); 28} 29 30CodeDocument::CodeDocument(Client* client) 31 : TextDocument(client) 32{ 33} 34 35}