Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Determine which syntax parser being used at cursor location

Is there a way to determine what syntax parser is being used at the current cursor location?

For example, I want to know if the editor thinks that it's in PHP code where the cursor is, so that I can "scan" for some nearby PHP functions.

If this is not possible then can it be added in the next update? Maybe return what syntax scheme is being used where the current cursor position is (where the user is currently editing)?

Thank you.


  • 2 Comments sorted by Votes Date Added
  • Currently there are no way to achieve it. But, I will check more, it seems from the first look that it can be implemented. 

    However, I want to warn right now, that there are no expected logical relations of schemes. For example, a scheme, like "comment" generally has an array of parent schemes. So, it's a question, whether this information will be really useful.
  • OK, thank you for looking into this.

    My initial desire is to simply know whether the cursor is in PHP code (as opposed to HTML, CSS, JavaScript, JSON, etc). I don't really need to know (at this point) whether the cursor is in a comment, integer, string, etc. but that information could be useful to me in the future... so if you could provide that info as well then great! If not then that's OK too... especially if I can still know whether it's in PHP or not (or JavaScript because I can do a quick 'scan' for JavaScript functions too).
Sign In or Register to comment.