Superbol_project.Semantic_tokensSemantic tokens of documents, cached apart from the analysis for the LSP they are computed from.
Unlike other data derived from an analysis, they are computed along with it, as they need the tokens of the document, which analyses for the LSP do not hold (see Project_analysis.for_lsp).
Semantic tokens of a document, in the encoding of the LSP (relative positions, five integers per token). They only cover the document itself, and not its copybooks.
val key : Superbol_project__.Project_analysis.keys -> Superbol_cache.Types.keykey keys is the key under which the semantic tokens of the document keys are cached.
val slot : Superbol_project__.Project_analysis.keys -> Superbol_cache.Types.keyslot keys is the slot in which the semantic tokens of the document keys are recorded; it is theirs only, as they are stored at times of their own.
val store :
Superbol_cache.Cache.t ->
keys:Superbol_project__.Project_analysis.keys ->
label:string ->
t ->
unitstore cache ~keys ~label s records the semantic tokens s in cache, for as long as the analysis for the LSP they were computed from (under Project_analysis.key_for_lsp keys) holds, and supersedes the semantic tokens of previous versions of the document.
Analyses for the LSP may be stored without semantic tokens: front-ends that need them should consider such an analysis as missing.
val lookup :
Superbol_cache.Cache.t ->
keys:Superbol_project__.Project_analysis.keys ->
resolve:(Superbol_cache.Types.witness -> bool) ->
t optionlookup cache ~keys ~resolve retrieves the semantic tokens of the document keys from cache.
val cached_analysis_for_lsp :
Superbol_cache.Cache.t ->
platform:Cobol_common.Platform.TYPES.platform ->
?overrides:Superbol_project__.Project_analysis.overrides ->
semantic_tokens:
(filename:string ->
Cobol_parser.Outputs.artifacts ->
Cobol_typeck.Outputs.t ->
t) ->
keys:Superbol_project__.Project_analysis.keys ->
filename:string ->
contents:string ->
Superbol_project__.Project.TYPES.project ->
Superbol_project__.Project_analysis.for_lsp * boolcached_analysis_for_lsp cache ~platform ?overrides ~semantic_tokens ~keys ~filename ~contents project is like Project_analysis.cached_analysis_for_lsp, except that, on a miss, it also stores the semantic tokens computed with semantic_tokens (unless the document is a copybook). The Boolean indicates a hit; semantic tokens are not looked up, so a hit does not entail they are held.
semantic_tokens computes the semantic tokens of the document filename from its parsing artifacts and typechecking outputs. The LSP provides it; front-ends that fill the cache for the LSP should pass the very same function, as it takes no part in cache keys.