lsp-max 26.7.1

Law-state LSP runtime: max LSP 3.18 coverage, process-mining conformance, receipt-chain admission
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::jsonrpc::{Error, Result};
use lsp_types_max::{Location, ReferenceParams};
use url::Url;

/// Asks the server for all references to a symbol.
pub async fn references(params: ReferenceParams) -> Result<Option<Vec<Location>>> {
    let uri = &params.text_document_position.text_document.uri;
    let pos = params.text_document_position.position;
    let views = crate::runtime::control_plane::views::get_views();
    let url = Url::parse(uri.as_str()).map_err(|_| Error::internal_error())?;

    if let Some(locs) = crate::runtime::control_plane::views::lookup_references(views, &url, pos) {
        Ok(Some(locs))
    } else {
        Ok(None)
    }
}