Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
Renamed noInitJustStart to start
Browse files Browse the repository at this point in the history
  • Loading branch information
kaisalmen committed Nov 26, 2023
1 parent 43bd86d commit 1b3c6cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/monaco-editor-react/src/index.tsx
Expand Up @@ -140,7 +140,7 @@ export class MonacoEditorReactComp<T extends MonacoEditorProps = MonacoEditorPro
if (this.containerElement) {
this.containerElement.className = className ?? '';

await this.wrapper.noInitJustStart(this.containerElement);
await this.wrapper.start(this.containerElement);
this.started();
this.isRestarting = undefined;

Expand Down
6 changes: 3 additions & 3 deletions packages/monaco-editor-wrapper/src/wrapper.ts
Expand Up @@ -92,15 +92,15 @@ export class MonacoEditorLanguageClientWrapper {
*/
async initAndStart(userConfig: UserConfig, htmlElement: HTMLElement | null) {
await this.init(userConfig);
await this.noInitJustStart(htmlElement);
await this.start(htmlElement);
}

/**
* Does not perform any user configuration or other application init and just starts the application.
*/
async noInitJustStart(htmlElement: HTMLElement | null) {
async start(htmlElement: HTMLElement | null) {
if (!this.initDone) {
throw new Error('No init was performed. Please call init() before noInitJustStart()');
throw new Error('No init was performed. Please call init() before start()');
}
if (!htmlElement) {
throw new Error('No HTMLElement provided for monaco-editor.');
Expand Down
4 changes: 2 additions & 2 deletions packages/monaco-editor-wrapper/test/wrapper.test.ts
Expand Up @@ -42,8 +42,8 @@ describe('Test MonacoEditorLanguageClientWrapper', () => {
createMonacoEditorDiv();
const wrapper = new MonacoEditorLanguageClientWrapper();
await expect(async () => {
await wrapper.noInitJustStart(document.getElementById('monaco-editor-root'));
}).rejects.toThrowError('No init was performed. Please call init() before noInitJustStart()');
await wrapper.start(document.getElementById('monaco-editor-root'));
}).rejects.toThrowError('No init was performed. Please call init() before start()');
});

test('Expected throw: Call normal start with prior init', async () => {
Expand Down

0 comments on commit 1b3c6cf

Please sign in to comment.