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

Method #resolveDocumentUri

src/cm/lsp/clientManager.ts:1140–1165  ·  view source on GitHub ↗
(
    server: LspServerDefinition,
    context: RootUriContext,
  )

Source from the content-addressed store, hash-verified

1138 }
1139
1140 async #resolveDocumentUri(
1141 server: LspServerDefinition,
1142 context: RootUriContext,
1143 ): Promise<string | null> {
1144 const originalUri = context?.uri;
1145 if (!originalUri) return null;
1146
1147 const normalizedUri = normalizeDocumentUri(originalUri);
1148
1149 if (typeof server.documentUri === "function") {
1150 try {
1151 const value = await server.documentUri(originalUri, {
1152 ...context,
1153 normalizedUri,
1154 } as DocumentUriContext);
1155 if (value) return safeString(value);
1156 } catch (error) {
1157 console.warn(
1158 `Server document URI resolver failed for ${server.id}`,
1159 error,
1160 );
1161 }
1162 }
1163
1164 return normalizedUri;
1165 }
1166}
1167
1168function createTransportFromRuntimeConnection(

Callers 1

#resolveRuntimeTargetMethod · 0.95

Calls 2

normalizeDocumentUriFunction · 0.85
safeStringFunction · 0.85

Tested by

no test coverage detected