swyddfa / esbonio

A language server for working with Sphinx projects.
https://docs.esbon.io/
121 stars 21 forks source link

Server does not automatically discover a project in a sub-folder of the workspace #779

Closed alcarney closed 2 months ago

alcarney commented 2 months ago

Expected behavior

Esbonio should be able to automatically find a Sphinx project located in a sub-folder e.g. ${workspaceFolder}/docs and make a reasonable guess at what the sphinx-build command should be.

This can be worked around by setting esbonio.sphinx.buildCommand in either the language client or a pyproject.toml file, but it would be ideal to not have to configure the server upfront.

Actual behavior

The server searches for conf.py in ${workspaceFolder} and all parent folders, missing the conf.py located under docs/. This is due to self.server.configuration.scope_for(uri) returning ${workspaceFolder} as the configuration scope :thinking:

Log output

No response

(Optional) Settings from conf.py

No response

neongreen-sc commented 2 months ago

Seems like it used to work in 0.92 and broke after the upgrade to 0.93.

I have docs in {workspaceRoot}/.../.../.../.../docs/. My expectation is that if I try to edit or preview an .rst file, Esbonio should start walking up from that file until it sees a Sphinx folder root. It shouldn't have to discover all Sphinx projects in the entire workspace.

alcarney commented 2 months ago

Seems like it used to work in 0.92 and broke after the upgrade to 0.93.

Yes, #744 rewrote the sphinx process handling to be more robust, but unfortunately, introduced this bug.

My expectation is that if I try to edit or preview an .rst file, Esbonio should start walking up from that file until it sees a Sphinx folder root.

That is the logic the server uses, the problem is that it's currently choosing a starting point too high in the folder hierarchy and missing the Sphinx project entirely :facepalm:

I have docs in {workspaceRoot}/.../.../.../.../docs/.

You may want to consider adding your docs folder as another root within your workspace. Esbonio and the language server protocol in general, (at least to my understanding) are going to make assumptions based on dealing with files that live within one of root folders of the workspace.

davbeek commented 2 months ago

I still have this issue, although not strictly this issue, because all files are at the top level of the workspace. I have followed all steps suggested in the Preview window (No Content Found).

alcarney commented 2 months ago

Based on seeing

[esbonio.SphinxManager] Client created for scope file:///Users/xxxxxx/1-repos/website/main
[esbonio.SphinxManager] SphinxClient[3795c6b8-3a6e-467c-921f-aeb25e2a1811]: None -> ClientState.Starting
[esbonio.SphinxManager] Starting sphinx agent: /Users/xxxxxx/miniconda3/bin/python -m sphinx_agent
[client] sphinx/clientCreated: {
  "id": "3795c6b8-3a6e-467c-921f-aeb25e2a1811",
  "scope": "file:///Users/xxxxxx/1-repos/website/main",
  "config": {
    "pythonCommand": [
      "/Users/xxxxxx/miniconda3/bin/python"
    ],
    "buildCommand": [
      "sphinx-build",
      "-M",
      "html",
      ".",
      "_build"
    ],
    "cwd": "/Users/xxxxxx/1-repos/website/main",
    "pythonPath": [
      "/Users/xxxxxx/.vscode/extensions/swyddfa.esbonio-0.94.0/bundled/libs/esbonio"
    ]
  }
}

and

Running Sphinx v7.2.6

in the logs, it looks like the server is correctly finding your project, but has not triggered any builds :thinking:

Unfortunately, I only have questions at this point :sweat_smile:

davbeek commented 2 months ago

Indeed, the server appears to be hanging for some reason. After a restart and saving a few times, I get:

