bscan / RakuNavigator

Raku language support and language server
MIT License
50 stars 3 forks source link

Syntax: Redeclaration of symbol '…'. #16

Open MARTIMM opened 1 year ago

MARTIMM commented 1 year ago

I get these messages from the syntax check while there is no duplication of the particular symbol. In this case, it trips over the line

unit class QA::Gui::InputWidget:auth<github:MARTIMM>;

It has the same problems with other modules in the same project when using unit. I've tried to rephrase this declaration

class QA::Gui::InputWidget:auth<github:MARTIMM> does QA::Gui::Frame {

having a different error

Syntax: QA::Gui::Frame is not composable, so QA::Gui::InputWidget cannot compose it

This class was declared like a class instead of a role. However, the error was still there after the change.

Note also that raku didn't have any trouble compiling the code.

rawleyfowler commented 1 year ago

I think this is caused by the LSP seeing this module already installed, so it's in scope, this makes the LSP useless for module development.

bscan commented 1 year ago

Ah, that's unfortunate. The LSP is still a work in progress, and I'd love some help if anyone is interested. Additional parsing modes for modules could make sense, or at least updates that allow this to work for modules too. I believe the overall architecture is good, and the key here is iterating on the technique for syntax checking and extracting the errors and warnings (surprisingly difficult).

rawleyfowler commented 1 year ago

I'm currently running a fork of this project that skips looking up modules, besides that it's fairly complete.

bscan commented 1 year ago

@rawleyfowler, that's great. I'd love a pull request if you're interested. I'm also more than happy to answer any questions about the project or review any code. Thanks!

rawleyfowler commented 1 year ago

@bscan I will see if I can get a better solution and I will try to PR this weekend.