Eclipse Editor - hiding parts of a line - eclipse-plugin

I build my Text Editor in Eclipse.
Is there a way of hiding part of a line in Eclipse Editor Plugin?
Currently I am using ProjectionViewer as a SourceViewer and it can only hide (fold) whole lines, and not part of a line.

Related

How to visually wrap lines at tab width in IntelliJ?

In other editors (Visual Studio Code and Netbeans which I mostly use), I can enable word wrap. Lines will then be split (visually) over multiple lines if the line is longer that the view area.
How can the same be enabled in IntelliJ (Community)? Right now I can't get any kind of word wrap (coding Kotlin).
The feature is called Soft-wrap. You can configure it here:

"Excluding" a code file in resources from IntelliJ

I have a groovy file in my test resources folder (e.g. abc.groovy)
Because I use it like a resource.
Everything works fine except it is red squiggly underlined since IntelliJ thinks it is a code file (actually I use it more like an include file for a scripting engine, which is why I have it in a resources folder)
How can I stop IntelliJ from thinking it is runnable code? I don't want to exclude it from the project completely since it I want it in Version control and available for searching.
It is red underlined because it contains some non-groovy syntax as well (which my program recognizes, but IntelliJ does not)
It will show up in "Problems" sidebar (but not in Problems at the bottom of the IDE, and doesn't prevent code from running)
You can mark that file as plain text (there's an action for that if you right-click on the file in Project View).

How to auto indent in WebStorm

I need to indent multiple files in WebStorm. Its option "Auto-indent" in the Code menu only indents current line.
How do I use it on multiple files like I can use "Reformat Code"?
Select the folder you want to reformat the code for in the Project tool window. Then select Code | Reformat Code
This page explains it. https://www.jetbrains.com/help/idea/2016.1/reformatting-source-code.html

IntelliJ auto detect indentation for each file

I recently switched from Sublime Text to IntelliJ and I trying to figure out, if there's a way for IntelliJ to auto detect what indentation the current file is using and use that instead of the default
I have to deal with a lot of 3rd party code, which can have different indentation settings, which I'm not allowed to change for obvious reasons.
Sublime Text was able to detect and abide to the indentation for the current file, which is quite intuitive and unobtrusive. IntelliJ on the other hand just sticks to it's own settings, resulting in mixed tabs and spaces, wrong indentation levels and wrong merge conflicts.
Is there a way to make IntelliJ behave, other than having to manually change the indentation settings every time I get a file with different indentation.
Thanks
In recent versions of Intellij there is a Detect and use existing file indents for editing setting for this:
Each project you open in IntelliJ has it's own settings. You will need to set the indent style the first time you open up the project, but it will be saved after that (and can be different for every project you work on). From the IntelliJ help site:
Project settings are stored with each specific project as a set of xml files
under the .idea folder. If you specify the
default project settings,
these settings will be automatically used for each newly created project.
You can edit the indent settings for the project in the Code Style dialog.

How to format characters in a custom eclipse editor plugin

I'm writing a custom editor plugin in Eclipse and I'm trying to figure out how to format certain character sequences with symbols. So in the editor view typing -> would be replaced with →. I don't want to modify the underlying document content, just how the characters are displayed. The TextAttribute class only allows me to change the style of the text, not what is actually displayed.
You would probably have to copy all of the Eclipse classes having to do with the editor into your own project so you could modify the method(s) that displays characters on the screen.