Author Topic: Code Annotations: Project and Workspace  (Read 1537 times)

jporkkahtc

  • Senior Community Member
  • Posts: 1825
  • Hero Points: 177
  • Text
Code Annotations: Project and Workspace
« on: July 26, 2016, 05:44:18 pm »
I can't get project or workspace annotations to work.
Starting with no annotations, I opened the annotations tool.
I created an annotation.
The only option in the new annotation dialog is "personal annotations".


When I goto the annotations file manager, I see personal, project and workspace.
I can't create any personal or workspace annotations.


When you create a new annotation type, can you control which annotation file that new type applies to?
When I do it, it adds to personal only.

I've attached the workspace SCA file that Slick created today.



I started looking at annotations because I was looking at _MarkerTypeAlloc.
In annotations it doesn't seem to allocate a marker type correctly -- it initializes the global to 0, then checks for it to be <0.
In several other *.e files I see the same pattern -- sometimes the global is set to -1, and sometimes to 0.
Sometimes the test is for < 0, and sometimes for <= 0.

Yet, the markers for annotations seems to work -- so whats the deal here?

 static int noteMarkerType = 0; 
 static void reset_annotations () {
 if (noteMarkerType)
 {
   _LineMarkerRemoveAllType(noteMarkerType);
 } 


 static void setupMarkers () {
  annotationPic = find_index('_edannotation.ico', PICTURE_TYPE);
  if (noteMarkerType < 0) {
   noteMarkerType = _MarkerTypeAlloc();
   _MarkerTypeSetFlags(noteMarkerType, 0);
  } else {
   _PicSetOrder(orphanedAnnotationPic, VSPIC_ORDER_ANNOTATION, 0);
  } 

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4892
  • Hero Points: 397
Re: Code Annotations: Project and Workspace
« Reply #1 on: July 27, 2016, 01:18:07 am »
Code is wrong.

Try the attached annontation.e

I don't know if you'll need to cleanup any existing annotations.

jporkkahtc

  • Senior Community Member
  • Posts: 1825
  • Hero Points: 177
  • Text
Re: Code Annotations: Project and Workspace
« Reply #2 on: July 27, 2016, 05:42:03 pm »
That looks like it fixes the stream markers, but doesn't address the annotation file problems.


These worked in V20.
Looks like in V20 the workspace.sca would start out empty as well -- so the problem is that it doesn't allow creating annotations in anything but personal.sca


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4892
  • Hero Points: 397
Re: Code Annotations: Project and Workspace
« Reply #3 on: July 27, 2016, 06:18:16 pm »
I'm not able to reproduce this problem. The v21 macro code is identical to v20 (annotations.e).

Here's what I did with v21:

vs +new -sc <new-config-dir>
open the sample java project
display the annotations tool window
Click on the New annotation button
I can add workspace and project annotations.
Both seem to work even if I exit the editor and/or switch projects.

Maybe I'm not using the right feature?

jporkkahtc

  • Senior Community Member
  • Posts: 1825
  • Hero Points: 177
  • Text
Re: Code Annotations: Project and Workspace
« Reply #4 on: August 24, 2016, 05:50:46 pm »
So I tried using annotations again today --- same problems.
Then I quit Slick and deleted all of my *.SCA files (really, I moved them where Slick won't find them).


I run Slick.
When I try to create an annotation it fails.


Now I can't exit Slick because I get a slick stack in annotations code each time I try.


Both stacks are attached.


jporkkahtc

  • Senior Community Member
  • Posts: 1825
  • Hero Points: 177
  • Text
Re: Code Annotations: Project and Workspace
« Reply #5 on: August 24, 2016, 06:15:48 pm »
Starting over from scratch....
I started Slick with a new config directory.
Didn't import settings from V20 either - clean slate.

Same problem with annotations ... I have only an option for Personal annotations.
Workspace / project annotations do not work.

jporkkahtc

  • Senior Community Member
  • Posts: 1825
  • Hero Points: 177
  • Text
Re: Code Annotations: Project and Workspace
« Reply #6 on: August 24, 2016, 06:18:40 pm »
I think it is "TagFileDir" in the VPW file.


My workspace is: C:\slick\beta\3\NewWorkspace.vpw

I usually use %WN and %WX
<Workspace Version="10.0" VendorName="SlickEdit" TagFileDir="\temp\tagfiles\%WN\%WX">

But, I found even using:
<Workspace Version="10.0" VendorName="SlickEdit" TagFileDir="\temp\tagfiles\">

makes workspace and project annotations not work.


Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2780
  • Hero Points: 421
Re: Code Annotations: Project and Workspace
« Reply #7 on: August 25, 2016, 12:02:41 am »
I'll look into this.  Looking over the code, I see some problems with if you have a workspace with spaces, though it has nothing to do with the TagFileDir.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2780
  • Hero Points: 421
Re: Code Annotations: Project and Workspace
« Reply #8 on: August 26, 2016, 01:23:18 am »
Another note on annotations.  Project and Workspace annotations are only available for files that are in your project or workspace.  So, if you current file isn't in the current project or workspace, then they are not available.

For beta4, I'm relaxing that slightly so that any file that is under the same directory as the project or workspace can have project or workspace annotations, respectively.