message: Fix finding root file when using nested subimport
  This closes
diff: @@ -68,6 +68,23 @@ export class Manager {
  return text.replace(reg, '$1')
  }
  + // Given an input file determine its full path using the prefixes dirs
  + resolveFile(dirs: string[], inputFile: string) : string | null {
  + for (const d of dirs) {
  + let inputFilePath = path.resolve(path.join(d, inputFile))
  + if (path.extname(inputFilePath) === '') {
  + inputFilePath += '.tex'
  + }
  + if (!fs.existsSync(inputFilePath) && fs.existsSync(inputFilePath + '.tex')) {
  + inputFilePath += '.tex'
  + }
  + if (fs.existsSync(inputFilePath)) {
  + return inputFilePath
  + }
  + }
  + return null
  + }
  +
  updateWorkspace() {
  let wsroot = vscode.workspace.rootPath
  const activeTextEditor = vscode.window.activeTextEditor
  @@ -267,7 +284,7 @@ export class Manager {
  this.extension.logger.addLogMessage(`Parsing ${filePath}`)
  const content = this.stripComments(fs.readFileSync(filePath, 'utf-8'), '%')
  - const inputReg = /(?:\\(?:input|include|subfile|(?:subimport{([^}]*)}))(?:\[[^\[\]\{\}]*\])?){([^}]*)}/g
  + const inputReg = /(?:\\(?:input|include|subfile|(?:subimport\*?{([^}]*)}))(?:\[[^\[\]\{\}]*\])?){([^}]*)}/g
  this.texFileTree[filePath] = new Set()
  while (true) {
  const result = inputReg.exec(content)
  @@ -277,17 +294,11 @@ export class Manager {
  let inputFilePath
  if (result[0].startsWith('\\subimport')) {
  - inputFilePath = path.resolve(path.join(path.dirname(filePath), result[1], result[2]))
  + inputFilePath = this.resolveFile([path.dirname(filePath)], path.join(result[1], result[2]))
  } else {
  - inputFilePath = path.resolve(path.join(rootDir, result[2]))
  + inputFilePath = this.resolveFile([path.dirname(filePath), rootDir], result[2])
  }
  - if (path.extname(inputFilePath) === '') {
  - inputFilePath += '.tex'
  - }
  - if (!fs.existsSync(inputFilePath) && fs.existsSync(inputFilePath + '.tex')) {
  - inputFilePath += '.tex'
  - }
  if (fs.existsSync(inputFilePath)) {
  this.texFileTree[filePath].add(inputFilePath)
  if (!fast && this.fileWatcher && this.watched.indexOf(inputFilePath) < 0) {
  