language support at Project, Module, or folder level

Hi,

I currently have a plugin that correctly loads at application level to provide language support. But I would really like to be able to have that language support at a module or project level. is it possible?

The key thing is I want to be able to enable the support because it impacts files with the *.txt extention which evidently it is not usefull to apply at the application level.

Ultimately I would like to identify a folder per module in which *.txt files are parsed according to the language plugin.

Florian

2 comments

Hello Florian,

FH> I currently have a plugin that correctly loads at application level
FH> to provide language support. But I would really like to be able to
FH> have that language support at a module or project level. is it
FH> possible?
FH>
FH> The key thing is I want to be able to enable the support because it
FH> impacts files with the *.txt extention which evidently it is not
FH> usefull to apply at the application level.
FH>
FH> Ultimately I would like to identify a folder per module in which
FH> *.txt files are parsed according to the language plugin.

You will have to associate your language file type with the *.txt extension
(or a filename mask, if it will help), and there is no way to make it more
fine-grained at this level. However, you can simply disable all features
of your plugin if the file is not at the proper folder, and it will be treated
pretty much like plain text.

--
Dmitry Jemerov
Software Developer
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Hi,

On suggestion 1, can I define a mask that includes a directory or is it just a mask for the filename?

On suggestion 2, where would I do this disabling/enabling. Would disabling the at the level of the Lexer be enough? I could conceive of making a call in the Lexer that would only return a language token when the plugin is parsing a file in the right folder. The strange thing though is that this would result possibly in a lot of lexing for nothing. I am not even sure if the JFlex API would allow for my code to infer what file it is parsing at any pint.

thanks for the help
Florian

0

Please sign in to leave a comment.