Spurious File Recognition by BashSupport

Hi,

I notice that BashSupport claims a lot of files that are not really BASH scripts.

Perhaps you could add an option that makes it require a shebang line with some known list of compatible shells (".../sh" or ".../bash", e.g.). I know this is not ideal, since I myself have many non-executable shell scripts used as fragments "source"-ed by other scripts that do not have she-bang lines. Another criterion might be executability (but that, too, excludes my fragment files).

Naturally, I could turn off "Accept files without extensions", but I never give any of my BASH scripts extensions, so that would defeat BashSupport entirely for me.


Randall Schulz

评论操作 固定链接

Hi,
the last time I had a look at the plugin API it was like "here's the filename, check if you like it, you don't get the content, though". I'll have a look at it again so see if I can find a workaround.

Wallaby

0
评论操作 固定链接

Ok, I found  a possible workaround / hack to make this work.
To enable the included script files which are not executable or begin with sh/bash, which option is the best for you:
     a) Is a module or project facet ok where you can control a list of directories which contain include files?
     b) Maybe a list of filename wildcards?
     c) Maybe a file-level intention for files without extension to mark the file as non-Bash?
     d) ... ?

Regards,
Wallaby

0
评论操作 固定链接

Hi, w.p,

a) This could work. With this approach, it might be good to include an option for immediate directory contents vs. files in arbitrarily nested subdirectories.
b) Not useful, since there's no name pattern I use. I treat shell scripts as commands indistinguishable from any other, in true Unix tradition.
c) I'm not sure how that would work; could you elaborate?


Randall Schulz

0
评论操作 固定链接

Hello wallaby.pouch,

Please take a look at the LanguageSubstitutor API. It lets you determine
the language of a file while having access to its contents.

the last time I had a look at the plugin API it was like "here's the
filename, check if you like it, you don't get the content, though".
I'll have a look at it again so see if I can find a workaround.
Wallaby

---
Original message URL:
http://www.jetbrains.net/devnet/message/5255118#5255118

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
评论操作 固定链接

Hi Dmitry,
I tried that.

The class LanguageSubstitutors retrieves the configued Substitutors by language. So appearantly I can only reassign a language to a file with a language assigned.
If I'm not mistaken I can not associate a language substitutor with a file without extension.

I need to assign a language to a file without extension.
I found FileTypeIdentifiableByVirtualFile but this does not give my the current project. Without the project I can't read the module / facet settings I need.

I'd appreaciate a hint how to proceed,
Wallaby

0
评论操作 固定链接

I've found a acceptable solution by guessing the project the file is in. This seems to work.

Regards,
Wallaby

0
评论操作 固定链接

Hi,

a) it is now. You can configure a module with a new Bashsupport facet. You can choose between Accept / Ignore / Auto for folders and files. This is similair to the file encoding settings. Auto checks the shebang line.

This is going to be in the next version, which is going to be released soon.

Wallaby

0
评论操作 固定链接

Thanks, w.p., I look forward to it.

If you would, please be sure to send a notice here when you make the new version release.


Randall Schulz

0
评论操作 固定链接

Hi Randall.

the new version is now available: http://www.jetbrains.net/devnet/thread/286839

Wallaby

0

请先登录再写评论。