diff --git a/README.md b/README.md index 9602b1a..8b1084e 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ its frontend, compiler, reconstruction, or Workshop integration internally. ## Status -- Protocol versions: **1.0** and additive **1.1** (specified in [`spec/lpp-v1.md`](spec/lpp-v1.md)). +- Protocol versions: **1.0**, additive **1.1** file-entry loading, and additive **1.2** directory targets (specified in [`spec/lpp-v1.md`](spec/lpp-v1.md)). - Repository state: initial published contract and conformance suite. - Wright is a client/consumer of the protocol; LPP is not a dependency from the language implementation back into Wright tooling internals. diff --git a/conformance/README.md b/conformance/README.md index f28f1e4..df4d519 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -1,6 +1,6 @@ # LPP v1 Conformance Suite -This directory contains the test suite and fixtures for the Language Provider Protocol v1 wire contract, including the LPP 1.1 additive project-loading revision (see [`../spec/lpp-v1.md`](../spec/lpp-v1.md)). +This directory contains the test suite and fixtures for the Language Provider Protocol v1 wire contract, including the LPP 1.1 file-entry and LPP 1.2 directory-target project-loading revisions (see [`../spec/lpp-v1.md`](../spec/lpp-v1.md)). ## Layout @@ -10,7 +10,7 @@ mock-provider/ Reference provider for the "x-demo-lang" equation DSL (Rus runner/ Conformance runner that replays fixtures against any provider binary ``` -* **Fixtures** (`fixtures/v1/`): one JSON file per scenario. Each scenario defines a session with request/response steps, optional CLI flags, and the expected exit code. Responses are compared after JSON parsing so key order does not matter. The directory contains both LPP 1.0 and LPP 1.1 scenarios. +* **Fixtures** (`fixtures/v1/`): one JSON file per scenario. Each scenario defines a session with request/response steps, optional CLI flags, and the expected exit code. Responses are compared after JSON parsing so key order does not matter. The directory contains LPP 1.0, LPP 1.1, and LPP 1.2 scenarios. * **Mock provider** (`mock-provider/`): a small Rust binary implementing the full LPP v1 surface for a demonstration language distinct from OPY and OSTW. It runs over stdio so clients (like the Wright LPP client in wrightkit/wright#142) can test against it directly. * **Runner** (`runner/`): spawns a fresh provider process per scenario, feeds requests over stdin, validates stdout responses against expectations, and checks the process exit code. diff --git a/conformance/fixtures/v1/41-project-loading-directory-target.json b/conformance/fixtures/v1/41-project-loading-directory-target.json new file mode 100644 index 0000000..2c5570f --- /dev/null +++ b/conformance/fixtures/v1/41-project-loading-directory-target.json @@ -0,0 +1,28 @@ +{ + "name": "project-loading-directory-target", + "description": "LPP 1.2 lets a client select a directory while the provider owns default-entry selection and source closure loading.", + "scope": "protocol", + "providerArgs": ["--protocol-version", "1.2"], + "projectFiles": { + "entry.xdl": "puzzle entry {\n target = 2\n start = 1\n ops {\n plus1: x => x + 1\n }\n solution = [ plus1 ]\n}\n", + "support.xdl": "puzzle support {\n target = 2\n start = 1\n ops {\n plus1: x => x + 1\n }\n solution = [ plus1 ]\n}\n" + }, + "steps": [ + { + "request": {"jsonrpc": "2.0", "id": 1, "method": "lpp/initialize", "params": {"protocolVersion": "1.2"}}, + "expectResponse": {"jsonrpc": "2.0", "id": 1, "result": {"protocolVersion": "1.2", "serverInfo": {"name": "lpp-mock-provider", "version": "0.1.0"}, "languages": [{"id": "x-demo-lang", "extensions": ["xdl"]}], "capabilities": {"check": true, "compile": true, "reconstruct": true, "symbols": true, "definition": true, "references": true, "rename": true, "editValidation": true, "projectLoading": true}}} + }, + { + "request": {"jsonrpc": "2.0", "id": 2, "method": "lpp/check", "params": {"entry": {"uri": "${PROJECT_URI}", "languageId": "x-demo-lang", "version": 7, "kind": "directory"}}}, + "expectResponse": {"jsonrpc": "2.0", "id": 2, "result": {"documents": [{"uri": "${PROJECT_URI}/entry.xdl", "version": 7, "diagnostics": []}, {"uri": "${PROJECT_URI}/support.xdl", "version": 7, "diagnostics": []}]}} + }, + { + "request": {"jsonrpc": "2.0", "id": 3, "method": "lpp/compile", "params": {"entry": {"uri": "${PROJECT_URI}", "languageId": "x-demo-lang", "version": 7, "kind": "directory"}}}, + "expectResponse": {"jsonrpc": "2.0", "id": 3, "result": {"diagnostics": [{"uri": "${PROJECT_URI}/entry.xdl", "version": 7, "diagnostics": []}, {"uri": "${PROJECT_URI}/support.xdl", "version": 7, "diagnostics": []}], "artifact": {"format": "x-demo/puzzle-eval-v1", "content": "{\"name\":\"entry\",\"ops\":[{\"arg\":1,\"name\":\"plus1\",\"op\":\"+\"}],\"solution\":[\"plus1\"],\"start\":1,\"target\":2,\"value\":2}"}}} + }, + { + "request": {"jsonrpc": "2.0", "id": 4, "method": "lpp/shutdown", "params": {}}, + "expectResponse": {"jsonrpc": "2.0", "id": 4, "result": null} + } + ] +} diff --git a/conformance/fixtures/v1/42-project-loading-directory-version-gate.json b/conformance/fixtures/v1/42-project-loading-directory-version-gate.json new file mode 100644 index 0000000..b071f83 --- /dev/null +++ b/conformance/fixtures/v1/42-project-loading-directory-version-gate.json @@ -0,0 +1,15 @@ +{ + "name": "project-loading-directory-version-gate", + "description": "A directory target is rejected in an LPP 1.1 session instead of receiving LPP 1.2 directory semantics.", + "scope": "protocol", + "providerArgs": ["--protocol-version", "1.1"], + "projectFiles": { + "entry.xdl": "puzzle entry {\n target = 2\n start = 1\n ops {\n plus1: x => x + 1\n }\n solution = [ plus1 ]\n}\n" + }, + "steps": [ + {"request":{"jsonrpc":"2.0","id":1,"method":"lpp/initialize","params":{"protocolVersion":"1.1"}},"expectResponse":{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"1.1","serverInfo":{"name":"lpp-mock-provider","version":"0.1.0"},"languages":[{"id":"x-demo-lang","extensions":["xdl"]}],"capabilities":{"check":true,"compile":true,"reconstruct":true,"symbols":true,"definition":true,"references":true,"rename":true,"editValidation":true,"projectLoading":true}}}}, + {"request":{"jsonrpc":"2.0","id":2,"method":"lpp/check","params":{"entry":{"uri":"${PROJECT_URI}","languageId":"x-demo-lang","version":7,"kind":"directory"}}},"expectResponse":{"jsonrpc":"2.0","id":2,"error":{"code":-32000,"message":"directory project targets require protocol version 1.2","data":{"lpp":{"kind":"invalidEntry","details":{"entryUri":"${PROJECT_URI}","reason":"unsupportedKind"}}}}}}, + {"request":{"jsonrpc":"2.0","id":3,"method":"lpp/shutdown","params":{}},"expectResponse":{"jsonrpc":"2.0","id":3,"result":null}} + ], + "expectExitCode": 0 +} diff --git a/conformance/mock-provider/src/main.rs b/conformance/mock-provider/src/main.rs index 415617e..ad39846 100644 --- a/conformance/mock-provider/src/main.rs +++ b/conformance/mock-provider/src/main.rs @@ -14,6 +14,7 @@ use puzzle::{ const DEFAULT_PROTOCOL_VERSION: &str = "1.0"; const PROTOCOL_VERSION_1_1: &str = "1.1"; +const PROTOCOL_VERSION_1_2: &str = "1.2"; const SERVER_NAME: &str = "lpp-mock-provider"; const LANGUAGE_ID: &str = "x-demo-lang"; const LANGUAGE_EXTENSIONS: [&str; 1] = ["xdl"]; @@ -89,7 +90,10 @@ impl Capabilities { "rename": self.rename, "editValidation": self.edit_validation, }); - if protocol_version == PROTOCOL_VERSION_1_1 { + if matches!( + protocol_version, + PROTOCOL_VERSION_1_1 | PROTOCOL_VERSION_1_2 + ) { capabilities["projectLoading"] = json!(self.project_loading); } capabilities @@ -137,6 +141,13 @@ struct ProjectEntry { uri: String, language_id: String, version: i64, + kind: Option, +} + +#[derive(Debug, Clone, Copy)] +enum ProjectTargetKind { + File, + Directory, } #[allow(dead_code)] @@ -276,7 +287,10 @@ fn parse_args() -> (String, Capabilities) { eprintln!("lpp-mock-provider: --protocol-version requires a version"); std::process::exit(2); }; - if version != DEFAULT_PROTOCOL_VERSION && version != PROTOCOL_VERSION_1_1 { + if version != DEFAULT_PROTOCOL_VERSION + && version != PROTOCOL_VERSION_1_1 + && version != PROTOCOL_VERSION_1_2 + { eprintln!("lpp-mock-provider: unsupported protocol version '{version}'"); std::process::exit(2); } @@ -838,7 +852,10 @@ fn documents_for_request( match (documents, entry) { (Some(documents), None) => Ok((documents, None)), (None, Some(entry)) => { - if server.protocol_version.as_deref() != Some(PROTOCOL_VERSION_1_1) { + if !matches!( + server.protocol_version.as_deref(), + Some(PROTOCOL_VERSION_1_1) | Some(PROTOCOL_VERSION_1_2) + ) { return Err(HandlerError::Std(-32602, "Invalid params")); } if !server.caps.project_loading { @@ -855,14 +872,41 @@ fn documents_for_request( "project entry version must be a non-negative integer".to_string(), )); } - let (documents, canonical_entry_uri) = load_project(&entry)?; + let target_kind = + project_target_kind(&entry, server.protocol_version.as_deref().unwrap())?; + let (documents, canonical_entry_uri) = load_project(&entry, target_kind)?; Ok((documents, Some(canonical_entry_uri))) } _ => Err(HandlerError::Std(-32602, "Invalid params")), } } -fn load_project(entry: &ProjectEntry) -> Result<(HashMap, String), HandlerError> { +fn project_target_kind( + entry: &ProjectEntry, + protocol_version: &str, +) -> Result { + match entry.kind.as_deref() { + None | Some("file") => Ok(ProjectTargetKind::File), + Some("directory") if protocol_version == PROTOCOL_VERSION_1_2 => { + Ok(ProjectTargetKind::Directory) + } + Some("directory") => Err(HandlerError::Lpp( + "invalidEntry", + json!({ "entryUri": entry.uri, "reason": "unsupportedKind" }), + "directory project targets require protocol version 1.2".to_string(), + )), + Some(_) => Err(HandlerError::Lpp( + "invalidEntry", + json!({ "entryUri": entry.uri, "reason": "unsupportedKind" }), + "project target kind is not supported".to_string(), + )), + } +} + +fn load_project( + entry: &ProjectEntry, + target_kind: ProjectTargetKind, +) -> Result<(HashMap, String), HandlerError> { if entry.language_id != LANGUAGE_ID { return Err(HandlerError::Lpp( "invalidEntry", @@ -881,35 +925,84 @@ fn load_project(entry: &ProjectEntry) -> Result<(HashMap, Stri )); }; let entry_path = std::fs::canonicalize(&entry_path).map_err(|_| { + let (reason, message) = match target_kind { + ProjectTargetKind::File => ("entryNotFound", "project entry could not be loaded"), + ProjectTargetKind::Directory => { + ("targetNotFound", "project target could not be loaded") + } + }; HandlerError::Lpp( "projectLoadFailed", json!({ "entryUri": entry.uri, - "reason": "entryNotFound", + "reason": reason, "uri": entry.uri, }), - "project entry could not be loaded".to_string(), + message.to_string(), ) })?; - if !entry_path.is_file() { - return Err(HandlerError::Lpp( - "projectLoadFailed", - json!({ - "entryUri": entry.uri, - "reason": "entryNotFile", - "uri": entry.uri, - }), - "project entry is not a file".to_string(), - )); - } - let canonical_entry_uri = path_to_file_uri(&entry_path).ok_or_else(|| { + let (project_root, selected_entry) = match target_kind { + ProjectTargetKind::File => { + if !entry_path.is_file() { + return Err(HandlerError::Lpp( + "projectLoadFailed", + json!({ + "entryUri": entry.uri, + "reason": "entryNotFile", + "uri": entry.uri, + }), + "project entry is not a file".to_string(), + )); + } + let root = entry_path.parent().expect("a file has a parent"); + (root.to_path_buf(), entry_path) + } + ProjectTargetKind::Directory => { + if !entry_path.is_dir() { + return Err(HandlerError::Lpp( + "projectLoadFailed", + json!({ + "entryUri": entry.uri, + "reason": "targetNotDirectory", + "uri": entry.uri, + }), + "project target is not a directory".to_string(), + )); + } + let selected = entry_path.join("entry.xdl"); + if !selected.is_file() { + return Err(HandlerError::Lpp( + "projectLoadFailed", + json!({ + "entryUri": entry.uri, + "reason": "defaultEntryNotFound", + "uri": entry.uri, + }), + "project directory has no default entry".to_string(), + )); + } + let selected = selected.canonicalize().map_err(|error| { + let uri = path_to_file_uri(&selected).unwrap_or_else(|| entry.uri.clone()); + HandlerError::Lpp( + "projectLoadFailed", + json!({ + "entryUri": entry.uri, + "reason": "defaultEntryUnreadable", + "uri": uri, + }), + format!("default project entry could not be resolved: {error}"), + ) + })?; + (entry_path, selected) + } + }; + let canonical_entry_uri = path_to_file_uri(&selected_entry).ok_or_else(|| { HandlerError::Lpp( "projectLoadFailed", json!({ "entryUri": entry.uri, "reason": "sourceIdentityUnavailable" }), "project entry has no stable URI".to_string(), ) })?; - let project_root = entry_path.parent().expect("a file has a parent"); let mut paths: Vec = std::fs::read_dir(project_root) .map_err(|error| { HandlerError::Lpp( @@ -924,7 +1017,7 @@ fn load_project(entry: &ProjectEntry) -> Result<(HashMap, Stri .filter_map(Result::ok) .map(|directory_entry| directory_entry.path()) .filter(|path| { - path == &entry_path || path.extension().is_some_and(|extension| extension == "xdl") + path == &selected_entry || path.extension().is_some_and(|extension| extension == "xdl") }) .collect(); paths.sort(); @@ -945,7 +1038,7 @@ fn load_project(entry: &ProjectEntry) -> Result<(HashMap, Stri HandlerError::Lpp( "projectLoadFailed", json!({ - "entryUri": entry.uri, + "entryUri": entry.uri, "reason": "sourceIdentityUnavailable", }), "source file has no stable URI".to_string(), diff --git a/spec/lpp-v1.md b/spec/lpp-v1.md index 52a260b..d6ccf29 100644 --- a/spec/lpp-v1.md +++ b/spec/lpp-v1.md @@ -2,7 +2,7 @@ | | | | --- | --- | -| Protocol versions | `1.0`, `1.1` | +| Protocol versions | `1.0`, `1.1`, `1.2` | | Status | Normative for protocol major version 1 | | Transport | JSON-RPC 2.0 over stdio, newline-delimited framing | | Conformance | `conformance/fixtures/v1/` + `conformance/runner` + `conformance/mock-provider` | @@ -244,7 +244,8 @@ client MUST include every document the request may need; the provider MUST NOT assume any document exists outside the set and MUST NOT return edits for documents it did not receive. LPP 1.1 entry-based `check` and `compile` requests are the explicit filesystem-loading exception defined in -[Section 8.1](#81-entry-based-project-requests-lpp-11). +[Section 8.1](#81-entry-based-project-requests-lpp-11) and extended to +directory targets in [Section 8.2](#82-directory-project-requests-lpp-12). ### 6.6 Diagnostic @@ -297,8 +298,8 @@ requests are the explicit filesystem-loading exception defined in ### 6.10 Project entry -A project entry identifies the source file selected by the client for a -provider-owned filesystem project load: +A project entry identifies the source target selected by the client for a +provider-owned filesystem project load. The example below selects a file: ```json { @@ -316,6 +317,10 @@ provider-owned filesystem project load: filesystem snapshot for this request. It is echoed in every source result. It is not a filesystem content hash and does not provide cross-request stale detection. +* `kind`: OPTIONAL for LPP 1.1 and LPP 1.2. When omitted, it requests the + existing file-entry behavior. LPP 1.2 clients MUST use `"directory"` when + the provider must discover the effective project entry from a directory; + `"file"` may be used explicitly for file-entry behavior. The entry identifies the user's selected source target only. The provider determines the effective project root and source closure according to the @@ -342,7 +347,7 @@ Initialization and capability negotiation. The client MUST send | Field | Type | Description | | --- | --- | --- | -| `protocolVersion` | string | The protocol version the client wants to speak: `"1.0"` or `"1.1"`. | +| `protocolVersion` | string | The protocol version the client wants to speak: `"1.0"`, `"1.1"`, or `"1.2"`. | | `clientInfo` | object, OPTIONAL | `{ "name": string, "version": string }` identifying the client. | ### 7.2 Result @@ -369,10 +374,10 @@ Initialization and capability negotiation. The client MUST send | Field | Type | Description | | --- | --- | --- | -| `protocolVersion` | string | The protocol version the provider will speak: `"1.0"` or `"1.1"`. | +| `protocolVersion` | string | The protocol version the provider will speak: `"1.0"`, `"1.1"`, or `"1.2"`. | | `serverInfo` | object | `{ "name": string, "version": string }` identifying the provider. | | `languages` | array | One entry per source language the provider serves. | -| `capabilities` | object | One boolean field per capability. LPP 1.0 requires the eight fields listed below; LPP 1.1 additionally requires `projectLoading`. | +| `capabilities` | object | One boolean field per capability. LPP 1.0 requires the eight fields listed below; LPP 1.1 and 1.2 additionally require `projectLoading`. | Each language entry: `{ "id": string, "extensions": [string] }`. `extensions` is the list of file extensions the provider associates with the language, @@ -394,7 +399,7 @@ extension. | `references` | `lpp/references` | Find references to the symbol at a position. | | `rename` | `lpp/rename` | Compute source edits for a semantic rename. | | `editValidation` | `lpp/validateEdits` | Validate a set of source edits against a document. | -| `projectLoading` | `lpp/check`, `lpp/compile` | Accept a client-selected entry and load its filesystem-backed source project. LPP 1.1 only. | +| `projectLoading` | `lpp/check`, `lpp/compile` | Accept a client-selected entry or directory target and load its filesystem-backed source project. LPP 1.1 and 1.2. | * The provider MUST set each capability to `true` only if it fully implements the corresponding method(s). @@ -433,8 +438,9 @@ when practical: ``` The client then decides whether to terminate the session or restart with a -supported version. LPP 1.0 clients MUST send `"1.0"`; clients using the -project-loading extension MUST send `"1.1"`. +supported version. LPP 1.0 clients MUST send `"1.0"`; clients using file-entry +project loading MUST send `"1.1"` or `"1.2"`; clients using directory targets +MUST send `"1.2"`. ## 8. Common request parameters @@ -443,15 +449,15 @@ Document-scoped methods share this parameter shape: | Field | Type | Methods | Description | | --- | --- | --- | --- | | `documents` | DocumentSet | `check`, `compile`, `symbols`, `rename` | The documents to operate on. | -| `entry` | Project entry | `check`, `compile` in LPP 1.1 | Alternative to `documents`; asks the provider to load the source closure from the selected entry. | +| `entry` | Project entry | `check`, `compile` in LPP 1.1 and 1.2 | Alternative to `documents`; asks the provider to load the source closure from the selected entry or directory target. | | `document` | Document | `definition`, `references`, `validateEdits` | The single document to operate on. | | `projectRoot` | string, OPTIONAL | `check`, `compile`, `symbols`, `rename` | URI identifying the project the documents belong to. Purely informational in v1; providers MUST accept and MAY use it. | -### 8.1 Entry-based project requests (LPP 1.1) +### 8.1 Entry-based project requests (LPP 1.1 and 1.2) -In LPP 1.1, `lpp/check` and `lpp/compile` accept either `documents` or +In LPP 1.1 and 1.2, `lpp/check` and `lpp/compile` accept either `documents` or `entry`, but not both. An `entry` request is available only when the provider -accepted protocol version `1.1` and advertised `projectLoading: true`. +accepted protocol version `1.1` or `1.2` and advertised `projectLoading: true`. The optional `projectRoot` field remains legal and is informational; the provider accepts it but determines the effective project root and source closure from the entry and the source language's rules. @@ -471,12 +477,13 @@ closure from the entry and the source language's rules. } ``` -The provider MUST load the entry and every additional source file required by -the source language's project rules, then perform the requested operation on -that complete source closure. It MUST NOT require the client to list those -files in advance. The provider MUST read only the filesystem project -identified by the entry and MUST NOT treat the client's working directory as a -project root unless that is the source language's documented rule. +For a file target, the provider MUST load the entry and every additional +source file required by the source language's project rules, then perform the +requested operation on that complete source closure. It MUST NOT require the +client to list those files in advance. The provider MUST read only the +filesystem project identified by the entry and MUST NOT treat the client's +working directory as a project root unless that is the source language's +documented rule. The result uses the normal `lpp/check` or `lpp/compile` shape. It MUST include diagnostics for every loaded source document, including documents that contain @@ -493,6 +500,34 @@ an LPP error of kind `projectLoadFailed`. The `details` object MUST contain `entryUri` and a provider-defined `reason`; a required-file failure SHOULD also include the affected `uri`. +### 8.2 Directory project requests (LPP 1.2) + +LPP 1.2 extends the `entry` object with `kind: "directory"`: + +```json +{ + "entry": { + "uri": "file:///project", + "languageId": "opy", + "version": 7, + "kind": "directory" + } +} +``` + +The URI MUST identify an absolute filesystem directory. The provider owns +selection of the effective project entry, project root, and source closure +according to the source language's rules. The client MUST NOT enumerate files, +parse project manifests, or select an entry file to emulate this behavior. +Providers MUST return canonical source identities for every loaded document and +MUST fail with `projectLoadFailed` if the directory or its language-owned +default entry cannot be loaded. A `kind` of `"file"` has the same semantics as +the LPP 1.1 entry request. LPP 1.1 clients omit `kind` and therefore always +request file-entry behavior. A directory target sent in an LPP 1.1 session +MUST be rejected as `invalidEntry`; the provider MUST NOT perform directory +entry selection. Any other `kind` value MUST also be rejected as +`invalidEntry`. + ## 9. lpp/check Produce diagnostics for a set of documents. The provider MUST parse and @@ -540,7 +575,7 @@ analyze every document in the set and MUST report all diagnostics found. ## 10. lpp/compile -Compile a document set into a single Workshop artifact. In LPP 1.1, an +Compile a document set into a single Workshop artifact. In LPP 1.1 and 1.2, an entry-based request compiles the provider-loaded source closure as one unit; the `compile.requiresSingleDocument` refusal applies only to a document-supplied request that contains more than one document. @@ -929,8 +964,8 @@ All LPP-defined errors use JSON-RPC error code `-32000` and carry a structured | `invalidRequest` | `{ "reason": string }` | Session violations: `notInitialized`, `alreadyInitialized`, `notificationNotSupported`. | | `invalidLanguage` | `{ "languageId": string }` | A document's `languageId` is not served by the provider. | | `invalidDocument` | `{ "uri"?: string, "reason": string }` | A document is unusable (for example a negative version). | -| `invalidEntry` | `{ "entryUri": string, "reason": string }` | A project entry has an unsupported URI or language. LPP 1.1 only. | -| `projectLoadFailed` | `{ "entryUri": string, "reason": string, "uri"?: string }` | A filesystem-backed project entry or required source file could not be loaded. LPP 1.1 only. | +| `invalidEntry` | `{ "entryUri": string, "reason": string }` | A project entry/target has an unsupported URI, language, or kind. LPP 1.1+. | +| `projectLoadFailed` | `{ "entryUri": string, "reason": string, "uri"?: string }` | A filesystem-backed project entry/target or required source file could not be loaded. LPP 1.1+. | | `invalidPosition` | `{ "uri": string, "position": Position }` | A position outside the document. | | `invalidArtifact` | `{ "reason": string }` | An artifact in a supported format whose content is malformed. | | `capabilityUnavailable` | `{ "capability": string, "method": string }` | A method was invoked whose capability was not negotiated. | @@ -955,8 +990,8 @@ clients MUST NOT parse `message`. ### 19.1 Versioning scheme * Protocol versions are strings of the form `MAJOR.MINOR` (for example - `"1.0"`). LPP 1.0 is the first published version and LPP 1.1 is an additive - revision of the same protocol major version. + `"1.0"`). LPP 1.0 is the first published version; LPP 1.1 adds file-entry + project loading and LPP 1.2 adds directory targets. * `MAJOR` changes are breaking: message shapes, method semantics, or framing may change. A breaking change always produces a new MAJOR version, and clients and providers speaking different MAJOR versions are never expected @@ -973,8 +1008,9 @@ clients MUST NOT parse `message`. * The provider either accepts it (echoing the version in the result) or fails with `protocolVersionMismatch` listing `supportedProtocolVersions`. * A client that receives the mismatch MUST pick the highest mutually supported - version and restart the session, or terminate. LPP 1.1 clients MAY use the - `projectLoading` capability; clients that need it MUST request `"1.1"`. + version and restart the session, or terminate. LPP 1.1 and 1.2 clients MAY + use the `projectLoading` capability; clients that need directory targets MUST + request `"1.2"`. * A provider MUST support at least one of the versions it lists in `supportedProtocolVersions`. @@ -1000,8 +1036,8 @@ contract: initialization, capability negotiation, diagnostics, check, compile, reconstruct, symbols, definition, references, rename, edit validation, project loading, errors/refusals, protocol mismatch, malformed messages, - and shutdown. The same directory covers LPP 1.0 and its LPP 1.1 additive - revision. + and shutdown. The same directory covers LPP 1.0, its LPP 1.1 file-entry + revision, and its LPP 1.2 directory-target revision. * `conformance/runner/`: a runner that replays fixtures against any provider binary and compares responses exactly. * `conformance/mock-provider/`: the reference provider for the demonstration @@ -1022,8 +1058,8 @@ Methods: | --- | --- | --- | --- | | `lpp/initialize` | none | `{ protocolVersion, clientInfo? }` | `{ protocolVersion, serverInfo, languages, capabilities }` | | `lpp/shutdown` | none | `{}` | `null` | -| `lpp/check` | `check`; plus `projectLoading` for an LPP 1.1 `entry` request | `{ documents, projectRoot? }` or `{ entry, projectRoot? }` | `{ documents: [{ uri, version, diagnostics }] }` | -| `lpp/compile` | `compile`; plus `projectLoading` for an LPP 1.1 `entry` request | `{ documents, projectRoot? }` or `{ entry, projectRoot? }` | `{ diagnostics: [{ uri, version, diagnostics }], artifact }` | +| `lpp/check` | `check`; plus `projectLoading` for an LPP 1.1/1.2 `entry` request | `{ documents, projectRoot? }` or `{ entry, projectRoot? }` | `{ documents: [{ uri, version, diagnostics }] }` | +| `lpp/compile` | `compile`; plus `projectLoading` for an LPP 1.1/1.2 `entry` request | `{ documents, projectRoot? }` or `{ entry, projectRoot? }` | `{ diagnostics: [{ uri, version, diagnostics }], artifact }` | | `lpp/reconstruct` | `reconstruct` | `{ artifact }` | `{ source, uri? }` | | `lpp/symbols` | `symbols` | `{ documents, projectRoot? }` | `{ documents: [{ uri, version, symbols }] }` | | `lpp/definition` | `definition` | `{ document, position }` | `{ locations }` |