How to use separators in a .liclipse file

37 views
Skip to first unread message

Cory Banack

unread,
Oct 12, 2016, 5:05:10 PM10/12/16
to LiClipse
Hi all,

I've written a custom ".liclipse" file to define syntax coloring, outlines, etc for a custom programming language that I use.   I'm currently using my .liclipse file in LiClipseText, and it's working great except for one detail: the programming language that I'm using has keywords (and function names) that include the '-' symbol.   This causes a couple of problems that I'd like to resolve.

1) code completion of a keyword like 'bottom-margin' works fine if I activate the completion after typing 'botto', but not if I activate it after typing 'bottom-m'

2) the mark occurrences doesn't work properly on occurrences whose name contains a dash.   For example, I want to see all the occurrences of the function "Get-Last-Login-Time()", but when I put the cursor on that name in the source code, it just finds all occurrences of "Get".

I thought that using the top-level element called separators in my .liclipse file was going to be the answer to my problems (it is described briefly here.)   But I can't seem to get it to have any effect at all when I try to use it, and I can't find an example of it being used anywhere in the delivered .liclipse files that come with LiClipse.   Does anyone have an example of how to use separators that I can look at?   Perhaps I'm just missing something obvious.

Of course, I'm also open to any other suggestions for how to fix these problems.

Thanks for taking the time to read this!

Cory

Fabio Zadrozny

unread,
Oct 14, 2016, 9:45:27 AM10/14/16
to Cory Banack, LiClipse
Hi Cory,

Previously there was support for CSS in a .liclipse, which had a similar use case... in the latest versions it was changed to use a textmate bundle, but I'm attaching the old css.liclipse file so that you can use as a base for your use-case (you can see that it customizes the separators to not include a dash and provides completions with dashes).

If you still can't get it to work, it'd be nice if you could provide a bit more information on the actual language and the current .liclipse file you're using.

Cheers,

Fabio



--
You received this message because you are subscribed to the Google Groups "LiClipse" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liclipse+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

css.liclipse

Cory Banack

unread,
Oct 14, 2016, 11:03:40 AM10/14/16
to LiClipse
Thanks Fabio, that seemed to work very well (I should sharpen up my YAML; I was just missing some escape characters in my separators string).

I copied the separators element directly out of your CSS example, since it closely matches what I need.    Now the code completion seems to work perfectly!

case: insensitive
separators: "./\\()\"':,.;<>~!@#$%^&*|+=[]{}`~?"

The 'mark occurrences' feature still behaves as though it is ignoring the separators element, however, and also it appears to be ignoring the case: insensitive element.   Is that just the way that LiClipse currently works, or am I doing something wrong in my .liclipse file?   I'll attach a copy of my .liclipse in case you want to look at it.

Other questions:

1) My .liclipse file correctly recognizes individual functions in the code and puts their names into the Outline view of Eclipse.   But is there a way I can make it so those function names are also available to code completion?

2) Does LiClipse implement code 'folding'?  (i.e. so I can collapse functions in my code down to a single line?

Thanks again for taking time to answer my questions and help out.   I'm now a huge fan of LiClipse; it's allowed me to harness all of the great features of Eclipse while working with a programming language (SQR) that hasn't been in heavy use since the 90's.  I'm going to show it to some people at work, and see what I can do about convincing my employer to buy a few licenses for us.

Cory
sqr.liclipse

Fabio Zadrozny

unread,
Oct 14, 2016, 11:19:48 AM10/14/16
to Cory Banack, LiClipse
Answering inline...

On Fri, Oct 14, 2016 at 12:03 PM, Cory Banack <cba...@gmail.com> wrote:
Thanks Fabio, that seemed to work very well (I should sharpen up my YAML; I was just missing some escape characters in my separators string).

I copied the separators element directly out of your CSS example, since it closely matches what I need.    Now the code completion seems to work perfectly!

case: insensitive
separators: "./\\()\"':,.;<>~!@#$%^&*|+=[]{}`~?"

The 'mark occurrences' feature still behaves as though it is ignoring the separators element, however, and also it appears to be ignoring the case: insensitive element.   Is that just the way that LiClipse currently works, or am I doing something wrong in my .liclipse file?   I'll attach a copy of my .liclipse in case you want to look at it.

​Humm, just took a look at that... this is a bug in LiClipse -- mark occurrences should properly respect the separators when specified (will try to fix it for the next release).​


Other questions:

1) My .liclipse file correctly recognizes individual functions in the code and puts their names into the Outline view of Eclipse.   But is there a way I can make it so those function names are also available to code completion?

​Unfortunately not currently... currently to get those tokens you need to use the regular hippie completion (i.e.: Alt+/)​, which will complete on all the tokens in the file.
 

2) Does LiClipse implement code 'folding'?  (i.e. so I can collapse functions in my code down to a single line?

​Not currently (there are plans to do it but still no due date).
 

Thanks again for taking time to answer my questions and help out.   I'm now a huge fan of LiClipse; it's allowed me to harness all of the great features of Eclipse while working with a programming language (
​​
SQR) that hasn't been in heavy use since the 90's.  I'm going to show it to some people at work, and see what I can do about convincing my employer to buy a few licenses for us.

Cory

On Wednesday, October 12, 2016 at 3:05:10 PM UTC-6, Cory Banack wrote:
Hi all,

I've written a custom ".liclipse" file to define syntax coloring, outlines, etc for a custom programming language that I use.   I'm currently using my .liclipse file in LiClipseText, and it's working great except for one detail: the programming language that I'm using has keywords (and function names) that include the '-' symbol.   This causes a couple of problems that I'd like to resolve.

1) code completion of a keyword like 'bottom-margin' works fine if I activate the completion after typing 'botto', but not if I activate it after typing 'bottom-m'

2) the mark occurrences doesn't work properly on occurrences whose name contains a dash.   For example, I want to see all the occurrences of the function "Get-Last-Login-Time()", but when I put the cursor on that name in the source code, it just finds all occurrences of "Get".

I thought that using the top-level element called separators in my .liclipse file was going to be the answer to my problems (it is described briefly here.)   But I can't seem to get it to have any effect at all when I try to use it, and I can't find an example of it being used anywhere in the delivered .liclipse files that come with LiClipse.   Does anyone have an example of how to use separators that I can look at?   Perhaps I'm just missing something obvious.

Of course, I'm also open to any other suggestions for how to fix these problems.

Thanks for taking the time to read this!

Cory

--

Cory Banack

unread,
Oct 14, 2016, 11:21:19 AM10/14/16
to Fabio Zadrozny, LiClipse
Thanks Fabio!

To unsubscribe from this group and stop receiving emails from it, send an email to liclipse+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages