James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.74k stars 535 forks source link

Handle LaTeX files with non `.tex` extension #4466

Open jlelong opened 1 day ago

jlelong commented 1 day ago

Related to #4457

This PR adds a new configuration variable to let the user specify file extensions to be treated as LaTeX files similarly to .tex files.

@James-Yu What do you think of this very little intrusive approach?

James-Yu commented 1 day ago

I’m good with the change, just one thing: it seems that changing the config cannot change the respective behavior on-the-fly, until a vscode reload. May be we move the new ext var to file.ts, and register an onConfigChange handler to change it lively?

jlelong commented 1 day ago

It is not completely clear to me because allowing to change the value on-the-fly will only work for adding more extensions. Files with extensions that were cached will not be removed from the caching mechanism. So I am a bit hesitating.

James-Yu commented 1 day ago

That's mostly for consistency. iirc changes on all other configs are now reflected immediately without the need of reload. Further, I ignored the impact on caches when changing the config. It might be more complex than I thought.

jlelong commented 1 day ago

Fine. I completely agree with the consistency argument. I will make the appropriate changes.