derekwyatt / vim-scala

My work on integration of Scala into Vim - not a ton here, but useful for me.
http://derekwyatt.org
Apache License 2.0
1.09k stars 144 forks source link

Detect scala script by name #102

Closed valir closed 8 years ago

valir commented 9 years ago

Scala script names end in .scalas This patch enables vim-scala to correctly detect them as Scala programs

ches commented 9 years ago

Scala script names end in .scalas

To be honest I have never heard of or seen this convention. I would even go so far as to call it an antipattern to name executable scripts after an implementation language when that's kind of what the executable bit and shebangs are designed to abstract.

Can you cite any examples or documents in the wild that motivate this? I've seen the scalas SBT script runner, but that's kind of different—it's a single runner program that can be installed, called scalas, that you're meant to reference in shebangs for scripts that do not need to be named .scalas themselves.

valir commented 9 years ago

We use scala scripts (not SBT scalas scripts) at our company. We use .scalas to distinguish them from .scala in IntelliJ Idea. They contain actual Scala code, and using another extension helps when using IntelliJ to develop them.

One example in the wild would be this : http://w3facility.org/question/ignoring-scala-scripts-when-using-sbt-compile-server-in-intellij-idea/

ches commented 9 years ago

I'll defer to @derekwyatt's opinion or if any other users speak up in strong support, but I'd personally rather not maintain some weird hacks in a Vim plugin to work around IntelliJ being dumb, especially if .scalas is one company's chosen workaround and not a common practice with reasoning beyond "to work around IntelliJ being dumb" (I'd have to wonder why you don't just omit a file extension completely?). It shouldn't be too onerous to maintain this one-liner in your own vimrc if this is a practice particular to your company.