@@ -12,13 +12,11 @@ import { TextDocument } from 'vscode-languageserver-textdocument'
1212import type { ConfigGenerator } from '../Config.js'
1313import siteConfig from '../Config.js'
1414import { computeIfAbsent , genPath } from '../Utils.js'
15- import type { VersionMeta } from './DataFetcher.js'
16- import { fetchBlockStates , fetchRegistries , fetchVersions , fetchWithCache , getVersionChecksum } from './DataFetcher.js'
15+ import type { VanillaMcdocSymbols , VersionMeta } from './DataFetcher.js'
16+ import { fetchBlockStates , fetchRegistries , fetchVanillaMcdoc , fetchVersions , getVersionChecksum } from './DataFetcher.js'
1717import { IndexedDbFileSystem } from './FileSystem.js'
1818import type { VersionId } from './Versions.js'
1919
20- const SPYGLASS_API = 'https://api.spyglassmc.com'
21-
2220export const CACHE_URI = 'file:///cache/'
2321export const ROOT_URI = 'file:///root/'
2422export const DEPENDENCY_URI = `${ ROOT_URI } dependency/`
@@ -369,10 +367,10 @@ async function compressBall(files: [string, string][]): Promise<Uint8Array> {
369367const initialize : core . ProjectInitializer = async ( ctx ) => {
370368 const { config, logger, meta, externals, cacheRoot } = ctx
371369
372- const vanillaMcdocRes = await fetchWithCache ( ` ${ SPYGLASS_API } /vanilla-mcdoc/symbols` )
370+ const vanillaMcdoc = await fetchVanillaMcdoc ( )
373371 meta . registerSymbolRegistrar ( 'vanilla-mcdoc' , {
374- checksum : vanillaMcdocRes . headers . get ( 'ETag' ) ?? '' ,
375- registrar : vanillaMcdocRegistrar ( await vanillaMcdocRes . json ( ) ) ,
372+ checksum : vanillaMcdoc . ref ,
373+ registrar : vanillaMcdocRegistrar ( vanillaMcdoc ) ,
376374 } )
377375
378376 meta . registerDependencyProvider ( '@misode-mcdoc' , async ( ) => {
@@ -481,10 +479,6 @@ function registerAttributes(meta: core.MetaRegistry, release: ReleaseVersion, ve
481479
482480const VanillaMcdocUri = 'mcdoc://vanilla-mcdoc/symbols.json'
483481
484- interface VanillaMcdocSymbols {
485- mcdoc : Record < string , unknown > ,
486- 'mcdoc/dispatcher' : Record < string , Record < string , unknown > > ,
487- }
488482function vanillaMcdocRegistrar ( vanillaMcdoc : VanillaMcdocSymbols ) : core . SymbolRegistrar {
489483 return ( symbols ) => {
490484 const start = performance . now ( )
0 commit comments