code: def update_resource(self, resource, underlined=None):
          
          try:
              pymodule = self.project.get_pymodule(resource)
              modname = self._module_name(resource)
              self._add_names(pymodule, modname, underlined)
          except exceptions.ModuleSyntaxError:
              pass
docs: Update the cache for global names in `resource`