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

Method attach

src/cm/lsp/clientManager.ts:960–975  ·  view source on GitHub ↗
(
      uri: string,
      view: EditorView,
      aliases: string[] = [],
    )

Source from the content-addressed store, hash-verified

958 const effectiveRoot = normalizedRootUri ?? originalRootUri ?? null;
959
960 const attach = (
961 uri: string,
962 view: EditorView,
963 aliases: string[] = [],
964 ): void => {
965 const existing = fileRefs.get(uri) ?? new Set();
966 existing.add(view);
967 fileRefs.set(uri, existing);
968 uriAliases.set(uri, uri);
969 for (const alias of aliases) {
970 if (!alias || alias === uri) continue;
971 uriAliases.set(alias, uri);
972 }
973 const suffix = effectiveRoot ? ` (root ${effectiveRoot})` : "";
974 logLspInfo(`[LSP:${server.id}] attached to ${uri}${suffix}`);
975 };
976
977 const detach = (uri: string, view?: EditorView): void => {
978 const actualUri = uriAliases.get(uri) ?? uri;

Callers 2

getExtensionsForFileMethod · 0.80
formatDocumentMethod · 0.80

Calls 4

logLspInfoFunction · 0.85
addMethod · 0.80
setMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected