Enter-tainer / typst-preview

[DEPRECATED] Use tinymist instead
https://Enter-tainer.github.io/typst-preview/
MIT License
452 stars 21 forks source link

Feature request: enable the extension on typ language mode #287

Closed adamanteye closed 2 months ago

adamanteye commented 2 months ago

I am not sure whether this has already been done or I am doing the wrong way. Apologies in advance.

I was searching for how to enable the typst-preview extension if and only if on typ language mode, like enable a VS Code extension only for certain file types. As the extension seems to enable itself gloably in every VS code workspace. And I seemed to find no clue. All I know is that probably the developer can decide when to start typst-preview.

And again thanks for your impressive work!

Enter-tainer commented 2 months ago

As the extension seems to enable itself gloably in every VS code workspace

how to check if an extension is enabled or not?

Enter-tainer commented 2 months ago

https://code.visualstudio.com/api/references/activation-events

this looks useful. i will add it

adamanteye commented 2 months ago

As the extension seems to enable itself gloably in every VS code workspace

how to check if an extension is enabled or not?

I find the icon "T" shows in the Activity Bar :)

Enter-tainer commented 2 months ago

As the extension seems to enable itself gloably in every VS code workspace

how to check if an extension is enabled or not?

I find the icon "T" shows in the Activity Bar :)

that's interesting. it doesnt appear for me. iirc it should only appear after you actually preview a typst file.

adamanteye commented 2 months ago

Perhaps it's because I have enabled typst-preview.showInActivityBar. My guess is if it activates on an actual typst file, then enabling typst-preview.showInActivityBar still won't make it appear constantly.

Enter-tainer commented 2 months ago

sorry i misread. i reproduced what you described

Myriad-Dreamin commented 2 months ago

https://code.visualstudio.com/api/references/activation-events

this looks useful. i will add it

this is already deprecated. VSCode will activate the extension on generated hooks to events since about 1.71

Enter-tainer commented 2 months ago

you are correct. the root cause is the when clause of activity bar view doesnt take editor language id into account