Bug 543283 - toCamelCase command
Summary: toCamelCase command
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.10   Edit
Hardware: All All
: P4 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, helpwanted
Depends on:
Blocks:
 
Reported: 2019-01-08 17:07 EST by Mickael Istria CLA
Modified: 2022-03-05 01:57 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2019-01-08 17:07:37 EST
Just like it's possible to turn text ot upper case or lower case, it would be nice to provide a command to turn a code to camelCase.
This would for example be convenient for people who copy past some XML columns name (upper case with some _) to help them turning the symbols into typical Java identifier. So BIRTH_DATE would become birthDate.
Comment 1 Dani Megert CLA 2019-01-09 12:44:52 EST
(In reply to Mickael Istria from comment #0)
> So BIRTH_DATE would become birthDate.

I doubt the benefit of spending resources for this.
Comment 2 Mickael Istria CLA 2019-01-09 12:46:27 EST
(In reply to Dani Megert from comment #1)
> I doubt the benefit of spending resources for this.

I've seen an interesting demo where this gives a kind of wow-effect. But it's indeed a marginal use-case and it probably shouldn't be taken with high priority compared to other stuff in the backlog.
Comment 3 Shahd Muhareb CLA 2020-11-07 09:15:26 EST
(In reply to Mickael Istria from comment #0)
> Just like it's possible to turn text ot upper case or lower case, it would
> be nice to provide a command to turn a code to camelCase.
> This would for example be convenient for people who copy past some XML
> columns name (upper case with some _) to help them turning the symbols into
> typical Java identifier. So BIRTH_DATE would become birthDate.

Hello, 
I understand the issue and I want to work on it.
Best regards.
Comment 4 Andrey Loskutov CLA 2020-11-07 09:38:03 EST
Have you triex anyedit plugin? https://marketplace.eclipse.org/content/anyedit-tools. It has this and many more...
Comment 5 Mickael Istria CLA 2020-11-07 09:38:33 EST
(In reply to Shahd  Muhareb from comment #3)
> I understand the issue and I want to work on it.

Do you need help with that?
org.eclipse.ui.workbench.texteditor would be the best place for that.
Comment 6 Shahd Muhareb CLA 2020-11-08 09:31:00 EST
(In reply to Mickael Istria from comment #5)
> (In reply to Shahd  Muhareb from comment #3)
> > I understand the issue and I want to work on it.
> 
> Do you need help with that?
> org.eclipse.ui.workbench.texteditor would be the best place for th(In reply to Andrey Loskutov from comment #4)
> Have you triex anyedit plugin?
> https://marketplace.eclipse.org/content/anyedit-tools. It has this and many
> more...

No, I don't have. I built text-master on eclipse installer and I opened Case action (In reply to Mickael Istria from comment #5)
> (In reply to Shahd  Muhareb from comment #3)
> > I understand the issue and I want to work on it.
> 
> Do you need help with that?
> org.eclipse.ui.workbench.texteditor would be the best place for that.

(In reply to Mickael Istria from comment #5)
> (In reply to Shahd  Muhareb from comment #3)
> > I understand the issue and I want to work on it.
> 
> Do you need help with that?
> org.eclipse.ui.workbench.texteditor would be the best place for that.

Yes, it will be interesting. I have opened ui.texteditor and I think caseAction class will be useful
Comment 7 Shahd Muhareb CLA 2021-01-14 04:03:59 EST
(In reply to Mickael Istria from comment #5)
> (In reply to Shahd  Muhareb from comment #3)
> > I understand the issue and I want to work on it.
> 
> Do you need help with that?
> org.eclipse.ui.workbench.texteditor would be the best place for that.

Hello, Mickael 
I don't know where I should assign the shortcut of toCmelCase().
I searched for the shortcut of toUpperCase to help me. But I didn't find it.
Please can you help me ??

Best Regards.
Comment 8 Mickael Istria CLA 2021-01-14 04:16:33 EST
(In reply to Shahd  Muhareb from comment #7)
> I searched for the shortcut of toUpperCase to help me. But I didn't find it.

According to Window > Preferences > General > Keys, shortcut for "To Upper Case" is Ctrl+Shift+X. Searching for M1+M2+X in plugin.xml files of eclipse.platform.text repo shows it's defined in org.eclipse.ui.workbench.texteditor/plugin.xml:L652.

That said, we may not need the shortcut immediately as part of a 1st iteration. Just having the command accessible in Ctrl+3 would already be a good addition even if no shortcut is immediately accessible.
Comment 9 Shahd Muhareb CLA 2021-01-14 07:55:11 EST
(In reply to Mickael Istria from comment #8)
> (In reply to Shahd  Muhareb from comment #7)
> > I searched for the shortcut of toUpperCase to help me. But I didn't find it.
> 
> According to Window > Preferences > General > Keys, shortcut for "To Upper
> Case" is Ctrl+Shift+X. Searching for M1+M2+X in plugin.xml files of
> eclipse.platform.text repo shows it's defined in
> org.eclipse.ui.workbench.texteditor/plugin.xml:L652.
> 
> That said, we may not need the shortcut immediately as part of a 1st
> iteration. Just having the command accessible in Ctrl+3 would already be a
> good addition even if no shortcut is immediately accessible.

ok, thanks.

we should add an extension point for the new plug-in ??

I follow this tutorial 
https://www.vogella.com/tutorials/EclipseExtensionPoint/article.html
Comment 10 Mickael Istria CLA 2021-01-14 07:56:35 EST
(In reply to Shahd  Muhareb from comment #9)
> we should add an extension point for the new plug-in ??

We din't need a new plugin. Just add the command similarly to how the "to upper case" command is added, in the same plugin.
Comment 11 Shahd Muhareb CLA 2021-01-14 16:38:58 EST
(In reply to Mickael Istria from comment #10)
> (In reply to Shahd  Muhareb from comment #9)
> > we should add an extension point for the new plug-in ??
> 
> We don't need a new plugin. Just add the command similarly to how the "to
> upper case" command is added, in the same plugin.

but when I added it in the same plugin the shortcut of toCamelCase() is now worked but toUpperCase() doesn't.
Comment 12 Mickael Istria CLA 2021-01-15 02:56:44 EST
(In reply to Shahd  Muhareb from comment #11)
> but when I added it in the same plugin the shortcut of toCamelCase() is now
> worked but toUpperCase() doesn't.

Is your new toCamelCase command using a different id from the toUpperCase one?
Please submit your patch via Gerrit and we can have a look in more details.
Comment 13 Shahd Muhareb CLA 2021-01-15 05:17:27 EST
(In reply to Shahd  Muhareb from comment #11)
> (In reply to Mickael Istria from comment #10)
> > (In reply to Shahd  Muhareb from comment #9)
> > > we should add an extension point for the new plug-in ??
> > 
> > We don't need a new plugin. Just add the command similarly to how the "to
> > upper case" command is added, in the same plugin.
> 
> but when I added it in the same plugin the shortcut of toCamelCase() is now
> worked but toUpperCase() doesn't.

it is ready.
CTRL+SHIFT+W => toUpperCamelCase()
CTRL+SHIFT+Z => toUpperCamelCase()
Comment 14 Shahd Muhareb CLA 2021-01-15 05:27:22 EST
(In reply to Shahd  Muhareb from comment #13)
> (In reply to Shahd  Muhareb from comment #11)
> > (In reply to Mickael Istria from comment #10)
> > > (In reply to Shahd  Muhareb from comment #9)
> > > > we should add an extension point for the new plug-in ??
> > > 
> > > We don't need a new plugin. Just add the command similarly to how the "to
> > > upper case" command is added, in the same plugin.
> > 
> > but when I added it in the same plugin the shortcut of toCamelCase() is now
> > worked but toUpperCase() doesn't.
> 
> it is ready.
> CTRL+SHIFT+W => toUpperCamelCase()
> CTRL+SHIFT+Z => toUpperCamelCase()

sorry, CTRL+SHIFT+Z => toLowerCamelCase()
Comment 15 Mickael Istria CLA 2021-01-15 05:28:53 EST
(In reply to Shahd  Muhareb from comment #14)
> > it is ready.
> > CTRL+SHIFT+W => toUpperCamelCase()
> > CTRL+SHIFT+Z => toUpperCamelCase()

I don't get it. CamelCaseIsIntentiallyMixingUpperAndLowerCase so why 1 upper and 1 lower case variant?
Comment 16 Shahd Muhareb CLA 2021-01-15 05:36:25 EST
(In reply to Shahd  Muhareb from comment #13)
> (In reply to Shahd  Muhareb from comment #11)
> > (In reply to Mickael Istria from comment #10)
> > > (In reply to Shahd  Muhareb from comment #9)
> > > > we should add an extension point for the new plug-in ??
> > > 
> > > We don't need a new plugin. Just add the command similarly to how the "to
> > > upper case" command is added, in the same plugin.
> > 
> > but when I added it in the same plugin the shortcut of toCamelCase() is now
> > worked but toUpperCase() doesn't.
> 
> it is ready.
> CTRL+SHIFT+W => toUpperCamelCase()
> CTRL+SHIFT+Z => toUpperCamelCase()

Sorry, CTRL+SHIFT+Z => toLowerCamelCase()
Comment 17 Shahd Muhareb CLA 2021-01-15 05:38:18 EST
(In reply to Mickael Istria from comment #15)
> (In reply to Shahd  Muhareb from comment #14)
> > > it is ready.
> > > CTRL+SHIFT+W => toUpperCamelCase()
> > > CTRL+SHIFT+Z => toUpperCamelCase()
> 
> I don't get it. CamelCaseIsIntentiallyMixingUpperAndLowerCase so why 1 upper
> and 1 lower case variant?

Yes, but there are 2 types of Camel case.

see that https://en.wikipedia.org/wiki/Camel_case
Comment 18 Mickael Istria CLA 2021-01-15 05:49:21 EST
(In reply to Shahd  Muhareb from comment #17)
> Yes, but there are 2 types of Camel case.
> 
> see that https://en.wikipedia.org/wiki/Camel_case

Wow, I didn't realize that and was really happy to learn about CamelCase vs dromedaryCase!
So OK with 2 commands, maybe we should label them with the result to clarify them: "To lower camelCase" and "To upper CamelCase".
Please submit your patch via gerrit as described in https://wiki.eclipse.org/Gerrit#To_create_a_new_change
Comment 19 Shahd Muhareb CLA 2021-01-15 15:05:07 EST
(In reply to Mickael Istria from comment #18)
> (In reply to Shahd  Muhareb from comment #17)
> > Yes, but there are 2 types of Camel case.
> > 
> > see that https://en.wikipedia.org/wiki/Camel_case
> 
> Wow, I didn't realize that and was really happy to learn about CamelCase vs
> dromedaryCase!
> So OK with 2 commands, maybe we should label them with the result to clarify
> them: "To lower camelCase" and "To upper CamelCase".
> Please submit your patch via gerrit as described in
> https://wiki.eclipse.org/Gerrit#To_create_a_new_change

I still have a problem with submitting over Gerrit.
Comment 20 Mickael Istria CLA 2021-01-15 15:24:13 EST
(In reply to Shahd  Muhareb from comment #19)
> I still have a problem with submitting over Gerrit.

If you provide a more precise description of your problem, we may be able to help.
Comment 21 Shahd Muhareb CLA 2021-01-16 08:36:38 EST
(In reply to Mickael Istria from comment #20)
> (In reply to Shahd  Muhareb from comment #19)
> > I still have a problem with submitting over Gerrit.
> 
> If you provide a more precise description of your problem, we may be able to
> help.

Hello, did you see my submission? 
I committed my repository from eclipse. but I can't find it in Gerrit.
Comment 22 Mickael Istria CLA 2021-01-16 08:40:24 EST
(In reply to Shahd  Muhareb from comment #21)
> I committed my repository from eclipse. but I can't find it in Gerrit.

No. I guess you commit did fail. Please try again and verify the return messages.
Comment 23 Shahd Muhareb CLA 2021-01-16 08:56:38 EST
(In reply to Mickael Istria from comment #20)
> (In reply to Shahd  Muhareb from comment #19)
> > I still have a problem with submitting over Gerrit.
> 
> If you provide a more precise description of your problem, we may be able to
> help.

Hello, did you see my submission? 
I committed my repository from eclipse. but I can't find it in Gerrit.
Comment 24 Mickael Istria CLA 2021-01-29 16:19:53 EST
(In reply to Shahd  Muhareb from comment #23)
> Hello, did you see my submission? 

No.

> I committed my repository from eclipse. but I can't find it in Gerrit.

What did you try exactly? What were the return messages?
Comment 25 Dirk Steinkamp CLA 2022-03-04 18:58:10 EST
possibly duplicate of: https://bugs.eclipse.org/bugs/show_bug.cgi?id=576417