Skip to main content



      Home
Home » Newcomers » Newcomers » shebang line for script recognition
shebang line for script recognition [message #1289825] Wed, 09 April 2014 13:26 Go to next message
Eclipse UserFriend
I would like to be able to open a script file in an editor and have Eclipse use the shebang line for file type recognition. Nothing that I've found indicates that this is possible (or that a plugin exists to make it possible Smile

The PyDev plugin documentation SAYS that they do this . . . but it doesn't work, and I haven't seen it documented for any of our other plugins.

Just for info, we are using Windriver Workbench, and therefore Eclipse 3.8.1 plus Eclipse CDT and PyDev
Re: shebang line for script recognition [message #1293194 is a reply to message #1289825] Sat, 12 April 2014 07:50 Go to previous messageGo to next message
Eclipse UserFriend
On 04/09/2014 11:33 AM, Dan Rawson wrote:
> I would like to be able to open a script file in an editor and have
> Eclipse use the shebang line for file type recognition. Nothing that
> I've found indicates that this is possible (or that a plugin exists to
> make it possible :)
>
> The PyDev plugin documentation SAYS that they do this . . . but it
> doesn't work, and I haven't seen it documented for any of our other
> plugins.
>
> Just for info, we are using Windriver Workbench, and therefore Eclipse
> 3.8.1 plus Eclipse CDT and PyDev

You need to understand that Eclipse's behavior is completely influenced
by the plug-in or set of plug-ins you use. Many plug-ins are not written
by Eclipse.

Have you examined file-type association with editor in Eclipse? This
doesn't not satisfy your shebang requirement, only a plug-in could do
that, but it may be a partial answer.

Last, for birds of a feather, please consider the Eclipse CDT forum and
also whatever forum/mailing list supports PyDev.

Cheers.
Re: shebang line for script recognition [message #1293195 is a reply to message #1293194] Sat, 12 April 2014 07:53 Go to previous messageGo to next message
Eclipse UserFriend
On 04/12/2014 05:50 AM, Russell Bateman wrote:
> On 04/09/2014 11:33 AM, Dan Rawson wrote:
>> I would like to be able to open a script file in an editor and have
>> Eclipse use the shebang line for file type recognition. Nothing that
>> I've found indicates that this is possible (or that a plugin exists to
>> make it possible :)
>>
>> The PyDev plugin documentation SAYS that they do this . . . but it
>> doesn't work, and I haven't seen it documented for any of our other
>> plugins.
>>
>> Just for info, we are using Windriver Workbench, and therefore Eclipse
>> 3.8.1 plus Eclipse CDT and PyDev
>
> You need to understand that Eclipse's behavior is completely influenced
> by the plug-in or set of plug-ins you use. Many plug-ins are not written
> by Eclipse.
>
> Have you examined file-type association with editor in Eclipse? This
> doesn't not satisfy your shebang requirement, only a plug-in could do
> that, but it may be a partial answer.
>
> Last, for birds of a feather, please consider the Eclipse CDT forum and
> also whatever forum/mailing list supports PyDev.
>
> Cheers.

Sorry, here is what I was talking about:

Window -> Preferences -> General -> Editors -> File Associations
Re: shebang line for script recognition [message #1295617 is a reply to message #1293195] Mon, 14 April 2014 08:20 Go to previous messageGo to next message
Eclipse UserFriend
The issue is that this the File Associations settings don't WORK for files without extensions! So for many scripts, the shebang line is the only source for determining file type.
Re: shebang line for script recognition [message #1297715 is a reply to message #1295617] Tue, 15 April 2014 17:45 Go to previous messageGo to next message
Eclipse UserFriend
You should contact the PyDev authors/community for help on this feature, then.
Re: shebang line for script recognition [message #1297743 is a reply to message #1297715] Tue, 15 April 2014 18:07 Go to previous messageGo to next message
Eclipse UserFriend
I guess I still haven't been clear; the PyDev plugin was only an example. My point is that if I choose File -> Open on a file with NO extension (certainly common in scripting), then the Eclipse environment should use the shebang line to figure out the file type and the potentially pick the "correct" editor.

My experience has been that this doesn't work at all, and I haven't found anything that implements this behaviour, but maybe I just missed it.

It's certainly common in other editors and IDE's

Dan
Re: shebang line for script recognition [message #1298894 is a reply to message #1297743] Wed, 16 April 2014 11:34 Go to previous messageGo to next message
Eclipse UserFriend
As Russell explained, only a plug-in can do that--and usually only for the content type it supports. I was under the impression, from you, that PyDev was one of them.
Re: shebang line for script recognition [message #1299145 is a reply to message #1298894] Wed, 16 April 2014 15:21 Go to previous messageGo to next message
Eclipse UserFriend
It's a very tricky problem because of how Eclipse identifies files at it's lowest levels. I use ShellEd to edit script files, and here is an open feature request they've had for a long time: http://sourceforge.net/apps/trac/shelled/ticket/4
Re: shebang line for script recognition [message #1300177 is a reply to message #1299145] Thu, 17 April 2014 07:39 Go to previous message
Eclipse UserFriend
"It's very tricky because of how Eclipse identifies files at it's lowest level....."

That's the scary part Smile Is this different from the way it's done by the Unix "file" utility with a stat() call + the magic files?
Previous Topic:Email form Eclipse
Next Topic:Error on starting Eclipse
Goto Forum:
  


Current Time: Fri May 09 00:06:39 EDT 2025

Powered by FUDForum. Page generated in 0.08377 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top