Skip to content

Commit

Permalink
#4184 kpsewhich.enabled should control calls to kpsewhich
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Yu committed Mar 2, 2024
1 parent 6c63cc3 commit 453ec43
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/completion/completer/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,11 @@ function toPackageObj(packageName: string, options: string[], node?: Ast.Node):
}
let pkgObj: {[pkgName: string]: string[]} = {}
if (node?.type === 'macro' && node.content === 'documentclass') {
const clsPath = lw.file.kpsewhich([`${packageName}.cls`])
if (vscode.workspace.getConfiguration('latex-workshop').get('kpsewhich.enabled') as boolean &&
clsPath && fs.existsSync(clsPath)) {
pkgObj = parseContent(fs.readFileSync(clsPath).toString())
if (vscode.workspace.getConfiguration('latex-workshop').get('kpsewhich.enabled') as boolean) {

This comment has been minimized.

Copy link
@jlelong

jlelong Mar 6, 2024

Collaborator

The description of kpsewhich.enabled does not correspond to this usage

"markdownDescription": "Use kpsewhich as defined by `#latex-workshop.kpsewhich.path#` to resolve bibliography files in addition to looking into the directories listed in `#latex-workshop.latex.bibDirs#`."

Either we update the documentation or we use a new configuration

This comment has been minimized.

Copy link
@James-Yu

James-Yu Mar 6, 2024

Author Owner

Yes, will update the description to be more inclusive.

const clsPath = lw.file.kpsewhich([`${packageName}.cls`])
if (clsPath && fs.existsSync(clsPath)) {
pkgObj = parseContent(fs.readFileSync(clsPath).toString())
}
}
packageName = 'class-' + packageName
}
Expand Down

0 comments on commit 453ec43

Please sign in to comment.