Skip to content

Commit

Permalink
improve recipe for language server
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Dec 19, 2024
1 parent 29bd20c commit 778008b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions docs/recipes/language-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 778008b

Please sign in to comment.