updateResource method

void updateResource(
  1. String fullName,
  2. RT resource
)

Implementation

void updateResource(String fullName, RT resource) {
  if (_cachedSources.containsKey(fullName)) {
    _cachedSources[fullName] = resource;
  } else if (isSearchEnabled) {
    for (final root in _contextRoots.keys) {
      if (path.isWithin(root, fullName)) {
        final context = _contextRoots[root]!;
        final normalized = context.getAbsolutePath(key: fullName);
        context.updateResource(normalized, resource);
        break;
      }
    }
  }
}