no-stack-dub-sack / apexdox-vs-code

A lightweight VS Code extension that makes documenting your Salesforce Apex files an easy, integrated experience.
Other
49 stars 7 forks source link

fix: source links post-recursive file discovery update #74

Closed no-stack-dub-sack closed 1 year ago

no-stack-dub-sack commented 1 year ago

@dschach This was actually a lot more involved than I thought it would be but I think I've got it working. I've published a pre-release version here. Can you please install the VSIX directly and confirm it works against your projects? This is probably more effective than the test suite at this point.

You may have to adjust your sourceUrl in your config, as the implementation captures the relative path (everything after ${workspaceFolder} in your path). So if your path is ${workspaceFolder}/src/classes examples of relative paths for files would be src/classes/Foo.cls and src/classes/test/FooTest.cls. In this case, you'd want your sourceUrl to be the top-level dir in your repo, e.g. https://github.com/no-stack-dub-sack/apexdox-vs-code/tree/master/.

Note that this implementation requires that users use the ${workspaceFolder} variable, as parsing that out is the only way I have to get the relative path unless it is specifically provided by the user. I would need to update the docs to reflect this when this gets released.

Because of this change and the fact that users may need to change their sourceUrl configs, not sure if I should consider this a breaking change or not...

Please let me know when you get around to testing this out and if it works for you.

Thanks @dschach.

closes #73

no-stack-dub-sack commented 1 year ago

@dschach, in response to this comment:

Ahhh, check out my full comment above in the PR description, try adjusting your sourceUrl config to https://github.com/SalesforceLabs/ActionPlansV4/blob/main/ and try again? I believe this should get us a lot closer if not do the trick.

dschach commented 1 year ago

@no-stack-dub-sack Yes! It works! All I did was to make that sourceUrl change, and it found the classes in the top and sub-folders correctly.

It also works in another project with MANY subfolders. I just set the sourceUrl to <repo>/blob/main and it was great.

Looks like this has been fixed! Ready for prime-time, I'd say.

dschach commented 1 year ago

Also, sadly, this would be a breaking change. :(

I say this because some users may have classes now included that should not be included, as well as some other reasons... but as I've learned, if you have one reason for something to be a breaking change, no other reasons matter.

no-stack-dub-sack commented 1 year ago

Also, sadly, this would be a breaking change. :(

I say this because some users may have classes now included that should not be included, as well as some other reasons... but as I've learned, if you have one reason for something to be a breaking change, no other reasons matter.

That's a good point, I didn't even think about that this change could include classes that were previously not included. So technically the last release should have been a major release but I released it as minor.

I'll update the docs about the source url change and prep a 2.0 release I suppose.

Thanks for confirming it works!