[client] Starting Language Server
[esbonio] Initialising esbonio v1.0.0b3, using Python v3.12.1 on macOS-14.4.1
[esbonio] Language client: Visual Studio Code 1.89.0
[esbonio.Configuration] ConfigChangeEvent(scope='', value=LoggingConfig(level='info', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False), previous=None)
[esbonio.Configuration] ConfigChangeEvent(scope='', value=PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False), previous=None)
[esbonio.Configuration] ConfigChangeEvent(scope='', value=CompletionConfig(preferred_insert_behavior='replace'), previous=None)
[esbonio.Configuration] ConfigChangeEvent(scope='', value=CompletionConfig(preferred_insert_behavior='replace'), previous=None)
[esbonio.Configuration] ConfigChangeEvent(scope='file:///Users/dvbeek/1-repos/website/main', value=SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[]), previous=None)
Running Sphinx v7.2.6

Nothing else, no error messages of any kind and: image

davbeek commented 2 months ago

Somehow my logging level was set at info. Setting back to debug, I do get an error message after Sphinx. Also, to be sure I removed the "esbonio.sphinx.buildCommand":

[client] Unable to resolve command lsp-devtools: Error: Command failed: command -v lsp-devtools
[client] Using environment /Users/xxxxxx/miniconda3/bin/python: /Users/xxxxxx/miniconda3/bin/python
[client] Server start command: /Users/xxxxxx/miniconda3/bin/python -S -m esbonio.server
[client] LanguageClientOptions: {
  "documentSelector": [
    {
      "scheme": "file",
      "language": "restructuredtext"
    },
    {
      "scheme": "file",
      "language": "markdown"
    }
  ],
  "outputChannel": {
    "name": "Esbonio"
  },
  "connectionOptions": {
    "maxRestartCount": 0
  },
  "middleware": {
    "workspace": {},
    "window": {}
  }
}
[client] Starting Language Server
[client] Using environment /Users/xxxxxx/miniconda3/bin/python: /Users/xxxxxx/miniconda3/bin/python
[client] Using environment /Users/xxxxxx/miniconda3/bin/python: /Users/xxxxxx/miniconda3/bin/python
[esbonio] Loaded extension 'esbonio.server.features.log'
[esbonio] Loaded extension 'esbonio.server.features.project_manager'
[esbonio] Loaded extension 'esbonio.server.features.sphinx_manager'
[esbonio] Loaded extension 'esbonio.server.features.preview_manager'
[esbonio] Loaded extension 'esbonio.server.features.directives'
[esbonio] Loaded extension 'esbonio.server.features.roles'
[esbonio] Loaded extension 'esbonio.server.features.sphinx_support.diagnostics'
[esbonio] Loaded extension 'esbonio.server.features.sphinx_support.symbols'
[esbonio] Loaded extension 'esbonio.server.features.sphinx_support.directives'
[esbonio] Loaded extension 'esbonio.server.features.sphinx_support.roles'
[esbonio] Initialising esbonio v1.0.0b3, using Python v3.12.1 on macOS-14.4.1
[esbonio] Language client: Visual Studio Code 1.89.0
[esbonio.Configuration] Scanning workspace folder: '/Users/xxxxxx/1-repos/website/main'
[esbonio.Configuration] Found '/Users/xxxxxx/1-repos/website/main/pyproject.toml'
[esbonio.Configuration] File 'file:///Users/xxxxxx/1-repos/website/main' configuration: {
  "esbonio": {}
}
[esbonio.Configuration] workspace/configuration: {
  "items": [
    {
      "section": "esbonio"
    },
    {
      "scopeUri": "file:///Users/xxxxxx/1-repos/website/main",
      "section": "esbonio"
    }
  ]
}
[esbonio.SphinxManager] No client found, creating new subscription
[esbonio.Configuration] Workspace 'None' configuration: {
  "server": {
    "enabled": true,
    "documentSelector": [],
    "startupModule": "esbonio.server",
    "excludedModules": [],
    "includedModules": [],
    "completion": {
      "preferredInsertBehavior": "replace"
    },
    "enableDevTools": false,
    "debug": false,
    "showDeprecationWarnings": false
  },
  "sphinx": {
    "pythonCommand": [
      "/Users/xxxxxx/miniconda3/bin/python"
    ],
    "enableSyncScrolling": true,
    "enableDevTools": false,
    "pythonPath": []
  },
  "preview": {
    "showLineMarkers": false
  },
  "logging": {
    "level": "debug",
    "stderr": true,
    "window": false,
    "config": {}
  },
  "trace": {
    "server": "off"
  }
}
[esbonio.Configuration] Workspace 'file:///Users/xxxxxx/1-repos/website/main' configuration: {
  "server": {
    "enabled": true,
    "documentSelector": [],
    "startupModule": "esbonio.server",
    "excludedModules": [],
    "includedModules": [],
    "completion": {
      "preferredInsertBehavior": "replace"
    },
    "enableDevTools": false,
    "debug": false,
    "showDeprecationWarnings": false
  },
  "sphinx": {
    "pythonCommand": [
      "/Users/xxxxxx/miniconda3/bin/python"
    ],
    "enableSyncScrolling": true,
    "enableDevTools": false,
    "pythonPath": []
  },
  "preview": {
    "showLineMarkers": false
  },
  "logging": {
    "level": "debug",
    "stderr": true,
    "window": false,
    "config": {}
  },
  "trace": {
    "server": "off"
  }
}
[esbonio.Configuration] File scope: 'file:///Users/xxxxxx/1-repos/website/main'
[esbonio.Configuration] Workspace scope: 'file:///Users/xxxxxx/1-repos/website/main'
[esbonio.Configuration] Resolved config: {
  "enableDevTools": false,
  "pythonCommand": [
    "/Users/xxxxxx/miniconda3/bin/python"
  ],
  "enableSyncScrolling": true,
  "pythonPath": []
}
[esbonio.Configuration] SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] ConfigChangeEvent(scope='file:///Users/xxxxxx/1-repos/website/main', value=SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[]), previous=None)
[esbonio.SphinxManager] Trying path: /Users/xxxxxx/1-repos/website/main
[esbonio.SphinxManager] Cwd: /Users/xxxxxx/1-repos/website/main
[esbonio.SphinxManager] Build command: ['sphinx-build', '-M', 'dirhtml', '/Users/xxxxxx/1-repos/website/main', '/Users/xxxxxx/Library/Caches/esbonio/422b08b53fe0c924f6622ade34ee83d3']
[esbonio.SphinxManager] Client created for scope file:///Users/xxxxxx/1-repos/website/main
[esbonio.SphinxManager] SphinxClient[bcb8e189-a5c6-4b32-a16b-305b60a242df]: None -> ClientState.Starting
[esbonio.SphinxManager] Starting sphinx agent: /Users/xxxxxx/miniconda3/bin/python -m sphinx_agent
[esbonio] Registered 'workspace/didChangeConfiguration' handler
[esbonio] Registered 'workspace/didChangeWatchedFiles' handler
[esbonio.Configuration] File scope: 'file:///Users/xxxxxx/1-repos/website/main'
[esbonio.Configuration] Workspace scope: 'file:///Users/xxxxxx/1-repos/website/main'
[esbonio.Configuration] Resolved config: {
  "enableDevTools": false,
  "pythonCommand": [
    "/Users/xxxxxx/miniconda3/bin/python"
  ],
  "enableSyncScrolling": true,
  "pythonPath": []
}
[esbonio.Configuration] SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Previous: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Current: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "stderr": true,
  "config": {},
  "window": false
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] ConfigChangeEvent(scope='', value=LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False), previous=None)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] ConfigChangeEvent(scope='', value=PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False), previous=None)
[esbonio] Scheduled task: <Task pending name='Task-16' coro=<PreviewManager.show_preview_uri() running at /Users/xxxxxx/.vscode/extensions/swyddfa.esbonio-0.94.0/bundled/libs/esbonio/server/features/preview_manager/__init__.py:187>>
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] ConfigChangeEvent(scope='', value=CompletionConfig(preferred_insert_behavior='replace'), previous=None)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] ConfigChangeEvent(scope='', value=CompletionConfig(preferred_insert_behavior='replace'), previous=None)
[esbonio.Configuration] File scope: 'file:///Users/xxxxxx/1-repos/website/main'
[esbonio.Configuration] Workspace scope: 'file:///Users/xxxxxx/1-repos/website/main'
[esbonio.Configuration] Resolved config: {
  "enableDevTools": false,
  "pythonCommand": [
    "/Users/xxxxxx/miniconda3/bin/python"
  ],
  "enableSyncScrolling": true,
  "pythonPath": []
}
[esbonio.Configuration] SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Previous: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Current: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "stderr": true,
  "config": {},
  "window": false
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: 'file:///Users/xxxxxx/1-repos/website/main'
[esbonio.Configuration] Workspace scope: 'file:///Users/xxxxxx/1-repos/website/main'
[esbonio.Configuration] Resolved config: {
  "enableDevTools": false,
  "pythonCommand": [
    "/Users/xxxxxx/miniconda3/bin/python"
  ],
  "enableSyncScrolling": true,
  "pythonPath": []
}
[esbonio.Configuration] SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Previous: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Current: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "stderr": true,
  "config": {},
  "window": false
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: 'file:///Users/xxxxxx/1-repos/website/main'
[esbonio.Configuration] Workspace scope: 'file:///Users/xxxxxx/1-repos/website/main'
[esbonio.Configuration] Resolved config: {
  "enableDevTools": false,
  "pythonCommand": [
    "/Users/xxxxxx/miniconda3/bin/python"
  ],
  "enableSyncScrolling": true,
  "pythonPath": []
}
[esbonio.Configuration] SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Previous: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Current: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "stderr": true,
  "config": {},
  "window": false
}
[client] sphinx/clientCreated: {
  "id": "bcb8e189-a5c6-4b32-a16b-305b60a242df",
  "scope": "file:///Users/xxxxxx/1-repos/website/main",
  "config": {
    "pythonCommand": [
      "/Users/xxxxxx/miniconda3/bin/python"
    ],
    "buildCommand": [
      "sphinx-build",
      "-M",
      "dirhtml",
      "/Users/xxxxxx/1-repos/website/main",
      "/Users/xxxxxx/Library/Caches/esbonio/422b08b53fe0c924f6622ade34ee83d3"
    ],
    "cwd": "/Users/xxxxxx/1-repos/website/main",
    "pythonPath": [
      "/Users/xxxxxx/.vscode/extensions/swyddfa.esbonio-0.94.0/bundled/libs/esbonio"
    ]
  }
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: 'file:///Users/xxxxxx/1-repos/website/main'
[esbonio.Configuration] Workspace scope: 'file:///Users/xxxxxx/1-repos/website/main'
[esbonio.Configuration] Resolved config: {
  "enableDevTools": false,
  "pythonCommand": [
    "/Users/xxxxxx/miniconda3/bin/python"
  ],
  "enableSyncScrolling": true,
  "pythonPath": []
}
[esbonio.Configuration] SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Previous: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Current: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxxx/miniconda3/bin/python'], build_command=[], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "stderr": true,
  "config": {},
  "window": false
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio] Task finished: <Task finished name='Task-16' coro=<PreviewManager.show_preview_uri() done, defined at /Users/xxxxxx/.vscode/extensions/swyddfa.esbonio-0.94.0/bundled/libs/esbonio/server/features/preview_manager/__init__.py:187> result=None>
Running Sphinx v7.2.6
[esbonio.ProjectManager] No applicable project for uri: file:///Users/xxxxxx/1-repos/website/main/module1-index.rst
loading pickled environment...
failed: Can't get attribute '_stable_repr_object' on <module 'sphinx.builders.html' from '/Users/xxxxxx/miniconda3/lib/python3.12/site-packages/sphinx/builders/html/__init__.py'>
done
[esbonio.ProjectManager] No applicable project for uri: file:///Users/xxxxxx/1-repos/website/main/module1-index.rst
[esbonio.ProjectManager] No applicable project for uri: file:///Users/xxxxxx/1-repos/website/main/module1-index.rst
[esbonio.ProjectManager] No applicable project for uri: file:///Users/xxxxxx/1-repos/website/main/module1-index.rst
[esbonio.PreviewManager] Previewing file: 'file:///Users/xxxxxx/1-repos/website/main/module1-index.rst'
[esbonio.PreviewManager] Previewing file: 'untitled:Untitled-1'
[esbonio.SphinxManager] No applicable client for uri: untitled:Untitled-1
[esbonio.PreviewManager] Previewing file: 'file:///Users/xxxxxx/1-repos/website/main/module1-index.rst'
[esbonio.ProjectManager] No applicable project for uri: file:///Users/xxxxxx/1-repos/website/main/module1-index.rst
[esbonio.PreviewManager] Previewing file: 'file:///Users/xxxxxx/1-repos/website/main/.vscode/extensions.json'
[esbonio.PreviewManager] Previewing file: 'file:///Users/xxxxxx/1-repos/website/main/.vscode/settings.json'
davbeek commented 2 months ago

I switched back to the release version, and that also does not work anymore, so something must have changed in my setup. Trying to figure out what that is.

davbeek commented 1 month ago

I got the release version working again. An extension I used stopped working, probably due to compatibility issues with new releases of Python or Sphinx. This was indicated in the Problems tab of VSCode.

After disabling the extension, the release version of Esbonio now works again, as usual, but the problems with the prerelease version, unfortunately, are still present. I also completely reinstalled conda and all Python packages, which gets me at Python 3.12.3. The Esbonio problems are similar as before. I kept the settings for the Esbonio release and prerease versions both active in the settings file:

    "esbonio.server.enabled": true,
    "esbonio.sphinx.buildCommand": [
        "sphinx-build",
        "-M",
        "html",
        ".",
        "_build"
    ],
    //
    "esbonio.server.logLevel": "debug",
    //
    "esbonio.logging.level": "debug",
[client] Unable to resolve command lsp-devtools: Error: Command failed: command -v lsp-devtools
[client] Using environment /Users/xxxxx/miniconda3/bin/python: /Users/xxxxx/miniconda3/bin/python
[client] Server start command: /Users/xxxxx/miniconda3/bin/python -S -m esbonio.server
[client] LanguageClientOptions: {
  "documentSelector": [
    {
      "scheme": "file",
      "language": "restructuredtext"
    },
    {
      "scheme": "file",
      "language": "markdown"
    }
  ],
  "outputChannel": {
    "name": "Esbonio"
  },
  "connectionOptions": {
    "maxRestartCount": 0
  },
  "middleware": {
    "workspace": {},
    "window": {}
  }
}
[client] Starting Language Server
[client] Using environment /Users/xxxxx/miniconda3/bin/python: /Users/xxxxx/miniconda3/bin/python
[client] Using environment /Users/xxxxx/miniconda3/bin/python: /Users/xxxxx/miniconda3/bin/python
[esbonio] Loaded extension 'esbonio.server.features.log'
[esbonio] Loaded extension 'esbonio.server.features.project_manager'
[esbonio] Loaded extension 'esbonio.server.features.sphinx_manager'
[esbonio] Loaded extension 'esbonio.server.features.preview_manager'
[esbonio] Loaded extension 'esbonio.server.features.directives'
[esbonio] Loaded extension 'esbonio.server.features.roles'
[esbonio] Loaded extension 'esbonio.server.features.sphinx_support.diagnostics'
[esbonio] Loaded extension 'esbonio.server.features.sphinx_support.symbols'
[esbonio] Loaded extension 'esbonio.server.features.sphinx_support.directives'
[esbonio] Loaded extension 'esbonio.server.features.sphinx_support.roles'
[esbonio] Initialising esbonio v1.0.0b3, using Python v3.12.3 on macOS-14.4.1
[esbonio] Language client: Visual Studio Code 1.89.0
[esbonio.Configuration] Scanning workspace folder: '/Users/xxxxx/1-repos/website/main'
[esbonio.Configuration] Found '/Users/xxxxx/1-repos/website/main/pyproject.toml'
[esbonio.Configuration] File 'file:///Users/xxxxx/1-repos/website/main' configuration: {
  "esbonio": {}
}
[esbonio.Configuration] workspace/configuration: {
  "items": [
    {
      "section": "esbonio"
    },
    {
      "scopeUri": "file:///Users/xxxxx/1-repos/website/main",
      "section": "esbonio"
    }
  ]
}
[esbonio.SphinxManager] No client found, creating new subscription
[esbonio.Configuration] Workspace 'None' configuration: {
  "server": {
    "enabled": true,
    "documentSelector": [],
    "startupModule": "esbonio.server",
    "excludedModules": [],
    "includedModules": [],
    "completion": {
      "preferredInsertBehavior": "replace"
    },
    "enableDevTools": false,
    "debug": false,
    "showDeprecationWarnings": false,
    "logLevel": "debug"
  },
  "sphinx": {
    "buildCommand": [
      "sphinx-build",
      "-M",
      "html",
      ".",
      "_build"
    ],
    "pythonCommand": [
      "/Users/xxxxx/miniconda3/bin/python"
    ],
    "enableSyncScrolling": true,
    "enableDevTools": false,
    "pythonPath": []
  },
  "preview": {
    "showLineMarkers": false
  },
  "logging": {
    "level": "debug",
    "stderr": true,
    "window": false,
    "config": {}
  },
  "trace": {
    "server": "off"
  }
}
[esbonio.Configuration] Workspace 'file:///Users/xxxxx/1-repos/website/main' configuration: {
  "server": {
    "enabled": true,
    "documentSelector": [],
    "startupModule": "esbonio.server",
    "excludedModules": [],
    "includedModules": [],
    "completion": {
      "preferredInsertBehavior": "replace"
    },
    "enableDevTools": false,
    "debug": false,
    "showDeprecationWarnings": false,
    "logLevel": "debug"
  },
  "sphinx": {
    "buildCommand": [
      "sphinx-build",
      "-M",
      "html",
      ".",
      "_build"
    ],
    "pythonCommand": [
      "/Users/xxxxx/miniconda3/bin/python"
    ],
    "enableSyncScrolling": true,
    "enableDevTools": false,
    "pythonPath": []
  },
  "preview": {
    "showLineMarkers": false
  },
  "logging": {
    "level": "debug",
    "stderr": true,
    "window": false,
    "config": {}
  },
  "trace": {
    "server": "off"
  }
}
[esbonio.Configuration] File scope: 'file:///Users/xxxxx/1-repos/website/main'
[esbonio.Configuration] Workspace scope: 'file:///Users/xxxxx/1-repos/website/main'
[esbonio.Configuration] Resolved config: {
  "enableDevTools": false,
  "buildCommand": [
    "sphinx-build",
    "-M",
    "html",
    ".",
    "_build"
  ],
  "enableSyncScrolling": true,
  "pythonCommand": [
    "/Users/xxxxx/miniconda3/bin/python"
  ],
  "pythonPath": []
}
[esbonio.Configuration] SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] ConfigChangeEvent(scope='file:///Users/xxxxx/1-repos/website/main', value=SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[]), previous=None)
[esbonio.SphinxManager] Cwd: /Users/xxxxx/1-repos/website/main
[esbonio.SphinxManager] Build command: ['sphinx-build', '-M', 'html', '.', '_build']
[esbonio.SphinxManager] Client created for scope file:///Users/xxxxx/1-repos/website/main
[esbonio.SphinxManager] SphinxClient[d8469a6a-6975-4189-a7fb-67f23aadef01]: None -> ClientState.Starting
[esbonio.SphinxManager] Starting sphinx agent: /Users/xxxxx/miniconda3/bin/python -m sphinx_agent
[esbonio] Registered 'workspace/didChangeConfiguration' handler
[esbonio] Registered 'workspace/didChangeWatchedFiles' handler
[esbonio.Configuration] File scope: 'file:///Users/xxxxx/1-repos/website/main'
[esbonio.Configuration] Workspace scope: 'file:///Users/xxxxx/1-repos/website/main'
[esbonio.Configuration] Resolved config: {
  "enableDevTools": false,
  "buildCommand": [
    "sphinx-build",
    "-M",
    "html",
    ".",
    "_build"
  ],
  "enableSyncScrolling": true,
  "pythonCommand": [
    "/Users/xxxxx/miniconda3/bin/python"
  ],
  "pythonPath": []
}
[esbonio.Configuration] SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Previous: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Current: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "stderr": true,
  "window": false,
  "config": {}
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] ConfigChangeEvent(scope='', value=LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False), previous=None)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] ConfigChangeEvent(scope='', value=PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False), previous=None)
[esbonio] Scheduled task: <Task pending name='Task-16' coro=<PreviewManager.show_preview_uri() running at /Users/xxxxx/.vscode/extensions/swyddfa.esbonio-0.94.0/bundled/libs/esbonio/server/features/preview_manager/__init__.py:187>>
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] ConfigChangeEvent(scope='', value=CompletionConfig(preferred_insert_behavior='replace'), previous=None)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: None
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] ConfigChangeEvent(scope='', value=CompletionConfig(preferred_insert_behavior='replace'), previous=None)
[esbonio.Configuration] File scope: 'file:///Users/xxxxx/1-repos/website/main'
[esbonio.Configuration] Workspace scope: 'file:///Users/xxxxx/1-repos/website/main'
[esbonio.Configuration] Resolved config: {
  "enableDevTools": false,
  "buildCommand": [
    "sphinx-build",
    "-M",
    "html",
    ".",
    "_build"
  ],
  "enableSyncScrolling": true,
  "pythonCommand": [
    "/Users/xxxxx/miniconda3/bin/python"
  ],
  "pythonPath": []
}
[esbonio.Configuration] SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Previous: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Current: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "stderr": true,
  "window": false,
  "config": {}
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: 'file:///Users/xxxxx/1-repos/website/main'
[esbonio.Configuration] Workspace scope: 'file:///Users/xxxxx/1-repos/website/main'
[esbonio.Configuration] Resolved config: {
  "enableDevTools": false,
  "buildCommand": [
    "sphinx-build",
    "-M",
    "html",
    ".",
    "_build"
  ],
  "enableSyncScrolling": true,
  "pythonCommand": [
    "/Users/xxxxx/miniconda3/bin/python"
  ],
  "pythonPath": []
}
[esbonio.Configuration] SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Previous: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Current: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "stderr": true,
  "window": false,
  "config": {}
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: 'file:///Users/xxxxx/1-repos/website/main'
[esbonio.Configuration] Workspace scope: 'file:///Users/xxxxx/1-repos/website/main'
[client] sphinx/clientCreated: {
  "id": "d8469a6a-6975-4189-a7fb-67f23aadef01",
  "scope": "file:///Users/xxxxx/1-repos/website/main",
  "config": {
    "pythonCommand": [
      "/Users/xxxxx/miniconda3/bin/python"
    ],
    "buildCommand": [
      "sphinx-build",
      "-M",
      "html",
      ".",
      "_build"
    ],
    "cwd": "/Users/xxxxx/1-repos/website/main",
    "pythonPath": [
      "/Users/xxxxx/.vscode/extensions/swyddfa.esbonio-0.94.0/bundled/libs/esbonio"
    ]
  }
}
[esbonio.Configuration] Resolved config: {
  "enableDevTools": false,
  "buildCommand": [
    "sphinx-build",
    "-M",
    "html",
    ".",
    "_build"
  ],
  "enableSyncScrolling": true,
  "pythonCommand": [
    "/Users/xxxxx/miniconda3/bin/python"
  ],
  "pythonPath": []
}
[esbonio.Configuration] SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Previous: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Current: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "stderr": true,
  "window": false,
  "config": {}
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: 'file:///Users/xxxxx/1-repos/website/main'
[esbonio.Configuration] Workspace scope: 'file:///Users/xxxxx/1-repos/website/main'
[esbonio.Configuration] Resolved config: {
  "enableDevTools": false,
  "buildCommand": [
    "sphinx-build",
    "-M",
    "html",
    ".",
    "_build"
  ],
  "enableSyncScrolling": true,
  "pythonCommand": [
    "/Users/xxxxx/miniconda3/bin/python"
  ],
  "pythonPath": []
}
[esbonio.Configuration] SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Previous: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] Current: SphinxConfig(enable_dev_tools=False, enable_sync_scrolling=True, python_command=['/Users/xxxxx/miniconda3/bin/python'], build_command=['sphinx-build', '-M', 'html', '.', '_build'], env_passthrough=[], cwd='', python_path=[])
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "level": "debug",
  "stderr": true,
  "window": false,
  "config": {}
}
[esbonio.Configuration] LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Previous: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] Current: LoggingConfig(level='debug', format='[%(name)s] %(message)s', filepath=None, stderr=True, window=False, config={}, show_deprecation_warnings=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "showLineMarkers": false
}
[esbonio.Configuration] PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Previous: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] Current: PreviewConfig(bind='localhost', http_port=0, ws_port=0, show_line_markers=False)
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] File scope: ''
[esbonio.Configuration] Workspace scope: ''
[esbonio.Configuration] Resolved config: {
  "preferredInsertBehavior": "replace"
}
[esbonio.Configuration] CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Previous: CompletionConfig(preferred_insert_behavior='replace')
[esbonio.Configuration] Current: CompletionConfig(preferred_insert_behavior='replace')
[esbonio] Task finished: <Task finished name='Task-16' coro=<PreviewManager.show_preview_uri() done, defined at /Users/xxxxx/.vscode/extensions/swyddfa.esbonio-0.94.0/bundled/libs/esbonio/server/features/preview_manager/__init__.py:187> result=None>
Running Sphinx v7.3.7
[esbonio.ProjectManager] No applicable project for uri: file:///Users/xxxxx/1-repos/website/main/index.rst
[esbonio.ProjectManager] No applicable project for uri: file:///Users/xxxxx/1-repos/website/main/index.rst
[esbonio.ProjectManager] No applicable project for uri: file:///Users/xxxxx/1-repos/website/main/index.rst
[esbonio.PreviewManager] Previewing file: 'file:///Users/xxxxx/1-repos/website/main/index.rst'
alcarney commented 1 month ago

