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.
Tagged:

Comments

  • 5 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).
  • I'm about to release a major new version of my software in January 2023.

    I was wondering if this has been implemented? For example, a simple function I could call to determine whether the cursor/caret is in PHP code.

    Thanks.
  • This may be implemented as a part of 2023 release new features. The release itself is expected in the first quarter of the 2023 year. 
  • OK, thanks. I'll keep my fingers crossed. It's obviously not a huge deal but would be nice to have.
Sign In or Register to comment.