Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Expose mode and getTokenAt() on editor #804

Closed
gruehle opened this issue May 4, 2012 · 5 comments
Closed

Expose mode and getTokenAt() on editor #804

gruehle opened this issue May 4, 2012 · 5 comments
Assignees

Comments

@gruehle
Copy link
Member

gruehle commented May 4, 2012

This is related to #803

While writing the "Inline Editor for JavaScript functions" and "Inline Image Viewer" extensions, I needed to access the "private" _codeMirror property in order to get the current mode (using getOption("mode")) and call the getTokenAt() function.

We should either expose these on Editor, or consider just making the _codeMirror property public.

@njx
Copy link

njx commented May 8, 2012

To @peterflynn and @gruehle to talk about along with #803.

@ghost ghost assigned peterflynn May 8, 2012
@peterflynn
Copy link
Member

Pull #923 fixed half of this by adding an Editor.getModeForSelection() API. For the remaining half (getTokenAt()) we're still not really sure how much (if any) we should try to abstract away the CodeMirror tokenizer APIs.

@peterflynn
Copy link
Member

The existing TokenUtils abstracts away getTokenAt() reasonably well, and the new 'token stream' I'm working on will do so even more cleanly. After that we may be able to close this.

@ficristo
Copy link
Collaborator

Is there still something to do here? Has "token stream" landed?

@marcelgerber
Copy link
Contributor

I guess this can be closed now, as we've managed to achieve everything we need from our TokenUtils implementation.
Thanks for noticing, @ficristo (and yeah, it's been some time, I'm catching up with my mail again ;) )

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants
@njx @gruehle @peterflynn @marcelgerber @ficristo and others