-2

I'm trying to standardize some of my bin scripts and i'm going without extensions. However this is proving difficult to see programming language of all my scripts. Some of these are bash, some of these are typescript and some of these are javascript.

The only advice i've heard is to separate source code which has extensions from the "build" which would strip them. I'm not interested in this added build step.

enter image description here

Are there any solutions in vscode that would help show the language?

I have to currently click each file for it to recognize the shebangs. I'd love to just load these icons when the project loads.

enter image description here

1

1 Answer 1

0

Since your files have shebangs, I think this is technically possible if the extensions contributing language-support for the languages your extensionless files are written in make use of the firstLine member in the language description in their extension manifest (see docs). Check the extension manifests of the extensions providing support for the languages your scripts are in, and if they use that feature. If they don't, you could raise issue tickets / pull requests to suggest the maintainers to use it.

Unfortunately, I don't think many extensions make use of that feature. What you might be seeing (I'm just guessing) with the language mode suddenly being recognized / detected once you open the file is the ML-based automatic language detection, which (if I'm right) is presumably intentional for startup performance reasons / as a lazy loading thing.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.