type fileMap … func newFileMap() *fileMap { … } // clone creates a copy of the fileMap, incorporating the changes specified by // the changes map. func (m *fileMap) clone(changes map[protocol.DocumentURI]file.Handle) *fileMap { … } func (m *fileMap) destroy() { … } // get returns the file handle mapped by the given key, or (nil, false) if the // key is not present. func (m *fileMap) get(key protocol.DocumentURI) (file.Handle, bool) { … } // foreach calls f for each (uri, fh) in the map. func (m *fileMap) foreach(f func(uri protocol.DocumentURI, fh file.Handle)) { … } // set stores the given file handle for key, updating overlays and directories // accordingly. func (m *fileMap) set(key protocol.DocumentURI, fh file.Handle) { … } // addDirs adds all directories containing u to the dirs set. func (m *fileMap) addDirs(u protocol.DocumentURI) { … } // delete removes a file from the map, and updates overlays and dirs // accordingly. func (m *fileMap) delete(key protocol.DocumentURI) { … } // getOverlays returns a new unordered array of overlay files. func (m *fileMap) getOverlays() []*overlay { … } // getDirs reports returns the set of dirs observed by the fileMap. // // This operation mutates the fileMap. // The result must not be mutated by the caller. func (m *fileMap) getDirs() *persistent.Set[string] { … }