Author Topic: Gradle project problems (continued from Java import disorganized).  (Read 4301 times)

Marcel

  • Senior Community Member
  • Posts: 243
  • Hero Points: 26
Re: Gradle project problems (continued from Java import disorganized).
« Reply #15 on: September 20, 2019, 02:46:19 pm »
I tested b4.  The Gradle wrapper checkbox problem is fixed, thank you.

As far as the missing subproject references go, I am beginning to think that my expectations are off. 
  • If I open the root project, and mark one of the subprojects (say A) as active, any references A makes to B, C ... resolve just fine
  • If I open subproject A directly (load its .vpj), such references do not resolve.

The difference is obviously that in the latter case SE does not have access to the root .vtg file which would provide the needed tags.

Do I need to manually add the root tag file?

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1423
  • Hero Points: 130
Re: Gradle project problems (continued from Java import disorganized).
« Reply #16 on: September 20, 2019, 03:52:41 pm »
If the root project and the sub-project are in the same workspace, then the tags are visible between the projects.  So if you go to "Tools -> Tag Files..." and look at the "Workspace and Project Tag Files" entry, the same tag files should be there no matter which project is open.

However, another developer pointed out to me that there are some options that can change the search scope to the current project.

Assuming you're using push-tag (ctrl-dot for most bindings), there's a option to restrict it to only show symbols in the current project.  If the language was Java, you'd go to "Tools -> Options -> Languages -> Application Languages -> Java -> Context Tagging", and in the "Go to Definition" group, check to see if the "When there are multiple choices"  is set to "Only Show Symbols in the Current Project".   There is also an option there to prefer symbols in the current project. So if you have a symbol that's shared between two projects, the it will prefer the definitions in your current project.

For searches under the Search menu, there are also options there to restrict searches to the current project.  Different from tagging, but something to keep in mind.

A less likely culprit would be that the two sub-projects have source files in different languages that we don't recognize as sharing symbols. (just as an example, Kotlin can see symbols for Java,  but wouldn't be able to see symbols in a C++ file, unless the "Tools -> Options -> Editing -> Context Tagging -> "Allow mixed language references" is turned on). 

Marcel

  • Senior Community Member
  • Posts: 243
  • Hero Points: 26
Re: Gradle project problems (continued from Java import disorganized).
« Reply #17 on: September 20, 2019, 04:48:09 pm »
This goes back to my wrong expectation remark.

If I open the subproject .vpj directly, it is detached and not part of the workspace, there is no back link to the original workspace.  SE will create a local .vpw and its very own .vtg.

I should not do that, it sabotages the whole workspace setup.  However, I need to find a way to work on multiple subprojects side-by-side, probably by using multiple -sc since I can only have one active project at a time.

Thanks for pushing the Gradle support ahead by a few miles.

p.s. Maybe you can convince Dennis to use your new workspace info for the organize import function, it still cannot find 3rd-party imports.



patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1423
  • Hero Points: 130
Re: Gradle project problems (continued from Java import disorganized).
« Reply #18 on: September 20, 2019, 05:04:21 pm »
Ahh, I was assuming you just had the root workspace open, and just changing the active project. 

Out of curiosity, what other operations do you need to do that depend on the current workspace?  Are you modifying a few projects at once and having to build them occasionally?  Depending on what you're doing, you may be able to access what you need for projects other than the current project via another mechanism, rather than having to fire up another instance.

Organize imports should use the tags of the workspace without any other setup, but I'll let him know in case I'm missing something there.

Marcel

  • Senior Community Member
  • Posts: 243
  • Hero Points: 26
Re: Gradle project problems (continued from Java import disorganized).
« Reply #19 on: September 20, 2019, 06:10:12 pm »
It is quite common that I have to work on several subprojects at the same time, e.g. a common library, a client and a server.  Each one is run through edit, build unit tests and debug cycles.  It would indeed be helpful not to have create separate instances.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1423
  • Hero Points: 130
Re: Gradle project problems (continued from Java import disorganized).
« Reply #20 on: September 20, 2019, 06:59:07 pm »
I think the only way to do that via the UI is to right click on the project in the projects toolbar and choose the command you want from the context menu that pops up.  It will show any of the targets that would normally show up in the Build menu when the project is active.

If you were thinking about something that you could bind to a key or a toolbar button to perform the project specific actions, well it looks like you can't record a regular macro to do that menu action, because it's looking at the currently selected project in the Projects tab.  But it is doable with custom macro code, I can post an example if you're interested in that.