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

New Release #774

Merged
merged 89 commits into from
Apr 20, 2024
Merged

New Release #774

merged 89 commits into from
Apr 20, 2024

Conversation

alcarney
Copy link
Member

No description provided.

dependabot bot and others added 30 commits January 24, 2024 19:21
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](actions/cache@v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
updates:
- [github.com/psf/black: 23.12.1 → 24.1.1](psf/black@23.12.1...24.1.1)
Bumps [pygls](https://github.com/openlawlibrary/pygls) from 1.2.1 to 1.3.0.
- [Release notes](https://github.com/openlawlibrary/pygls/releases)
- [Changelog](https://github.com/openlawlibrary/pygls/blob/main/CHANGELOG.md)
- [Commits](openlawlibrary/pygls@v1.2.1...v1.3.0)

---
updated-dependencies:
- dependency-name: pygls
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [@vscode/vsce](https://github.com/Microsoft/vsce) from 2.22.0 to 2.23.0.
- [Release notes](https://github.com/Microsoft/vsce/releases)
- [Commits](microsoft/vscode-vsce@v2.22.0...v2.23.0)

---
updated-dependencies:
- dependency-name: "@vscode/vsce"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.19.11 to 0.20.0.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](evanw/esbuild@v0.19.11...v0.20.0)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [platformdirs](https://github.com/platformdirs/platformdirs) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/platformdirs/platformdirs/releases)
- [Changelog](https://github.com/platformdirs/platformdirs/blob/main/CHANGES.rst)
- [Commits](tox-dev/platformdirs@4.1.0...4.2.0)

---
updated-dependencies:
- dependency-name: platformdirs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
This is likely not enough to fully resolve the shutdown issue (as that
requires a fix in `pygls`[1]) but at least now the server will make an
attempt to shut itself down.

[1]: openlawlibrary/pygls#433
Bumps [semver](https://github.com/npm/node-semver) from 7.5.4 to 7.6.0.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](npm/node-semver@v7.5.4...v7.6.0)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
updates:
- [github.com/psf/black: 24.1.1 → 24.2.0](psf/black@24.1.1...24.2.0)
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.20.0 to 0.20.1.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](evanw/esbuild@v0.20.0...v0.20.1)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Rather than send just the current configuration value to a
subscription callback we now send a `ConfigChangeEvent` which includes
additional information such as the config scope and the previous value.
This prevents `pyright` from complaining about invalid implementations
in subclasses
This will allow it to be used in multiple places later
Bumps [@vscode/vsce](https://github.com/Microsoft/vsce) from 2.23.0 to 2.24.0.
- [Release notes](https://github.com/Microsoft/vsce/releases)
- [Commits](microsoft/vscode-vsce@v2.23.0...v2.24.0)

---
updated-dependencies:
- dependency-name: "@vscode/vsce"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [aiosqlite](https://github.com/omnilib/aiosqlite) from 0.19.0 to 0.20.0.
- [Changelog](https://github.com/omnilib/aiosqlite/blob/main/CHANGELOG.md)
- [Commits](omnilib/aiosqlite@v0.19.0...v0.20.0)

---
updated-dependencies:
- dependency-name: aiosqlite
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
This adds a method that allows components to ask the configuration
system which configuration scope a given uri would fall into
By pushing the execution of async configuration change handlers into
`asyncio.Task` objects, we can make the `subscribe()` method
syncronous.

Not only does this not force users of the function to be async, we now
actually detect duplicate subscriptions and prevent unecessary calls
to the given handler.
This commit refactors the `SubprocessSphinxClient` so that it's
hopefully much more robust.

- There is no longer a separation between starting the client and
  creating a Sphinx application. There is now only a single `start()`
  method.

- The `start()` method no longer takes any arguments (the
  `SphinxConfig` is passed to the constructor instead) and the method
  returns `self`

- The client is now `await`-able. If required the `start()` method
  will be called and the client simply returned otherwise.

- There is now a `ClientState` enum which better explains the current
  condition of the client.

- The client is now an `EventSource` and will emit a `state-change`
  event whenever the state is changed.
This commit builds on the changes introduced to the
`SubprocessSphinxClient` to greatly simplify and improve the
robustness of managing the set of `SphinxClients` in use by the
language server.

There were a few drawbacks to the previous approach

- While await on the `_client_creating` task during client creation
  appeared to work, it still often led to the creation of duplicated
  clients.

- By not recognizing when a given configuration was broken, the
  manager would continually attempt to spawn client instances.

- It was not uncommon to enter an infinite loop of spawning clients!

The new system introduced in this commit *shouldn't* suffer from any
of the above issues.

- Instead of indexing clients by `src_uri`, they are instead indexed
  by the scope of the configuration governing the instance. While
  still not perfect, we should be able to accurately determine the
  relevant client for a given uri in more scenarios.

- To indicate that we are unable to create a client for a given
  config we now store a `None` in the clients dictionary - preventing
  any further attempts at spawning a client.

- Taking advantage of the fact clients are indexed by scope and that
  the client itself is `await`-able, we can have multiple consumers of
  the client awaiting on the client - preventing the issue of
  duplicated clients.

Currently, there is a quirk to the system where the first batch of
callers to `get_client` in a given scope will be told there is no
client. However, they have in fact "primed" the system by creating a
config subscription which will asynchronously populate the `clients`
dict with an unstarted client.

The next batch of callers will then discover that there is a client
instance available and `await` it, starting the underlying Sphinx
process.

Based on some initial testing this "quirk" may actually be desirable,
the `get_client` method is called often enough that I wasn't able to
notice a real delay in starting the Sphinx process up. It also has the
nice property that when restarting the server with multiple projects
open, the flood of `didOpen` notifications from the client is enough
to "prime" the system for each project, but the project itself is only
activated when working on the relevant file in the editor.

One final note, there are plenty of improvements still to be made -
error handling, config changes etc, but hopefully this is a solid base
we can start building on.
The tests now use the real thing and there does not seem to be much
benefit in trying to maintain this.
A number of tests have been marked as xfail or skipped as they will be
fixed for real in the next batch of changes
Instead of exposing the database via the `SphinxClient` interface,
this commit introduces the concept of a `Project`.
Projects are simply the data exposed via the database created by the
sphinx agent.

By separating the two, not only does the `SphinxClient` get to focus
solely on managing the underlying Sphinx process but we open up
interesting opportunities. For example, we can run the server without
an active Sphinx connection - a kind of "offline" mode.

Something that might be interesting to try as an initial vscode.dev
implementation of the server...
This exposes the databases created by underlying Sphinx processes with
the rest of the system.
It's not currently used and can be brought back as a filter if required
alcarney and others added 29 commits March 14, 2024 20:49
We now have just two status items

- One for showing the current `pythonCommand` for the project.
  It also allows the user to trigger the `Python: Select Interpreter`
  command.

- One for showing the current (sphinx) `buildCommand`, the item also
  updates according to the current state of the client.
There seems to be an issue with the latest releases
updates:
- [github.com/psf/black: 24.2.0 → 24.3.0](psf/black@24.2.0...24.3.0)
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.20.1 to 0.20.2.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](evanw/esbuild@v0.20.1...v0.20.2)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.4.2 to 5.4.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](microsoft/TypeScript@v5.4.2...v5.4.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [pygls](https://github.com/openlawlibrary/pygls) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/openlawlibrary/pygls/releases)
- [Changelog](https://github.com/openlawlibrary/pygls/blob/main/CHANGELOG.md)
- [Commits](openlawlibrary/pygls@v1.3.0...v1.3.1)

---
updated-dependencies:
- dependency-name: pygls
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.4.3 to 5.4.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](microsoft/TypeScript@v5.4.3...v5.4.4)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](pre-commit/pre-commit-hooks@v4.5.0...v4.6.0)
The parent language server can monitor `stderr` and forward any output
to the client. By not overriding Sphinx's logging setup, all features
like `suppress_warnings` should now also work as expected.

We can still extract the diagnostic info we need by converting the
logging handler to a simple filter
Bumps [@vscode/vsce](https://github.com/Microsoft/vsce) from 2.24.0 to 2.25.0.
- [Release notes](https://github.com/Microsoft/vsce/releases)
- [Commits](microsoft/vscode-vsce@v2.24.0...v2.25.0)

---
updated-dependencies:
- dependency-name: "@vscode/vsce"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 5.4.4 to 5.4.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](microsoft/TypeScript@v5.4.4...v5.4.5)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
updates:
- [github.com/psf/black: 24.3.0 → 24.4.0](psf/black@24.3.0...24.4.0)
- Automatically enter pdb session on error
- Add `project` variable making it easier to switch between sphinx
  projects
Now that esbonio *should* leave broken Sphinx setups alone, it
shouldn't be too obnoxious to raise an error notification each time
this happens
It turns out we still need to override the logging setup - so that we
can inject our `DiagnosticFilter`. However, this time around our
overriden setup is *much* less invasive.
This ensures that sphinx output obeys settings like `esbonio.logging.window`
Hopefully, by making comparisons of the `path` component for `file://`
uris on Windows case insensitive, we don't fail tests on Windows that
should not be failing.
Instead of using filepaths to track diagnostics and content overrides,
use `Uri`. This should automatically handle paths with different cases
on Windows.
This is no longer used and can still be found in the history of the repository
@alcarney alcarney merged commit 278de42 into release Apr 20, 2024
18 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants