MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / fromPosition

Function fromPosition

src/cm/lsp/tooltipExtensions.ts:253–259  ·  view source on GitHub ↗
(
	doc: EditorView["state"]["doc"],
	position: { line: number; character: number },
)

Source from the content-addressed store, hash-verified

251}
252
253function fromPosition(
254 doc: EditorView["state"]["doc"],
255 position: { line: number; character: number },
256): number {
257 const line = doc.line(position.line + 1);
258 return Math.min(line.to, line.from + position.character);
259}
260
261function escapeHtml(value: string): string {
262 return value.replace(/[&<>"']/g, (match) => {

Callers 1

lspTooltipSourceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected