From 798957a210aaf7cf347f901e708228b1dd6b6019 Mon Sep 17 00:00:00 2001 From: Daniel Banck Date: Thu, 4 Jul 2024 12:40:41 +0200 Subject: [PATCH] Document feature `Start`, `Stop`, and diagnostics collection --- docs/architecture.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/architecture.md b/docs/architecture.md index 1e98948c..917e7565 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -92,7 +92,7 @@ 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 @@ -100,6 +100,9 @@ The existing `variables` feature is a good starting point when introducing a new 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