Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some Feedback and Suggestions #104

Closed
6 tasks
RobertBColton opened this issue Jan 4, 2015 · 5 comments
Closed
6 tasks

Some Feedback and Suggestions #104

RobertBColton opened this issue Jan 4, 2015 · 5 comments

Comments

@RobertBColton
Copy link

I wanted to offer some feedback about any bugs I encountered or ways I thought the component could be improved.

  • When selecting text across multiple lines there seems to be some issues with the composite.
  • Rectangular Selection Mode
  • Auto-completion
  • Code folding with modularity for languages with less strict syntax like BASIC
  • Comment/Uncomment multiple/selected lines, like Visual Studio, have yet to see a single code editor implement this, not even Scintilla
  • Modular row header views with ImageView support to make things like breakpoints, etc.

This is an amazing framework for rich JavaFX editing and I really hope the project continues!

@TomasMikula
Copy link
Member

Hi Robert,

thank you for the feedback and suggestions. See my comments inline.

When selecting text across multiple lines there seems to be some issues with the composite.

Can you open a separate issue for this with more detailed description and/or screenshot?

Rectangular Selection Mode

You can open a separate feature request. It also implies rectangular copy&paste.

Auto-completion

It is unlikely there's going to be a baked in support for auto-completion. This project tries to be a flexible basis for code and other editors, not a full-featured editor by itself. Auto-completion is necessarily based on grammar (whether it's just a dictionary, or a programming language grammar), and I don't want RichTextFX to restrict what grammars/parsers/languages are supported.

On the other hand, there is already enough support to add auto-completion on top of RichTextFX. You are already able to obtain the text content and the position in it, as well as display a popup window next to the cursor.

Code folding with modularity for languages with less strict syntax like BASIC

Again, it's unlikely there's going to be anything language specific in RichTextFX. On the other hand, I'm in favor of providing low-level support for this in RichTextFX, such as an API to hide/show a range of lines.

Comment/Uncomment multiple/selected lines, like Visual Studio, have yet to see a single code editor implement this, not even Scintilla

All the low-level support is already there, since it's just replacing lines of text with slightly modified lines of text. The actual implementation is again language specific, and thus unlikely to be included in RichTextFX.

Modular row header views with ImageView support to make things like breakpoints, etc.

The low-level support is already there, in terms of paragraph graphic factory. Line numbers in the demo are just a special case of this.


All that said, I support any effort to provide a more out-of-the-box solution for code editing based on RichTextFX. It's just someone would have to take the initiative to create and maintain that project, and we can then coordinate our efforts.

@RobertBColton
Copy link
Author

@TomasMikula Thank you for getting back with me so quickly! I understand entirely where you are coming from. I have filed the other tickets as you have suggested.

I think the code folding solution would be perfectly fine with me specifically as a developer looking to use RichTextFX. I could work with that because it would be trivial and allow me to actually customize the code folding margin considering the modularity of the paragraph graphic factory. But if RTFX were to provide the underlying show/hide line mechanism would it also propagate this information to the paragraph graphic factory so that it knows the visible lines? That would be essential to its implementation as well as hiding the line numbers for hidden lines. I ask because I am wondering if you would go with an implementation which automatically handles hiding the line numbers/graphic for the corresponding margins as I haven't worked with the paragraph graphic factory yet.

As for comment/uncomment multiple lines I hadn't actually considered multiple languages as I did with code folding. I agree with you and it's easy to implement on the developer side as it's just prepending lines with comment markers or using a regular expression pattern to remove them.

I also agree with your auto-completion analysis as that is also likely to be better implemented by the developer. For instance, Eclipse automatic completion is a little more advanced than something you see in Scintilla. Additionally Scintilla is pretty horrible with large completion lists and lags quite badly, it simply isn't as customizable as it should be. That said, I see nothing wrong with a helper/plugin library on to of RTFX that would provide some generic functionality for this. Have there been any projects/plugins on top of RTFX to date?

@TomasMikula
Copy link
Member

But if RTFX were to provide the underlying show/hide line mechanism would it also propagate this information to the paragraph graphic factory so that it knows the visible lines? That would be essential to its implementation as well as hiding the line numbers for hidden lines. I ask because I am wondering if you would go with an implementation which automatically handles hiding the line numbers/graphic for the corresponding margins as I haven't worked with the paragraph graphic factory yet.

Yes, the implementation would automatically hide graphic of the hidden lines. Graphic factory is just a function that takes a line number and returns a Node. It is called for each line as needed (e.g. as the user scolls the document). When line number changes, the graphic is recreated (the old graphic is just removed from the scene and GCed). If graphic nodes need to be disposed in some way, currently this has to be done by listening to the node's sceneProperty and do the disposal when it changes to null (i.e. when the graphic Node is removed from the scene).

Have there been any projects/plugins on top of RTFX to date?

The only project I know exploring this area is Xanthic.

@RobertBColton
Copy link
Author

@TomasMikula Sounds great, I filed #107 and I think that covers everything. Keep up the great work!

@TomasMikula
Copy link
Member

Modular row header views with ImageView support to make things like breakpoints, etc.

I answered a question on StackOverflow on how to add the current line indicator. This can give you the idea of how you would implement breakpoints.

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

No branches or pull requests

2 participants