Add directory page extension APIs
Created by: felixfbecker
Extends our new view API to support registering views on directories. Adds a new editorviewer called DirectoryViewer
. The DirectoryViewer and Workspace are passed to the view provider.
PR that uses this API in Codecov: https://github.com/codecov/sourcegraph-codecov/pull/51
Implementation notes:
- DirectoryViewers are in the editor service, but don't have a model (just a URI), so no changes to the model service.
- I send the full context from the main thread instead of an ID to avoid race conditions with the editor not being synced yet. It would be nice to get this solved on an architectural level.
- It would also be nice to have comlink transfer handlers working.
- I named it
DirectoryViewer
, notDirectoryEditor
, because a directory editor doesn't make sense. I didn't do a full rename of our internal editor service etc to a "viewer service" (so internally theDirectoryViewer
is still an editor), because that can be easily changed later, while changing the public union type tag is a breaking. - No support for context key expressions yet.
- Added some new type guards
✨