Skip to content

Commit

Permalink
Document feature Start, Stop, and diagnostics collection
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanck committed Jul 5, 2024
1 parent cfb5e34 commit f58edd4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,17 @@ The `jobs` package of each feature contains all the different indexing jobs need

### Adding a new feature / "language"

The existing `variables` feature is a good starting point when introducing a new language. Usually you need roughly follow these steps to get a minimal working example:
The existing `variables` feature is a good starting point when introducing a new language. Usually you need to roughly follow these steps to get a minimal working example:

1. Create a new feature with the same folder structure as existing ones
1. Model the internal state representation
1. Subscribe to some events of the event bus
1. Add a parsing job that gets triggered from an event
1. Add a decoder that makes use of some kind of schema
1. Register the new feature in `internal/langserver/handlers/service.go`
- Start the feature as part of `configureSessionDependencies()`
- Make sure to call the `Stop()` function in `shutdown()` as well
1. If the feature reports diagnostics, add a call to collect them in `updateDiagnostics()` in `internal/langserver/handlers/hooks_module.go`

## Job Scheduler

Expand Down

0 comments on commit f58edd4

Please sign in to comment.