MCPcopy
hub / github.com/redwoodjs/graphql / HostWithDocumentsStore

Class HostWithDocumentsStore

packages/structure/src/ide.ts:278–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278export class HostWithDocumentsStore implements Host {
279 defaultHost = new DefaultHost()
280 constructor(public documents: TextDocuments<TextDocument>) {}
281 readFileSync(path: string) {
282 const uri = URL_file(path)
283 const doc = this.documents.get(uri)
284 if (doc) {
285 return doc.getText()
286 }
287 return this.defaultHost.readFileSync(path)
288 }
289 existsSync(path: string) {
290 return this.defaultHost.existsSync(path)
291 }
292 readdirSync(path: string) {
293 return this.defaultHost.readdirSync(path)
294 }
295 globSync(pattern: string) {
296 return this.defaultHost.globSync(pattern)
297 }
298 writeFileSync(path: string, contents: string) {
299 return this.defaultHost.writeFileSync(path, contents)
300 }
301 get paths() {
302 return this.defaultHost.paths
303 }
304}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected