linol/linol/Linol/Server/Make/index.html
2025-01-10 16:49:28 +00:00

8 lines
10 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Make (linol.Linol.Server.Make)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.4"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../../index.html">linol</a> &#x00BB; <a href="../../index.html">Linol</a> &#x00BB; <a href="../index.html">Server</a> &#x00BB; Make</nav><header class="odoc-preamble"><h1>Module <code><span>Server.Make</span></code></h1><p>Server interface for some IO substrate.</p></header><nav class="odoc-toc"><ul><li><a href="#parameters">Parameters</a></li><li><a href="#signature">Signature</a></li></ul></nav><div class="odoc-content"><h2 id="parameters"><a href="#parameters" class="anchor"></a>Parameters</h2><div class="odoc-spec"><div class="spec parameter anchored" id="argument-1-IO"><a href="#argument-1-IO" class="anchor"></a><code><span><span class="keyword">module</span> </span><span><a href="argument-1-IO/index.html">IO</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><h2 id="signature"><a href="#signature" class="anchor"></a>Signature</h2><div class="odoc-spec"><div class="spec module anchored" id="module-Position"><a href="#module-Position" class="anchor"></a><code><span><span class="keyword">module</span> Position</span><span> = <a href="../../../../lsp/Lsp/Types/Position/index.html">Lsp.Types.Position</a></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Range"><a href="#module-Range" class="anchor"></a><code><span><span class="keyword">module</span> Range</span><span> = <a href="../../../../lsp/Lsp/Types/Range/index.html">Lsp.Types.Range</a></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Diagnostic"><a href="#module-Diagnostic" class="anchor"></a><code><span><span class="keyword">module</span> Diagnostic</span><span> = <a href="../../../../lsp/Lsp/Types/Diagnostic/index.html">Lsp.Types.Diagnostic</a></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-DiagnosticSeverity"><a href="#module-DiagnosticSeverity" class="anchor"></a><code><span><span class="keyword">module</span> DiagnosticSeverity</span><span> = <a href="../../../../lsp/Lsp/Types/DiagnosticSeverity/index.html">Lsp.Types.DiagnosticSeverity</a></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Req_id"><a href="#module-Req_id" class="anchor"></a><code><span><span class="keyword">module</span> Req_id</span><span> = <a href="../Req_id/index.html">Req_id</a></span></code></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-server_request_handler_pair"><a href="#type-server_request_handler_pair" class="anchor"></a><code><span><span class="keyword">type</span> server_request_handler_pair</span><span> = </span></code><ol><li id="type-server_request_handler_pair.Request_and_handler" class="def variant constructor anchored"><a href="#type-server_request_handler_pair.Request_and_handler" class="anchor"></a><code><span>| </span><span><span class="constructor">Request_and_handler</span> : <span><span class="type-var">'from_server</span> <a href="../../../../lsp/Lsp/Server_request/index.html#type-t">Lsp.Server_request.t</a></span>
* <span>(<span><span><span>(<span class="type-var">'from_server</span>, <a href="../../../../jsonrpc/Jsonrpc/Response/Error/index.html#type-t">Jsonrpc.Response.Error.t</a>)</span> <a href="../../../../ocaml/Stdlib/index.html#type-result">result</a></span> <span class="arrow">&#45;&gt;</span></span>
<span>unit <a href="argument-1-IO/index.html#type-t">IO.t</a></span>)</span> <span class="arrow">&#45;&gt;</span> <a href="#type-server_request_handler_pair">server_request_handler_pair</a></span></code></li></ol></div><div class="spec-doc"><p>A variant carrying a <code>Lsp.Server_request.t</code> and a handler for its return value. The request is stored in order to allow us to discriminate its existential variable.</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-send_request"><a href="#type-send_request" class="anchor"></a><code><span><span class="keyword">type</span> send_request</span><span> = <span><a href="#type-server_request_handler_pair">server_request_handler_pair</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="../Req_id/index.html#type-t">Req_id.t</a> <a href="argument-1-IO/index.html#type-t">IO.t</a></span></span></code></div><div class="spec-doc"><p>The type of the action that sends a request from the server to the client and handles its response.</p></div></div><div class="odoc-spec"><div class="spec class anchored" id="class-base_server"><a href="#class-base_server" class="anchor"></a><code><span><span class="keyword">class</span> <span class="keyword">virtual</span> </span><span><a href="class-base_server/index.html">base_server</a></span><span> : <span class="keyword">object</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>The server baseclass</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-async"><a href="#val-async" class="anchor"></a><code><span><span class="keyword">val</span> async : <span><a href="class-base_server/index.html">base_server</a> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>unit <span class="arrow">&#45;&gt;</span></span> <span>unit <a href="argument-1-IO/index.html#type-t">IO.t</a></span>)</span> <span class="arrow">&#45;&gt;</span></span> <span>unit <a href="argument-1-IO/index.html#type-t">IO.t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec class anchored" id="class-notify_back"><a href="#class-notify_back" class="anchor"></a><code><span><span class="keyword">class</span> </span><span><a href="class-notify_back/index.html">notify_back</a></span><span> : <span><span class="label">notify_back</span>:<span>(<span><a href="../../../../lsp/Lsp/Server_notification/index.html#type-t">Lsp.Server_notification.t</a> <span class="arrow">&#45;&gt;</span></span>
<span>unit <a href="argument-1-IO/index.html#type-t">IO.t</a></span>)</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="label">server_request</span>:<span>(<span><a href="#type-server_request_handler_pair">server_request_handler_pair</a> <span class="arrow">&#45;&gt;</span></span>
<span><a href="../Req_id/index.html#type-t">Req_id.t</a> <a href="argument-1-IO/index.html#type-t">IO.t</a></span>)</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="label">workDoneToken</span>:<span><span>[ <span>`Int of int</span> <span><span>| `String</span> of string</span> ]</span> option</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="label">partialResultToken</span>:<span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?version</span>:
<span>int
option</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?uri</span>:<span><a href="../../../../lsp/Lsp/Types/DocumentUri/index.html#type-t">Lsp.Types.DocumentUri.t</a> option</span> <span class="arrow">&#45;&gt;</span></span> <span>unit <span class="arrow">&#45;&gt;</span></span> <span class="keyword">object</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>A wrapper to more easily reply to notifications</p></div></div><div class="odoc-spec"><div class="spec type anchored" id="type-doc_state"><a href="#type-doc_state" class="anchor"></a><code><span><span class="keyword">type</span> <span class="keyword">nonrec</span> doc_state</span><span> = <a href="../index.html#type-doc_state">doc_state</a></span><span> = </span><span>{</span></code><ol><li id="type-doc_state.uri" class="def record field anchored"><a href="#type-doc_state.uri" class="anchor"></a><code><span>uri : <a href="../../../../lsp/Lsp/Types/DocumentUri/index.html#type-t">Lsp.Types.DocumentUri.t</a>;</span></code></li><li id="type-doc_state.languageId" class="def record field anchored"><a href="#type-doc_state.languageId" class="anchor"></a><code><span>languageId : string;</span></code></li><li id="type-doc_state.version" class="def record field anchored"><a href="#type-doc_state.version" class="anchor"></a><code><span>version : int;</span></code></li><li id="type-doc_state.content" class="def record field anchored"><a href="#type-doc_state.content" class="anchor"></a><code><span>content : string;</span></code></li></ol><code><span>}</span></code></div><div class="spec-doc"><p>Current state of a document.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-lift_ok"><a href="#val-lift_ok" class="anchor"></a><code><span><span class="keyword">val</span> lift_ok : <span><span><span class="type-var">'a</span> <a href="argument-1-IO/index.html#type-t">IO.t</a></span> <span class="arrow">&#45;&gt;</span></span> <span><span><span>(<span class="type-var">'a</span>, <span class="type-var">'b</span>)</span> <a href="../../../../ocaml/Stdlib/index.html#type-result">result</a></span> <a href="argument-1-IO/index.html#type-t">IO.t</a></span></span></code></div></div><div class="odoc-spec"><div class="spec class anchored" id="class-server"><a href="#class-server" class="anchor"></a><code><span><span class="keyword">class</span> <span class="keyword">virtual</span> </span><span><a href="class-server/index.html">server</a></span><span> : <span class="keyword">object</span> ... <span class="keyword">end</span></span></code></div><div class="spec-doc"><p>An easily overloadable class. Pick the methods you want to support. The user must provide at least the callbacks for document lifecycle: open, close, update. The most basic LSP server should check documents when they're updated and report diagnostics back to the editor.</p></div></div></div></body></html>