Skip to content

How to open a workspace? #470

Description

@abentkamp

By default, no workspace seems to be open. How can I open a workspace?

For instance:

  const wrapper = new MonacoEditorLanguageClientWrapper();
  const userConfig : UserConfig = {
    wrapperConfig: {
      editorAppConfig: {
        $type: 'extended',
        codeResources: {
          main: {
            text: 'print("Hello, World!")',
            uri: '/workspace/hello.py'
          }
        }
      }
    }
  };

  const htmlElement = document.getElementById('monaco-editor-root');
  await wrapper.initAndStart(userConfig, htmlElement);

  workspace.getConfiguration('editor').update('tabSize', 5)

yields:

Uncaught CodeExpectedError: Unable to write to Workspace Settings because no workspace is opened. Please open a workspace first and try again.

Here is an example repo: https://github.com/abentkamp/monacotest3/tree/workspace

Thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions