Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server should resolve file based config relative to file's location #711

Closed
alcarney opened this issue Jan 7, 2024 · 0 comments · Fixed by #847
Closed

Server should resolve file based config relative to file's location #711

alcarney opened this issue Jan 7, 2024 · 0 comments · Fixed by #847
Labels
bug Something isn't working lsp Issues that relate to the language server
Milestone

Comments

@alcarney
Copy link
Member

alcarney commented Jan 7, 2024

Consider the following config from this repo

[tool.esbonio.sphinx]
buildCommand = ["sphinx-build", "-M", "dirhtml", ".", "./_build"]

From a user's perspective it would be nice if the paths . and ./_build were resolved relative to the file's location (${workspaceFolder}/docs), rather than the current behavior where they are resolved relative to ${workspaceFolder}.

The trick is making that information available in the right place, since where the configuration value is sourced from is currently hidden from the code that uses the result - (which is by design)

@alcarney alcarney added bug Something isn't working lsp Issues that relate to the language server labels Jan 7, 2024
@alcarney alcarney added this to the 1.0 milestone Jan 7, 2024
@alcarney alcarney added this to Esbonio Jan 7, 2024
@github-project-automation github-project-automation bot moved this to Todo in Esbonio Jan 7, 2024
alcarney added a commit to alcarney/esbonio that referenced this issue Jul 7, 2024
Configuration objects can now accept variables of the form `${variable}`
and have them expanded by the configuration system at runtime.

This commit adds support for the following variables

- `${scope}`: The full uri of the scope at which the configuration
  object was requested

- `${scopePath}`: The path component of the scope uri

- `${scopeFsPath}`: The path component of the scope uri as a
  filesystem path

Currently these configuration variables will only be expanded if they
appear in a field that is a simple string.

Additionaly, this commit sets the default value for `SphinxConfig.cwd`
to be `${scopeFsPath}`. This should mean that any
`esbonio.sphinx.buildCommand` values in a `pyproject.toml` file will
be evaluated relative to the file's location. Closes swyddfa#711
alcarney added a commit to alcarney/esbonio that referenced this issue Jul 7, 2024
Configuration objects can now accept variables of the form `${variable}`
and have them expanded by the configuration system at runtime.

This commit adds support for the following variables

- `${scope}`: The full uri of the scope at which the configuration
  object was requested

- `${scopePath}`: The path component of the scope uri

- `${scopeFsPath}`: The path component of the scope uri as a
  filesystem path

Currently these configuration variables will only be expanded if they
appear in a field that is a simple string.

Additionaly, this commit sets the default value for `SphinxConfig.cwd`
to be `${scopeFsPath}`. This should mean that any
`esbonio.sphinx.buildCommand` values in a `pyproject.toml` file will
be evaluated relative to the file's location. Closes swyddfa#711
alcarney added a commit to alcarney/esbonio that referenced this issue Jul 7, 2024
Configuration objects can now accept variables of the form `${variable}`
and have them expanded by the configuration system at runtime.

This commit adds support for the following variables

- `${scope}`: The full uri of the scope at which the configuration
  object was requested

- `${scopePath}`: The path component of the scope uri

- `${scopeFsPath}`: The path component of the scope uri as a
  filesystem path

Currently these configuration variables will only be expanded if they
appear in a field that is a simple string.

Additionaly, this commit sets the default value for `SphinxConfig.cwd`
to be `${scopeFsPath}`. This should mean that any
`esbonio.sphinx.buildCommand` values in a `pyproject.toml` file will
be evaluated relative to the file's location. Closes swyddfa#711
@github-project-automation github-project-automation bot moved this from Todo to Done in Esbonio Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lsp Issues that relate to the language server
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant