Use `mtime` to cache Jsonnet files
Use `mtime` to cache Jsonnet files

There are two important means by which the Jsonnet language server is
allowed to interact with Jsonnet source files:

  1. Using the vscode DocumentManager. the DocumentManager is
     responsible for maintaining a "virtual" filesystem that is backed
     up periodically on disk, so that if the user exits or the editor
     crashes, their unsaved documents appear as they were when the
     editor process exited.

     Any time a user opens a file, it is tracked in the vscode
     DocumentManager. If the user closes the window, but the contents
     are saved, then the document is evicted from the DocumentManager.
     If the user closes the window, and the document is not saved, it
     remains in the DocumentManager.
  2. Using the filesystem. Many documents (such as library files, or
     documents that have not been opened in the editor) are not in the
     DocumentManager, and we have no choice but to read them. The
     language server is therefore responsible for caching them.

Currently, we employ the world's worst strategy for caching library
files for analysis: by checking `atime`, the document access time. On
top of being way too conservative (we'd like for the document to be read
from disk only if it's been _modified_), it's also a no-op on many OSs.

This commit will introduce a caching scheme based instead on `mtime`,
the document modification time.

Signed-off-by: Alex Clemmer <2e6147cbff6661bd424c256de746b4f230002dff@gmail.com>

heptio/vscode-jsonnet,heptio/vscode-jsonnet