Re-add ohthetreesyoullgrow partner

This commit is contained in:
Misode
2024-10-31 06:41:30 +01:00
parent cf44c3236f
commit 68eb077c17
10 changed files with 104 additions and 106 deletions

View File

@@ -57,6 +57,14 @@ export async function fetchVanillaMcdoc() {
}
}
export async function fetchDependencyMcdoc(dependency: string) {
try {
return cachedFetch(`/mcdoc/${dependency}.mcdoc`, { decode: res => res.text(), refresh: true })
} catch (e) {
throw new Error(`Error occured while fetching ${dependency} mcdoc: ${message(e)}`)
}
}
export async function fetchRegistries(versionId: VersionId) {
console.debug(`[fetchRegistries] ${versionId}`)
const version = config.versions.find(v => v.id === versionId)!

View File

@@ -86,8 +86,10 @@ export class SpyglassService {
public async getFile(uri: string, emptyContent?: () => string) {
let docAndNode = this.service.project.getClientManaged(uri)
if (docAndNode === undefined) {
const lang = core.fileUtil.extname(uri)?.slice(1) ?? 'txt'
const content = await this.readFile(uri)
const doc = TextDocument.create(uri, 'json', 1, content ?? (emptyContent ? emptyContent() : ''))
this.service.project['bindUri'](uri)
const doc = TextDocument.create(uri, lang, 1, content ?? (emptyContent ? emptyContent() : ''))
await this.service.project.onDidOpen(doc.uri, doc.languageId, doc.version, doc.getText())
docAndNode = await this.service.project.ensureClientManagedChecked(uri)
}
@@ -234,6 +236,10 @@ export class SpyglassService {
models: {
category: 'model',
},
// Partner resources
'ohthetreesyoullgrow/configured_feature': {
category: 'ohthetreesyoullgrow:configured_feature',
},
},
},
lint: {