diff --git a/docs/recipes/language-server.md b/docs/recipes/language-server.md index f86a3d281..d8b9a82ae 100644 --- a/docs/recipes/language-server.md +++ b/docs/recipes/language-server.md @@ -57,18 +57,28 @@ The same settings can be configured using Java system properties: ## Component Implementation -The LSP server delegates all language-specific functionality to a CFML component. This component must implement the `execute` method that receives JSON-formatted LSP messages: +The LSP server delegates all language-specific functionality to a CFML component. By default, this component is located at: + +``` +{lucee-root-directory}/lucee-server/context/components/org/lucee/cfml/lsp/LSPEndpoint.cfc +``` + +The component must implement the `execute` method that receives JSON-formatted LSP messages: ```cfml // org/lucee/cfml/lsp/LSPEndpoint.cfc component { public string function execute(required string jsonMessage) { - // Process LSP message and return response - return jsonMessageResponse; + var json=deserializeJSON(jsonMessage); + systemOutput(json,1,1); + json.addition="myAddition"; + return serializeJSON(json); } } ``` +You can customize the location of this component using the `lucee.lsp.component` configuration option. + ## Logging The LSP server logs its activity to Lucee's logging system. By default, it uses the 'debug' log (temporary because this is info by default),