atom-archive / xray

An experimental next-generation Electron-based text editor
MIT License
8.48k stars 235 forks source link

Memo: include `path` in Entry #146

Closed joshaber closed 5 years ago

joshaber commented 5 years ago

The current API leaves it up to clients to reconstruct the full path for entries, either using WorkTree.pathForFileId or by doing its own bookkeeping. This is ok but in an ideal world we'd push that bookkeeping down into Memo instead of rely on clients to do it themselves.

Assuming there is some cost overhead such that Memo wouldn't want to always provide the path, one possibility would be to make it another option clients can pass to WorkTree.entries:

tree.entries({includeFullPath: true})