artur-shaik / vim-javacomplete2

DEPRECATED in favor of jc.nvim
Vim License
973 stars 83 forks source link

Templates for class creation #447

Closed reymalahay closed 3 years ago

reymalahay commented 3 years ago

Hi all,

This is more a set of a questions as opposed to an issue:

  1. Will it be possible to elaborate more on the class creation section?

  2. Will it be possible to reference UltiSnips snippets as templates?

Please advise.

Thanks in advance, rey malahay

artur-shaik commented 3 years ago

Hello.

Can you describe workflow of your request, how you think it should work?

reymalahay commented 3 years ago

hi there,

thank you for the response. by the way, vim-javacomplete2 is a great plugin.

it's not a workflow. basically, what i am asking is:

  1. In your documentation, there is a section titled 'Class creation' with a usage example that looks like this template:[subdirectory]:/package.ClassName extends SuperClass implements Interface(String str, public Integer i):contructor(*):toString(1)

will it be possible if you can expand on how to use this feature with a sample? for example, if i want to create a class MySecretClass in package com.secret, what is the correct order of keystrokes? will it be possible to add more details to this section?

  1. What does a typical vim-javacomplete2 template look like? Will it be possible to provide a sample?

  2. There is a plugin called UltiSnips, https://github.com/SirVer/ultisnips, which developers use to create blocks of code that they use frequently, as opposed to writing everything from scratch. Will it be possible to use UltiSnips together with vim-javacomplete2?

Please advise.

Thanks in advance, rey malahay

Hello.

Can you describe workflow of your request, how you think it should work?

artur-shaik commented 3 years ago

Here is quick example:

output

Also, you can specify path of the class, like so: new_package.TestClass. It will create new directory new_package and put new class in it.

Templates are here: https://github.com/artur-shaik/vim-javacomplete2/tree/master/plugin/res

It is actually not templates, but methods that generates class structure.

artur-shaik commented 3 years ago

And about UltiSnips, you can use it, and it works on itself. I don't know how we can integrate it with jc2.

reymalahay commented 3 years ago

This is awesome! Thank you very much, @artur-shaik !

Here is quick example:

output

Also, you can specify path of the class, like so: new_package.TestClass. It will create new directory new_package and put new class in it.

Templates are here: https://github.com/artur-shaik/vim-javacomplete2/tree/master/plugin/res

It is actually not templates, but methods that generates class structure.

reymalahay commented 3 years ago

No worries. I'll figure it out. If i find a plausible use case, i will open an issue and put forward a proposal.

And about UltiSnips, you can use it, and it works on itself. I don't know how we can integrate it with jc2.

artur-shaik commented 3 years ago

You are welcome!