Thinking about this some more and re-reading the logs, the hang looks like it's caused by the fact the server isn't getting a message back from the Sphinx process saying that it's ready. This makes the server think the Sphinx process is still starting and everything (previews, builds etc.) block waiting for this ready message that never arrives... 🤔

There could be many explanations for this... but the fact that there are no obvious error messages makes me think that something in the Sphinx process could be printing to stdout when it shouldn't, corrupting the channel the server uses to communicate with Sphinx.

It's a long shot, but could you try disabling your Sphinx extensions checking that there are no print() statements in your conf.py and see if that fixes the hanging issue?

davbeek commented 1 month ago

After some debugging and experimenting I found the cause of the problem was the esbonio python module. After removing esbonio from the installed packages, everything worked again.

davbeek commented 1 month ago

I can add that scrolling works nicely both ways, from preview to code and vice versa. Also, the preview keeps its position when saving and does not jump back to the beginning of the file, which is a big improvement in usability.

Preview still does not work for ..include:: files, but I suppose that is already covered by issue #784.

alcarney commented 1 month ago

I can add that scrolling works nicely both ways, from preview to code and vice versa. Also, the preview keeps its position when saving and does not jump back to the beginning of the file, which is a big improvement in usability.

Glad to hear it! It's just a shame it's so fiddly to get the new version up and running! 😅

After removing esbonio from the installed packages, everything worked again.

Sounds like #782 is definitely going to be needed!