MCPcopy Index your code
hub / github.com/anomalyco/opencode / isModuleOf

Function isModuleOf

packages/opencode/src/lsp/server.ts:1133–1145  ·  view source on GitHub ↗
(pomContent: string, modulePath: string)

Source from the content-addressed store, hash-verified

1131}
1132
1133function isModuleOf(pomContent: string, modulePath: string): boolean {
1134 const normalized = modulePath.replace(/\\/g, "/").replace(/\/$/, "")
1135 if (!normalized) return false
1136 const modulesBlocks = pomContent.match(/<modules>([\s\S]*?)<\/modules>/g) ?? []
1137 for (const block of modulesBlocks) {
1138 const stripped = block.replace(/<!--[\s\S]*?-->/g, "")
1139 for (const m of stripped.matchAll(/<module>\s*([^<]+?)\s*<\/module>/g)) {
1140 const decl = m[1].replace(/\\/g, "/").replace(/^\.\//, "").replace(/\/$/, "")
1141 if (decl === normalized) return true
1142 }
1143 }
1144 return false
1145}
1146
1147export const JDTLS: Info = {
1148 id: "jdtls",

Callers 1

server.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected