public void updateFile(String fileURI, String content, Integer version) {
        logger.info("Updating file: " + fileURI);
        Optional<DocumentType> documentType = getDocumentTypeFromURI(fileURI);
        if (documentType.isEmpty()) return;

        if (!workspaceFiles.containsKey(fileURI)) {
            switch(documentType.get()) {
                case PROFILE:
                    workspaceFiles.put(fileURI, new RankProfileDocument(logger, diagnosticsHandler, schemaIndex, this, fileURI));
                    break;
                case SCHEMA:
                    workspaceFiles.put(fileURI, new SchemaDocument(logger, diagnosticsHandler, schemaIndex, this, fileURI));
                    break;
                case YQL:
                    workspaceFiles.put(fileURI, new YQLDocument(logger, diagnosticsHandler, schemaIndex, this, fileURI));
                    break;
            }
        }

        // TODO: a lot of parsing going on. It mostly should be reference resolving, not necessarily reparsing of entire contents.
        workspaceFiles.get(fileURI).updateFileContent(content, version);

        if (reparseDescendants) {
            Set<String> parsedURIs = new HashSet<>() {{ add(fileURI); }};
            if (documentType.get() == DocumentType.SCHEMA) {

                reparseSchemaFileDescendants(fileURI, parsedURIs);

            } else if (documentType.get() == DocumentType.PROFILE) {
                // Find the schema this rank profile belongs to and reparse from there
                RankProfileDocument document = getRankProfileDocument(fileURI);
                Optional<Symbol> schemaSymbol = document.schemaSymbol();

                if (schemaSymbol.isPresent()) {
                    reparseSchemaFileDescendants(schemaSymbol.get().getFileURI(), parsedURIs);
                }
            }
        }

        // Resolve remaining unresolved symbols after everything has parsed
        Map<String, List<Diagnostic>> undefinedSymbolDiagnostics = new HashMap<>();
        while (true) {
            boolean didResolve = false;
            for (var symbol : schemaIndex.getUnresolvedSymbols()) {
                String symbolURI = symbol.getFileURI();

                DocumentManager symbolDocument = getDocument(symbolURI);
                if (symbolDocument == null) continue; // bad situation

                if (!undefinedSymbolDiagnostics.containsKey(symbolURI))undefinedSymbolDiagnostics.put(symbolURI, new ArrayList<>());

                ParseContext context = symbolDocument.getParseContext();
                if (symbol.getNode() instanceof SchemaNode) {
                    List<Diagnostic> diagnostics = new ArrayList<>();
                    SymbolReferenceResolver.resolveSymbolReference(symbol.getNode().getSchemaNode(), context, diagnostics);
                    if (diagnostics.isEmpty()) {
                        didResolve = true;
                        break;
                    }
                }
            }
            if (!didResolve) break;
        }


        for (var symbol : schemaIndex.getUnresolvedSymbols()) {
            undefinedSymbolDiagnostics.get(symbol.getFileURI()).add(
            new SchemaDiagnostic.Builder()
                    .setRange( symbol.getNode().getRange())
                    .setMessage( "Undefined symbol " + symbol.getNode().getText())
                    .setSeverity(DiagnosticSeverity.Error)
                    .setCode(DiagnosticCode.UNDEFINED_SYMBOL)
                    .build()
            );
        }

        for (var entry : undefinedSymbolDiagnostics.entrySet()) {
            diagnosticsHandler.replaceUndefinedSymbolDiagnostics(entry.getKey(), entry.getValue());
        }
    }
Class responsible for maintaining the set of open documents and reparsing them.
When {@link SchemaDocumentScheduler#updateFile} is called, it will call {@link DocumentManager#updateFileContent} on the appropriate file 
and also other files that may have dependencies on the contents of the file.
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/schemadocument/SchemaDocumentScheduler.java