Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New file extensions
#7
(07-31-2017, 03:57 PM)krzys_h Wrote: If your main goal is to detect file type automatically, why not just an optional header at the top, like what shell scripts on Linux usually use?

Shell scripts still have a file extension and it's not like there are different highlighters for different shells, are there? The first line is for the shell to recognize which program to use when running them like ./script.txt, not for editors.

No, it's impossible in almost every editor to implement "first line detection" simply because in most editors file extension is worth more points than first line (or there isn't even such a setting at all). Once it's .txt, the language's set to "Plain text", it doesn't even look at the first line at this point. In fact, the only editor in which the first line detection works somehow is in Sublime Text IIRC. The related issues in VS Code and Atom are still open and I doubt they will be closed soon simply because it's hard to find an implementation of language detection that would cover all edge cases and this one is probably the rarest one.

(07-31-2017, 03:57 PM)krzys_h Wrote: keeps opening them easy

If by "opening them easy" you mean that every time I open a .txt file I have to set the correct syntax by hand which is annoying, slowing down and distracting, then yeah.

(07-31-2017, 03:57 PM)krzys_h Wrote: Would anyone be interested in finished external CBot interpreter?

If that'd be useful in implementing some error detection, intellisense etc. in extensions, then I'd be interested in that.


Everyone seems to have a different opinion about the subject, I'm afraid we won't reach an agreement any time soon :/
[Image: XvN5CTW.png] [Image: UYXyyMS.png]


Messages In This Thread
New file extensions - by Simbax - 07-31-2017, 11:58 AM
RE: New file extensions - by tomangelo - 07-31-2017, 12:18 PM
RE: New file extensions - by RaptorParkowsky - 07-31-2017, 12:34 PM
RE: New file extensions - by tomangelo - 07-31-2017, 12:48 PM
RE: New file extensions - by krzys_h - 07-31-2017, 03:57 PM
RE: New file extensions - by radioactivity - 07-31-2017, 04:30 PM
RE: New file extensions - by Simbax - 07-31-2017, 05:20 PM
RE: New file extensions - by krzys_h - 07-31-2017, 09:31 PM
RE: New file extensions - by Simbax - 08-01-2017, 07:38 AM
RE: New file extensions - by tomaszkax86 - 08-01-2017, 01:33 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)