Multi line text editor decoration using vscode.window.createTextEditorDecorationType()

I am trying to create a simple extension. This extension displays some text on an active text editor as ghost text only when the editor is empty, i.e., there is no text typed into the editor. But the moment something is typed in the editor, the ghost text must disappear and once again reappear when anything that has been typed is deleted out.

I do not have an extensive knowledge on ways to achieve this, so I used text decoration to achieve this. For this, I wrote the below code inside the activate() function:

const placeholderText='Hi! The extension is working!nn This should be the third linen And this the fourthnAnd this the fifthnBye bye!nnThis text will automatically disappear as you start typing!';

const placeholderDecorationType = vscode.window.createTextEditorDecorationType({
        after: { contentText: placeholderText, color: new vscode.ThemeColor('editorCodeLens.foreground') },
    });

const updatePlaceholderDecorations = () => {
        vscode.window.visibleTextEditors.forEach((editor) => {
            const decorations: vscode.DecorationOptions[] = [];
            if (editor.document.getText().trim().length === 0) {
                decorations.push({ range: new vscode.Range(0, 0, 0, 0) });
            }
            editor.setDecorations(placeholderDecorationType, decorations);
        });
    };

const disposable1 = vscode.window.onDidChangeVisibleTextEditors(updatePlaceholderDecorations);
const disposable2 = vscode.workspace.onDidChangeTextDocument((event) => {
    if (event.contentChanges.length > 0) {
        updatePlaceholderDecorations();
    }
});

context.subscriptions.push(disposable1, disposable2);

I am expecting the text to appear over multiple lines but the final output seems to appear only in the first line as shown below:

And this text disappears on typing anything as expected and returns when the typed text is removed as shown below:

The font style and colour and everything is just as I want it to be but I just want the text to appear over multiple lines. I have demonstrated the expected result below by manually typing it but I want this to appear in the way it looks in the previous screenshots attached above:

So, please let me know the following:

  1. What modification do I need to make in order to get the text decoration over multiple lines instead of a single line?
  2. Or, is there a better way to achieve this same functionality by a different method. If so, please let me know how.
  3. Also, I noticed that the decoration text does not appear until I actually kill the integrated terminal that automatically appears? Closing the terminal alone is not enough and I have to kill the terminal for the text to appear. Is there a way to solve this?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật