Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » shebang line for script recognition
shebang line for script recognition [message #1289825] Wed, 09 April 2014 17:26 Go to next message
Dan Rawson is currently offline Dan RawsonFriend
Messages: 4
Registered: April 2014
Junior Member
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 11:50 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

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 11:53 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

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 12:20 Go to previous messageGo to next message
Dan Rawson is currently offline Dan RawsonFriend
Messages: 4
Registered: April 2014
Junior Member
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 21:45 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4434
Registered: July 2009
Senior Member

You should contact the PyDev authors/community for help on this feature, then.

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: shebang line for script recognition [message #1297743 is a reply to message #1297715] Tue, 15 April 2014 22:07 Go to previous messageGo to next message
Dan Rawson is currently offline Dan RawsonFriend
Messages: 4
Registered: April 2014
Junior Member
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 15:34 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4434
Registered: July 2009
Senior Member

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.

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: shebang line for script recognition [message #1299145 is a reply to message #1298894] Wed, 16 April 2014 19:21 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
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 11:39 Go to previous message
Dan Rawson is currently offline Dan RawsonFriend
Messages: 4
Registered: April 2014
Junior Member
"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 Apr 19 18:57:04 GMT 2024

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

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

Back to the top