intersystems / isc-codetidy

MIT License
2 stars 5 forks source link

CodeTidy conflict with Source Control in Studio #20

Closed quangmai12 closed 2 years ago

quangmai12 commented 2 years ago

I installed codetidy and under Source Control Settings it show pkg.isc.codetidy.extension.Composite is selected. However this will remove my other Source Control class being used in Studio. Also by setting this to codetidy, i have pop up error CLASS DOES NOT EXIST> zgetProperty+2^Workbench.SourceControl.Commands How to fix it? I did run the command Do ##class(%Studio.SourceControl.Interface).SourceControlClassSet("Workbench.SourceControl.SVN.Studio") which is my source control class but it doesn't help.

isc-pbarton commented 2 years ago

Hello, running the ##class(pkg.isc.codetidy.Utils).SetupExtension() method will set your existing Source Control class as the primary extension class and CodeTidy as a secondary extension class. This should allow you to run both in parallel. After running the SetupExtension method are you seeing the names of both classes in this global?

zwrite ^SYS("SourceControl","pkg.isc.codetidy.extension.Composite")
quangmai12 commented 2 years ago

1, yes, i see both existing Source Control and CodeTidy in global.

  1. Running the SetExtension method will switch my existing SC as current to CodeTidy > This action removed all sub menu item from my existing SC and added CodeTidy to menu. However, popup errors show if CodeTidy is primary.
  2. I was instructed to run this command which brings back existing SC but it also removed CodeTidy from the menu Do ##class(%Studio.SourceControl.Interface).SourceControlClassSet("Workbench.SourceControl.SVN.Studio") CodeTidyError1
isc-tleavitt commented 2 years ago

Hmm... this might just be a bug, but if so we should be able to work around it. What's your IRIS version? (w $zv)

quangmai12 commented 2 years ago

HealthShare 2020.2 [HealthShare Modules: Core:20.1.8624 + Patient Index:20.0.8624] - IRIS for Windows (x86-64) 2020.1 (Build 217_1_20418U) Mon Dec 21 2020 11:42:06 EST

quangmai12 commented 2 years ago

Here are steps

  1. run do ##class(pkg.isc.codetidy.Utils).SetupExtension()
  2. zwrite ^SYS("SourceControl","pkg.isc.codetidy.extension.Composite") gives output as below. However my existing source control is blank and CodeTidy is not displayed. ^SYS("SourceControl","pkg.isc.codetidy.extension.Composite","PrimaryExtensionClass")="Workbench.SourceControl.SVN.Studio ^SYS("SourceControl","pkg.isc.codetidy.extension.Composite","SubExtensionClasses")=$lb("pkg.isc.codetidy.Assistant")
quangmai12 commented 2 years ago

Nice tool but Fix in #21 may not relate to my issue. I have problem in Studio which cannot have both our Source Control and your Code Tidy exists in Studio menu at same time. If I set one as primary, the other is removed and via versa. And get the CLASS DOES NOT EXIST all the time if CodeTidy run in Studio.

isc-tleavitt commented 2 years ago

@quangmai12 if installing the latest version from zpm doesn't fix the issue, we can connect over a Teams call or something to debug. If the issue is a behavior of your existing source control extension (Workbench.SourceControl.SVN.Studio) then we can't really help, but if it's an issue in codetidy we might be able to.

quangmai12 commented 2 years ago

please contact me at qmai@memorialcare.org to set up Team call.

isc-tleavitt commented 2 years ago

Root cause for issue was in the other extension (and we figured it out).