function toProjectPath_(projectRoot: FilePath, p: FilePath): ProjectPath {
  if (p == null) {
    return p;
  }

  // If the file is outside the project root, store an absolute path rather
  // than a relative one. This way if the project root is moved, the file
  // references still work. Accessing files outside the project root is not
  // portable anyway.
  let relative = relativePath(projectRoot, p, false);
  if (relative.startsWith('..')) {
    return process.platform === 'win32' ? normalizeSeparators(p) : p;
  }

  return relative;
}
A path that's relative to the project root.