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

build(deps): bump vscode-languageclient from 8.1.0 to 9.0.0 in /code #642

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
19482ed
code: Delete original VSCode extension implementation
alcarney May 29, 2023
e631185
lsp: Move spelling module to `esbonio-extensions`
alcarney May 29, 2023
29d1925
lsp: Move package metadata to pyproject.toml
alcarney May 29, 2023
bb52d85
lsp: Drop Python 3.7
alcarney May 29, 2023
51c804a
lsp: Drop Sphinx 4.x support
alcarney May 29, 2023
170f7f7
lsp: Drop explicit dependency on Sphinx
alcarney May 29, 2023
5726856
code: Scaffold re-implementation of VSCode extension
alcarney Jun 1, 2023
55aef1b
code: Cleanup old options, add `workspace/configuration` middleware
alcarney Jun 15, 2023
d7c44e4
lsp: Add docutils dependency
alcarney Jun 15, 2023
db32f62
code: Basic re-implementation of previews
alcarney Jun 19, 2023
c6aa073
vscode: Tweak extension launch config to be multi-root
alcarney Jun 21, 2023
4478062
code: Improve isolation and sphinx devtools support
alcarney Jun 23, 2023
9546955
code: Add lsp_devtools support to main language server
alcarney Jun 23, 2023
88cc159
lsp: Add websockets as a top-level dependency
alcarney Jun 24, 2023
184b522
code: Initial webview -> editor scroll sync
alcarney Jun 25, 2023
cfaf049
code: Initial editor -> webview scroll sync implementation
alcarney Jun 25, 2023
c42d18f
workflow: Initial pass at beta release pipeline
alcarney Jun 25, 2023
d146306
code: Bring back webpack config
alcarney Jun 25, 2023
57890dc
build(deps-dev): bump typescript from 5.1.3 to 5.1.5 in /code
dependabot[bot] Jun 28, 2023
c1b03f7
build(deps-dev): bump webpack from 5.87.0 to 5.88.1 in /code
dependabot[bot] Jun 28, 2023
a600abc
build(deps-dev): bump ts-loader from 9.4.3 to 9.4.4 in /code
dependabot[bot] Jun 28, 2023
6d233ac
code: WIP getting started guide using VSCode's walkthroughs
alcarney Jun 29, 2023
9094bc3
code: Implement restart server command
alcarney Jun 29, 2023
3ef71a1
code: Emit server lifecycle events
alcarney Jun 29, 2023
8f598b0
code: Initial re-implementation of language status items
alcarney Jun 29, 2023
4eb2d8e
code: Re-enable included/excluded module logic
alcarney Jun 29, 2023
19d671a
build(deps-dev): bump typescript from 5.1.5 to 5.1.6 in /code
dependabot[bot] Jul 3, 2023
f898cae
build(deps): bump semver from 7.5.2 to 7.5.4 in /code
dependabot[bot] Jul 10, 2023
22a5925
nix: Update flake and overlay definitions
alcarney Jul 6, 2023
050f306
lsp: Add unit tests for `SphinxConfig`
alcarney Jul 9, 2023
127d72a
sphinx_agent: Add first e2e test
alcarney Jul 9, 2023
926e865
workflow: Enable lsp tests for PRs against the `beta` branch
alcarney Jul 9, 2023
65d854f
lsp: Repurpose `pyXX-sphinxY` tox envs to run sphinx-agent tests
alcarney Jul 9, 2023
26f4354
lsp: Update bumpversion configuration
alcarney Jul 9, 2023
d5c3c9c
workflow: Enable pip dependency caching
alcarney Jul 9, 2023
9cd8795
lsp: Use git snapshot version of pygls
alcarney Jul 9, 2023
e946c05
lsp: Only attempt to stop client when necessary
alcarney Jul 12, 2023
148d3f6
workflow: tox improvements
alcarney Jul 12, 2023
0199fec
lsp: Add tests for new `Uri` class
alcarney Jul 15, 2023
a4d93ea
workflow: Initial test env for server based tests
alcarney Jul 15, 2023
a16136c
code: Use @vscode/python-extension for Python Extension API Types
alcarney Jul 20, 2023
db520b7
code: Fix language status items on Windows
alcarney Jul 20, 2023
012e7e6
code: Ensure preview follows active editor
alcarney Jul 20, 2023
2232138
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 20, 2023
f3a24ff
build(deps-dev): bump webpack from 5.88.1 to 5.88.2 in /code
dependabot[bot] Jul 26, 2023
2a8125a
Deprecate appdirs in favour of drop-in replacement platformdirs (#621)
coloursofnoise Jul 27, 2023
a1db54f
workflow: Build beta version of the documentation
alcarney Sep 12, 2023
0d7615e
docs: Add sphinx-design
alcarney Jul 28, 2023
f3f16ac
docs: Restructure getting started section
alcarney Jul 28, 2023
fb695b7
lsp: Update tests to use `Uri` class
alcarney Jul 21, 2023
dcef7b9
code: Expose additional configuration options
alcarney Jul 24, 2023
9260a24
sphinx-agent: Passthrough `PYTHONPATH` when running tests
alcarney Jul 29, 2023
d04abc5
sphinx-agent: Add test case for the new build_file_map
alcarney Jul 29, 2023
94437b4
code: Preview enhancements and fixes
alcarney Jul 31, 2023
395a310
build(deps): bump @vscode/python-extension from 1.0.1 to 1.0.2 in /code
dependabot[bot] Jul 31, 2023
879dbdc
build(deps-dev): bump @vscode/vsce from 2.19.0 to 2.20.0 in /code
dependabot[bot] Jul 31, 2023
e550d14
build(deps): bump @vscode/python-extension from 1.0.2 to 1.0.4 in /code
dependabot[bot] Aug 7, 2023
3cb461c
build(deps-dev): bump @vscode/vsce from 2.20.0 to 2.20.1 in /code
dependabot[bot] Aug 8, 2023
40499f5
docs: Fix indentation
alcarney Aug 12, 2023
02cb612
lsp: Change default startup module
alcarney Aug 12, 2023
6e9f5a6
lsp: Add test cases for document symbols
alcarney Aug 12, 2023
362137c
workflow: Don't fail fast
alcarney Aug 12, 2023
4a06748
workflow: Don't run parallel tox envs
alcarney Aug 12, 2023
b7cc6d0
lsp: Refactor tox env
alcarney Aug 12, 2023
3f83b9d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 14, 2023
f183dc1
code: Rely on editor/view in control logic provided by the server
alcarney Aug 16, 2023
27b748e
code: Add minimum bound to line numbers
alcarney Aug 16, 2023
d22a243
code: Use `getState` and `setState`
alcarney Aug 16, 2023
6d175b3
code: Set `retainContextWhenHidden` when creating the preview pane
alcarney Aug 16, 2023
623cb5a
code: Do an initial scroll sync on page load
alcarney Aug 16, 2023
bb64498
code: Recreate preview pane on server restarts
alcarney Aug 16, 2023
d85e0f9
code: Expose `showLineMarkers` option
alcarney Aug 16, 2023
40441dd
code: Improve handling of the client
alcarney Aug 18, 2023
d011816
code: Automatically launch `lsp-devtools tui` if appropriate
alcarney Aug 18, 2023
c0552bd
docs: Add preview architecture diagram
alcarney Sep 11, 2023
598bf4c
code: Ensure lsp-devtools can be relaunched when closed
alcarney Aug 27, 2023
80ab851
vscode: Update settings file
alcarney Sep 11, 2023
c459fce
build(deps-dev): bump typescript from 5.1.6 to 5.2.2 in /code
dependabot[bot] Sep 12, 2023
9c2f025
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 12, 2023
f6d91c4
build(deps-dev): bump @vscode/vsce from 2.20.1 to 2.21.0 in /code
dependabot[bot] Sep 12, 2023
73dd7ee
build(deps): bump @vscode/python-extension from 1.0.4 to 1.0.5 in /code
dependabot[bot] Sep 12, 2023
737a074
code: Bump version v0.91.0
alcarney Sep 12, 2023
755aee6
ci: Don't bump versions for now...
alcarney Sep 12, 2023
cdb7473
code: First pass (of many) at rewriting the README
alcarney Sep 12, 2023
57b3eed
nix: Update nvim-lspconfig example config
alcarney Sep 14, 2023
5de2784
docs: Create a dedicated nvim + lspconfig guide
alcarney Sep 14, 2023
7da25ed
build(deps): bump vscode-languageclient from 8.1.0 to 9.0.0 in /code
dependabot[bot] Sep 25, 2023
072b120
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Beta

on:
push:
branches:
- beta

jobs:
# Simple job the checks to see which parts we actually have to build.
trigger:
name: Trigger
runs-on: ubuntu-latest
outputs:
vscode: ${{steps.check-vscode.outputs.build}}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- run: |
if [ -z "${BASE_REF}" ]; then
echo "BASE=HEAD^" >> $GITHUB_ENV
else
echo "BASE=origin/${BASE_REF}" >> $GITHUB_ENV
fi
name: Determine base
env:
BASE_REF: ${{ github.base_ref }}

- run: |
set -e
echo ${BASE}
./scripts/should-build.sh vscode
id: check-vscode
name: "Build VSCode?"

vscode:
name: VSCode Extension
needs: [trigger]
if: needs.trigger.outputs.vscode
runs-on: ubuntu-latest
steps:
- uses: 'actions/checkout@v3'

- uses: actions/setup-node@v3
with:
node-version: '16.x'
cache: 'npm'
cache-dependency-path: 'code/package-lock.json'

# This must be set to the minimum Python version we support
- uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-vscode-pip-deps-${{ hashFiles('code/requirements.txt') }}
restore-keys: |
${{ runner.os }}-vscode-pip-deps

- run: |
python --version
python -m pip install --upgrade pip
python -m pip install --upgrade bump2version towncrier docutils
name: Install Build Tools

- run: |
set -e
./scripts/make-release.sh vscode
id: info
name: Set Version

- run: |
cd code
npm ci --prefer-offline
make bundle-deps
name: Install Dependencies

- run: |
cd code
npm run package
name: Package Extension

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: 'vsix'
path: code/*.vsix
if-no-files-found: error
retention-days: 7
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
push:
branches:
- release
- beta
- develop
paths:
- 'docs/**'
Expand Down
37 changes: 19 additions & 18 deletions .github/workflows/lsp-pr.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: Language Server PR
on:
push:
branches:
- beta
paths:
- 'lib/esbonio/**'

pull_request:
branches:
- develop
- release
- beta
paths:
- 'lib/esbonio/**'

Expand All @@ -12,9 +17,10 @@ jobs:
name: "Python v${{ matrix.python-version }} -- ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v4
Expand All @@ -24,6 +30,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-lsp-pr-pip-deps-${{ matrix.python-version }}

- run: |
python --version
python -m pip install --upgrade pip
Expand All @@ -43,20 +55,9 @@ jobs:
cd lib/esbonio

version=$(echo ${{ matrix.python-version }} | tr -d .)
python -m tox -e `tox -l | grep $version | tr '\n' ','`
name: Run Tests (when not on Windows)
if: matrix.os != 'windows-latest'

- run: |
cd lib/esbonio

$version=$(echo "${{ matrix.python-version }}" | tr -d ".")
$envs=$(tox -l | grep $version)

echo $($envs -join ",")
python -m tox -e $($envs -join ",")
name: Run Tests (when on Windows)
if: matrix.os == 'windows-latest'
python -m tox run -e `tox -l | grep $version | tr '\n' ','`
shell: bash
name: Run Tests

- name: Package
run: |
Expand Down
7 changes: 4 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}/code",
"--folder-uri=${workspaceRoot}/${input:workspace}"
"--folder-uri=${workspaceRoot}/docs",
"--folder-uri=${workspaceRoot}/lib/esbonio/tests/sphinx-default/workspace"
],
"outFiles": [
"${workspaceRoot}/code/dist/node/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}",
// "preLaunchTask": "${defaultBuildTask}",
"env": {
"VSCODE_LSP_DEBUG": "true"
// "VSCODE_LSP_DEBUG": "true"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions code/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[bumpversion]
current_version = 0.11.0
current_version = 0.91.0
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(-dev(?P<dev>\d+))?
serialize =
serialize =
{major}.{minor}.{patch}-dev{dev}
{major}.{minor}.{patch}

Expand Down
2 changes: 2 additions & 0 deletions code/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bundled/libs
node_modules
16 changes: 10 additions & 6 deletions code/.vscodeignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
changes
node_modules
src/**
dist/**/*.map
dist/test
syntaxes/tests
.bumpversion.cfg
.pytest_cache
**/__pycache__/**
**/.pyc
**/requirements.in
**/requirements.txt
changes
CHANGES.rst
dist/**/*.map
dist/test
node_modules
pyproject.toml
src/**
syntaxes/tests
tsconfig.json
webpack.config.js
15 changes: 15 additions & 0 deletions code/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.PHONY: update-lock bundle-deps

bundle-deps: requirements.txt
sed -i /@/d requirements.txt
python -m pip install -t ./bundled/libs --no-cache-dir --implementation py --no-deps --upgrade -r ./requirements.txt

# Temporary
python -m pip install -t ./bundled/libs --no-cache-dir --implementation py --no-deps --upgrade "git+https://github.com/openlawlibrary/pygls.git#egg=pygls"
python -m pip install -t ./bundled/libs --no-cache-dir --implementation py --no-deps --upgrade "git+https://github.com/swyddfa/esbonio#egg=esbonio&subdirectory=lib/esbonio"
python -m pip install -t ./bundled/libs --no-cache-dir --implementation py --no-deps --upgrade "git+https://github.com/swyddfa/lsp-devtools#egg=lsp-devtools&subdirectory=lib/lsp-devtools"

requirements.txt: requirements.in
pip-compile --resolver=backtracking --generate-hashes --upgrade ./requirements.in

update-lock: requirements.txt
83 changes: 6 additions & 77 deletions code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,13 @@

The Esbonio extension integrates the [`esbonio`](https://pypi.org/project/esbonio/) language server into VSCode.

The `esbonio` language server aims to make it easier to work with [Sphinx](https://www.sphinx-doc.org/en/master/) documentation projects by providing completion suggestions for your cross references and many other features.

## What about the reStructuredText Extension?

You may already be familiar with the [reStructuredText](https://marketplace.visualstudio.com/items?itemName=lextudio.restructuredtext) extension which, as of [v171.0.0](https://github.com/vscode-restructuredtext/vscode-restructuredtext/releases/tag/171.0.0) now also integrates the `esbonio` language server into VSCode.
It also integrates other tools such as the linters [`doc8`](https://pypi.org/project/doc8/) and [`rstcheck`](https://pypi.org/project/rstcheck/) and provides additional editor functionality making it easier to work with reStructuredText in general.

**Wait.. so why does the Esbonio VSCode extension still exist?**

The reStructuredText extension takes a more conservative approach to adopting new VSCode features and APIs leaving the Esbonio extension free to more aggressively follow new developments.
The Esbonio extension is developed alongside the language server itself, which allows for easy testing of new features without waiting for downstream projects to catch up.
Finally, the Esbonio extension serves as an up to date reference for projects that integrate `esbonio` into other editors.

**That sounds great... but which extension is right for me?**

Try the reStructuredText extension if

- You need an extension compatible with older versions of VSCode
- You are interested in additional features beyond what is provided by the language server

Try the Esbonio extension if

- You want to make use of the newer features available in recent VSCode versions
- You are only interested in the features provided by the language server
The `esbonio` language server aims to make it easier to work with [Sphinx](https://www.sphinx-doc.org/en/master/) documentation projects by bringing IDE-like features to your documentation.

## Features

### Preview
### Live Preview

The extension can show a HTML preview of the documentation
The extension can show a live HTML preview of the documentation

![HTML Preview](../resources/images/vscode-preview-demo.gif)

Expand Down Expand Up @@ -71,55 +48,7 @@ Sections within a document are displayed in the "Outline" view

![Document Outline](../resources/images/document-symbols-demo.png)

### Syntax Highlighting

Syntax Highlighting is provided thanks to the [reStructuredText Syntax Highlighting Extension](https://marketplace.visualstudio.com/items?itemName=trond-snekvik.simple-rst) extension.

## Setup

The language server works by wrapping an instance of Sphinx's application object,
inspecting it and exposing the results over the Language Service Protocol. As Sphinx is
a Python application this also dictates thats the Language Server is written in Python
and distributed as a package on [PyPi](https://pypi.org/project/esbonio/).

In order to correctly wrap your Sphinx application this requires the Language Server be
installed into the same environment as the one that you use to build your
documentation.

There are a number of ways this can be accomplished.

### Automatically

The extension does its best to automate the installation and application of updates to the
Language Server. By default Esbonio will use the Python environment you have configured
[Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
when installing and running the server. If however, you don't have the Python extension
installed or you want to use a different Python environment for your documentation there
is a configuration option `esbonio.server.pythonPath` that you can use to configure the
environment.

There are a number of configuration options that allow you to control exactly how
installation and updates are handled. See the
[documentation](https://swyddfa.github.io/esbonio/docs/lsp/editors/vscode.html#configuration)
for more details.

![Setup Demo](../resources/images/vscode-setup-demo.gif)

### Manually

Alternatively you can opt to manage the installation of the language server entirely
yourself. To install the Lanaguage Server open the terminal in your desired Python
environment and run

```
(env) $ pip install esbonio
```

Then all you have to ensure is that Esbonio is configured to use the same environment,
either through the
[Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
or through the `esbonio.server.pythonPath` configuration option.
## Alternatives

To also manage updates manually, be sure to look at the
[documentation](https://swyddfa.github.io/esbonio/docs/lsp/editors/vscode.html#configuration)
for options on how to disable automatic updates.
The [reStructuredText](https://marketplace.visualstudio.com/items?itemName=lextudio.restructuredtext) extension as of [v171.0.0](https://github.com/vscode-restructuredtext/vscode-restructuredtext/releases/tag/171.0.0) also integrates the `esbonio` language server into VSCode.
It also integrates other tools such as the linters [`doc8`](https://pypi.org/project/doc8/) and [`rstcheck`](https://pypi.org/project/rstcheck/) and provides additional editor functionality for working with reStructuredText in general.
28 changes: 28 additions & 0 deletions code/changes/619.breaking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
The following server configuration options have been removed as they are no longer required.

- ``esbonio.server.installBehavior``
- ``esbonio.server.updateBehavior``
- ``esbonio.server.updateFrequency``

The language server is now bundled as part of the VSCode extension itself, so a separate installation step is no longer necessary.

The following sphinx configuration options have been removed

- ``esbonio.server.hideSphinxOutput``
- ``esbonio.sphinx.buildDir``
- ``esbonio.sphinx.builderName``
- ``esbonio.sphinx.confDir``
- ``esbonio.sphinx.doctreeDir``
- ``esbonio.sphinx.forceFullBuild``
- ``esbonio.sphinx.keepGoing``
- ``esbonio.sphinx.makeMode``
- ``esbonio.sphinx.numJobs``
- ``esbonio.sphinx.quiet``
- ``esbonio.sphinx.silent``
- ``esbonio.sphinx.srcDir``
- ``esbonio.sphinx.tags``
- ``esbonio.sphinx.verbosity``
- ``esbonio.sphinx.warningIsError``

The Sphinx application instance is now launched using a standard ``sphinx-build`` command line provided through the ``esbonio.sphinx.buildCommand`` option, so individual options are no longer necessary.
**Note:** The ``esbonio.sphinx.configOverrides`` option has been preserved as it can be easier to use than the equivalent command line options.
1 change: 1 addition & 0 deletions code/changes/xxx.breaking.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The minimum required VSCode version is now 1.78.0
25 changes: 25 additions & 0 deletions code/changes/xxx.enhancement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
The following server configuration values have been added

- ``esbonio.server.enableDevTools``: Enable integration with `lsp-devtools <https://github.com/swyddfa/lsp-devtools>`__ for the language server itself.

The following sphinx configuration values have been added

- ``esbonio.sphinx.buildCommand``: Set the ``sphinx-build`` command to use when invoking the Sphinx subprocess

- ``esbonio.sphinx.pythonCommand``: By default, the extension will attempt to reuse the Python environment you have configured in the Python extension when invoking Sphinx.
This option can be used to override this behavior.

- ``esbonio.sphinx.cwd``: The working directory from which to launch the Sphinx process

- ``esbonio.sphinx.envPassthrough``: A list of envrionment variables to pass through to the Sphinx process.

- ``esbonio.sphinx.enableDevTools``: Enable integration with `lsp-devtools <https://github.com/swyddfa/lsp-devtools>`__ for the sphinx process

- ``esbonio.sphinx.pythonPath``: Used to override the Python packages (typically ``esbonio.sphinx_agent``) that are injected into the Sphinx environment

The following preview related options have been added

- ``esbonio.sphinx.enableSyncScrolling``: Enable support for syncronised scrolling between the editor and preview pane
- ``esbonio.preview.bind``: Set the network interface that the preview server binds to
- ``esbonio.preview.httpPort``: Set the port number the HTTP server binds to
- ``esbonio.preview.wsPort``: Set the port number the WebSocket server binds to
Loading