bscan / PerlNavigator

Perl Language Server that includes syntax checking, perl critic, and code navigation
MIT License
198 stars 39 forks source link

Adding support for Dancer methods #84

Closed ulizama closed 1 year ago

ulizama commented 1 year ago

There is a feature that I would love for the extension to have and that is to be able to support Dancer routes and identify them as symbols like it's done with methods.

For example:

get '/vehicles' => sub {

};

Would then become symbol get 'vehicles' so it can be searched via symbol search on the file.

I'm willing to give it a try if I could get pointed in the right direction as I've never played around with VS extensions.

bscan commented 1 year ago

image

Thank you for the suggestion. I just committed an initial version, and it should be available in the marketplace now in version 0.6.1.

Adding support for new frameworks is a bit tricky because of the number of different places impacted. I added to the tagger, and then modified the locations for symbol types, hover, and completion. I also added custom syntax highlighting and generally tried to match the syntax highlighting regexes to the ones used for parsing the symbols.

Thank you for the offer to help as well. I don't use Dancer/Dancer2 in my work, so a review and testing would be extremely helpful. As you use this, I'm sure you'll come across parsing bugs, missing keywords, etc. I hope the layout makes sense if you wanted to make any changes or add any other features to the Navigator.

In terms of getting started with a testing environment, I just added additional details to the Contributing page https://github.com/bscan/PerlNavigator/blob/main/CONTRIBUTING.md Let me know if you have any issues and I'm more than happy to help out.

ulizama commented 1 year ago

Great! I looked at the commit and I see the changes you implemented, I think they are clear enough for me to follow-up on them to make some contributions if needed, at least on the Dancer side of things.

I'll try to do some testing over the weekend.

ulizama commented 1 year ago

@bscan Just requested my first PR. Let me know your thoughts or if you would like me to do anything else to get it approved.

Thanks!

bscan commented 1 year ago

Just published your updates in version 0.6.2 to the vscode marketplace and to NPM. Thanks again for the feature.