Skip to content

Rename esbonio.sphinx.buildCommand to esbonio.sphinx.buildCommandArguments? #1052

@renato-pipkin

Description

@renato-pipkin

In light of #1051, it might be worth considering renaming the option esbonio.sphinx.buildCommand to one of

  • esbonio.sphinx.buildCommandArgument
  • esbonio.sphinx.buildArguments
  • esbonio.sphinx.sphinxbuildArguments

because that's what it is used for, even the code discards a leading sphinx-build so the value is never intended to be run as a command.

lib/esbonio/esbonio/sphinx_agent/config.py line 79

    @classmethod
    def fromcli(cls, args: list[str]):
        """Return the ``SphinxConfig`` instance that's equivalent to the given arguments.

        Parameters
        ----------
        args
           The cli arguments you would normally pass to ``sphinx-build``

        Returns
        -------
        Optional[SphinxConfig]
           ``None`` if the arguments could not be parsed, otherwise the set configuration
           options derived from the sphinx build command.
        """

        if args[0] == "sphinx-build":
            args = args[1:]

        # The easiest way to handle this is to just call sphinx-build but with
        # the Sphinx app object patched out - then we just use all the args it
        # was given!
        with mock.patch("sphinx.cmd.build.Sphinx") as m_Sphinx:
            sphinx_build(args)

For the record: This is the same as issue 1049, which you might or might not see as it got shadow banned by GitHub.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlspIssues that relate to the language server

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions