de-jcup / eclipse-yaml-editor

Eclipse YAML editor
https://marketplace.eclipse.org/content/yaml-editor
Apache License 2.0
35 stars 10 forks source link

Handle Tab + SHIFT tab on text selections #42

Closed de-jcup closed 5 years ago

de-jcup commented 5 years ago

When pressing TAB inside editor it will be replaced by configured amount of spaces (done in preferences).

So far so good... but...

When doing a selection of text and pressing either TABor SHIFT+ TAB the editor content selection is just crushed.

The behaviour should be as following inReplaceTabBySpacesVerifyKeyListener:

When TAB is pressed

SHIFT TAB is currently not implemented at all but should work complete opposite way:

de-jcup commented 5 years ago

As this seems to be a very generic approach it could - when working - added to eclipse-commons project and just used here.

f18m commented 5 years ago

Hi @de-jcup , sorry to bother you but I have again a few problems launching the plugin from my Eclipse. My problem is that I followed https://www.youtube.com/watch?v=9_AQouAvehY&feature=youtu.be (with the obvious difference that I imported from an already-cloned GIT repo of my fork of this plugin) but I get a project in my eclipse that builds src/main/java but not src/main/java-eclipse

(as instead in my BashEditor plugin workspace!)... the result is of course that when I create a launch configuration and run it I get: "Plug-in de.jcup.yamleditor was unable to load class de.jcup.yamleditor.YamlEditor." See this screenshot:
https://imgur.com/a/9W2AscB

I tried already to run by terminal both ./gradlew build ./gradlew eclipse as written here https://github.com/de-jcup/eclipse-bash-editor/wiki/Contribution Maybe I can't remember how I managed to get BashEditor plugin or maybe there's something different with this YAML plugin...

Thanks

f18m commented 5 years ago

Btw I noticed that: if I import from git the yaml plugin sources in a Eclipse that does NOT contain the EGradle Editor plugin, then I get the eclipse-yaml-editor/yamleditor-plugin/src/main/java-eclipse folder recognized and built BUT the compiler will complain about the missing required build path "yamleditor-other".

If I install the EGradle plugin to get the "yamleditor-other" folder recognized and present, I loose the "java-eclipse" folder....

I must be missing something :) Sorry I'm mostly a C++ developer... all this Java stuff is a bit confusing to me :)

de-jcup commented 5 years ago

Hello @f18m

yaml editor has no dependency to egradle plugin runtime. Neither das Egradle itself change anything. I will explain the java parts :

A eclipse java project does always rely on the.classpath file inside the project. There are the external dependencies listed but also all source folders used for compilation. When you initally clone the repository and look (at least) into master you will something like: image

The selection shows the source pathes. So the "normal" java stuff and also the eclipse dedicated parts are contained out of the box.

I tried out at my console a ./gradlew cleanEclipse eclipse and did after that a git status. Classpathes did not change at all!

If I install the EGradle plugin to get the "yamleditor-other" folder recognized and present, I loose the "java-eclipse" folder....

Ahem - EGradle is one of my plugins and I am using it to get things working in eclipse-it works good enough for my whishes. But you don't even need egradle to get things working. When you want the "yamleditor-other" project be available (it does only contain special test parts and some other non-eclipse stuff and is most time not needed) you just need to call gradle wrapper.

In next comment I will excercise a complete new import to an temporary, empty workspace.

de-jcup commented 5 years ago

Here I tested out in a new empty workspace and new temp folder for git repo:

image Then in eclipse: image After Next: image Then 4 projects are imported. No errors. Now create a "Eclipse Application Launch configuration": image When pressing Run I get image And then pressing continue the Runtime eclipse started, I created a temp project and a test.yamlfile inside. All is working.

So normally easiest way is to

de-jcup commented 5 years ago

About your import problems: Hm... the only thing I could think about is that you accidently used not EGradle but Buildship-Plugin and this did some setup for Gradle execution (EGradle does only call command line and does no magic at all, so console world and Eclipse world are always same. Buildship uses the API of gradle and does some magic stuff on project classpathes (e.g adding gradle dependencies as a special library folder inside project).

I hope it works now. If not, don't hesitate to contact me again.

f18m commented 5 years ago

Hi @de-jcup , my problem was the missing step "./gradlew cleanEclipse eclipse" BETWEEN the git import and the eclipse import. I was doing that step AFTER the eclipse import and then trying to import the "eclipse-others" project ... that was a bit painful. By doing the gradle step before the import in Eclipse it worked just fine, thanks!!!

de-jcup commented 5 years ago

@f18m : Good work thank you :+1: Works very well

I have merged it into master now. I will start to adopt the solution as an API for eclipse-commons see https://github.com/de-jcup/eclipse-commons/issues/12 . When this is done , I will reintegrate API variant to yaml editor and bash editor.

de-jcup commented 5 years ago

@f18m I just released yaml-editor V1.3.0 on eclipse marketplace. Your changes are online :-)

Best wishes Albert

f18m commented 5 years ago

Thanks @de-jcup , I took a look at the refactoring, very good work!!