Git Product home page Git Product logo

esbonio's People

Contributors

aa-turner avatar alcarney avatar astrojuanlu avatar ch3ri0ur avatar coloursofnoise avatar danwos avatar dependabot[bot] avatar exaneserverteam avatar github-actions[bot] avatar goyalyashpal avatar haiyangtoai avatar lextm avatar oharboe avatar pre-commit-ci[bot] avatar stsewd avatar vkhitrin avatar yaegassy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esbonio's Issues

The language server does not catch autoxxxx options

The way directive options for the autoxxxx family of directives are registered does not fit into the "standard" way options are handled and so the language server does not know what they are. Is there an easy way to figure out what options they accept?

Add proper support for domains

Currently the language server does have general support for Sphinx domains. There are a number of places where support has been hardcoded for the std and python domains.

There are a number of things we need in order to claim "proper" support

  • Being able to suggest roles and directives for all domains under the correct prefix (#101, #104)
  • Respect the primary_domain setting (#101, #104)
  • Ensure the intersphinx completions support domains (#106)

Investigate notebook cell ids

As of nbformat v5.1 cells now require mandatory id fields which broke the tests around the nbtutorial Sphinx extension. Currently this has been worked around by pinning the version of nbformat we depend on to be <5.1. At some point it will be worth finding out what the idea behind this id field is, and figure out the best way to make use of it.

Test install/update flows

There's basic install prompts now in place in the extension. However it's clear the logic needs a lot of refinement so that it's more useful. It would be good if we can test this somehow as its expanded upon

Doc target completions needs to take into account file locations

Offering a completions for the :doc: role need a little more intelligence behind them. Consider the following hierarchy

docs
|- a
|   |- x.rst
|   \- y.rst
\- b
    \- z.rst

Typing :doc:`b/z` in a/x.rst will result in Sphinx not being able to resolve the reference.
It either needs to be

  • a relative reference to the a/x.rst file (:doc:`../b/z` )
  • an "absolute" reference, relative to the project's conf.py (:doc:`/b/z` )

The insert_text for the target's CompletionItem needs to be tweaked to fix this

Language Server does not detect invalid references

For example the reference :ref:`not-a-valid-reference` is not flagged as an issue
Not sure if this should be solved by running more of the Sphinx build process (current we only read the sources) or if there should be a dedicated feature that checks for this kind of thing

Language server does not handle windows paths

When the LSP is first initialized, the workspace root is sent over as a URI. In VSCode's case at least this means directory labels are url encoded C: -> C%3A and there is an extra leading '/' character.

This appears to cause pathlib some problems and crashes the server.

Language Server Bootstrap

If someone installs the vscode extension and the python package is not installed, the extension should prompt to install it using the configured python

Easy ways to insert links?

When working on a document they user may want to insert links to other sites using a URL. It would be nice if there way a way to highlight some text, do some key combo and have the extension automatically do the link syntax. Either inline

`some text <https://...>`_

Or as a named reference

`somte text`_

.. _some text: https://...

Repeated exception thrown when using the server with VSCode


Failed to handle notification $/setTraceNotification: Object(value='off')
Traceback (most recent call last):
  File "/home/alex/Projects/esbonio/.env/lib/python3.8/site-packages/pygls/protocol.py", line 309, in _get_handler
    return self.fm.builtin_features[feature_name]
KeyError: '$/setTraceNotification'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/alex/Projects/esbonio/.env/lib/python3.8/site-packages/pygls/protocol.py", line 312, in _get_handler
    return self.fm.features[feature_name]
KeyError: '$/setTraceNotification'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/alex/Projects/esbonio/.env/lib/python3.8/site-packages/pygls/protocol.py", line 337, in _handle_notification
    handler = self._get_handler(method_name)
  File "/home/alex/Projects/esbonio/.env/lib/python3.8/site-packages/pygls/protocol.py", line 314, in _get_handler
    raise JsonRpcMethodNotFound.of(feature_name)
pygls.exceptions.JsonRpcMethodNotFound

I think it should be possible for us to provide even a dummy implementation to suppress this

Provide completion suggestions for filepaths

  • There are a number of situations where a user may be referencing a file, it would be good to offer completion suggestions
    • figure:: <filename>
    • include:: <filename>
    • image:: <filename>
    • literalinclude:: <filename>
    • :download:`<filename>`
    • toctree:: entries (Now in #151)

Better directive completions

The language server can now offer completions for directives themselves. but it would be good to take that further to cover

  • A directive's arguments (#58)
  • A directive's options (#78)
  • The actual directive's documentation (#284)

Better reporting of Sphinx related errors

While #51 technically resolved #33, all it does is send a notification saying "Hey, something went wrong".
It would be good if the language server could report what the problem actually was, preferably publishing it as a diagnostic

Python config

I think it's useful to have the ability to use a python that's potentially different from the active python project (or there may not be a python project at all!)

However I think by default the extension should use the configured python.pythonPath option - if available.

Parse errors out of Sphinx's output

  • One easy way to start publishing diagnostics to the Language client would be to parse the errors that Sphinx spits out when it does a build.

image

Offer intersphinx completions

Intersphinx is amazing, however it can be difficult/tedious to figure out what the references are called. It would be great if we could offer completion suggestions for them

Auto Select Output Window

When restarting the Language Server in VSCode the Output window switches to another entry - but the content remains...
Add a check to the restart logic to see if the LSP's output window was selected and auto select the new instance's output if that's the case

It's too easy for the language server to choose the wrong conf.py file

I recently tried the language server in a project that contained a number of virtualenvs under a .tox directory in the root of the project. One of these envs happened to contain a conf.py file that was discovered before the conf.py that should've been chosen.

One quick fix would be to ignore conf.py files that live under certain directories e.g. .tox, site-packages etc

Generate a CHANGELOG.md as part of the extension build

We already have towncrier generating a CHANGES.rst that we commit to the repo and will eventually pull into the docs. However to populate the changelog tab in VSCode, it looks like we need a CHANGELOG.md file.

It should be enough to have it present at the time of calling vsce package/publish, without committing it to the repo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.