Autodesk-AutoCAD / AutoLispExt

Visual Studio Code Extension for AutoCAD® AutoLISP
https://marketplace.visualstudio.com/items?itemName=Autodesk.autolispext
Apache License 2.0
83 stars 30 forks source link

DCL Auto-Completion Provider #203

Closed JD-Howard closed 1 year ago

JD-Howard commented 1 year ago

Objective

Add a highly assistive DCL Language AutoCompletionProvider with attached documentation about the suggestions.

Abstractions

This is the first meaningful use of the new DCL parser and was designed to "assist" the user in ways that create clean looking DCL. Especially necessary given the lack of a DCL formatter. When a formatter is available, this should be revisited because CompletionItems have the ability to trigger a format command and that will help handle a few rare edge cases that may currently produce odd results. With that said, using this in the context of an existing DCL that has odd formatting or excessive indentation may have different ideas about where indentation belongs. Again, this is unavoidable without a formatter. However, if someone is building a DCL from scratch, this should be extremely useful. It filters out possibilities as they are used/burned it only shows attributes that are applicable to the active tile, and won't show attributes in situations that don't make sense.

Also note, some of the outstanding comments from PR #202 were addressed here.

Tests performed

Still working on tests and this has not been tested on a Mac yet. Currently have an average of 87% code coverage.

Screen shot

https://user-images.githubusercontent.com/51800232/192707497-eeb4cc32-6cc0-4c43-b0c6-5d16d1b19999.mp4

github-actions[bot] commented 1 year ago

CLA Assistant Lite bot: Thank you for your submission, we really appreciate it. We ask that you sign our Contributor License Agreement before we can accept your contribution.

-->If you are contributing on behalf of your employer: you must fill out our Corporate Contributor License Agreement which can be found here, and send the signed forms to autolispext.contributor.agreements@autodesk.com.

-->If you are contributing on behalf of yourself: you must agree to our Individual Contributor License Agreement which can be found here, and either send the signed forms to autolispext.contributor.agreements@autodesk.com, or reply below with a comment containing the following text:


I have read the CLA Document and I hereby sign the CLA


0 out of 3 committers have signed the CLA.
:x: @Josh
:x: @JD-Howard
:x: @Sen Lin Application Admin
Josh, Sen Lin Application Admin seem not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request

JD-Howard commented 1 year ago

@Sen-real I'll write the NoAtom, HasPosition with ProximityParent tests and give it a spin on my make tomorrow. I suspect that will bring it to an average of 95% on the code coverage. The nature of this caused extensive manual testing because I can't trust VSCode will actually show the suggestions I provide it. With that said, I consider it fairly well tested even though I have outstanding unit tests to make. Give it a once over, fire it up for yourself and if you don't see any particular problems, then I would say its probably fine to include in 1.6; Certainly better than the nothing we currently have for DCL.

Sen-real commented 1 year ago

Awesome new feature, cool!

JD-Howard commented 1 year ago

I added in the English localizations. but I made a judgement call on stuff like "Tile", "Attribute" and "Enum" being too native to DCL to mask or completely universal to all programming. I have now tested what I do have on the Mac and it passed without issue. I still have 1 test to build out and will do that later tonight.

JD-Howard commented 1 year ago

The average code coverage on the DCL Completion is at 96% I'd like it better if it had a formatter to smooth out a few edge cases, but I think this is probably ready to go.

Sen-real commented 1 year ago

The average code coverage on the DCL Completion is at 96% I'd like it better if it had a formatter to smooth out a few edge cases, but I think this is probably ready to go.

Thanks! it looks pretty cool.