crystal-lang-tools / vscode-crystal-lang

Yet another VSCode extension for Crystal Programming Language
https://marketplace.visualstudio.com/items?itemName=crystal-lang-tools.crystal-lang
MIT License
275 stars 57 forks source link

Extension updates #168

Closed devnote-dev closed 5 months ago

devnote-dev commented 1 year ago

This PR provides mostly a rewrite of the existing files from the original code (based off the Ruby implementation) to updated TypeScript code, which has notable performance improvements and general better handling of features in the extension (for example, using the compiler). Things like completion and the symbols provider are still a work in progress and may not always work.

nobodywasishere commented 1 year ago

Does this PR remove LSP functionality?

Also, this appears to remove tasks. Can those be reimplemented?

devnote-dev commented 1 year ago

The option for configuring language servers was removed as it wasn't clear if it worked, there were mixed responses from people in the Discord server.

Tasks were removed due to the amount of unnecessary complexity that was going on in that file, I wasn't willing to rewrite it at the time, especially when there is very little benefit. I'd be willing to add it back in a future PR as this one will cause more merge conflicts.

nobodywasishere commented 1 year ago

The option for configuring language servers was removed as it wasn't clear if it worked, there were mixed responses from people in the Discord server.

Alright. We can try adding this back in a future PR.

Tasks were removed due to the amount of unnecessary complexity that was going on in that file, I wasn't willing to rewrite it at the time, especially when there is very little benefit. I'd be willing to add it back in a future PR as this one will cause more merge conflicts.

That works for me. My only concern was in breaking things that people use. You don't have to be the one to implement it, but you're welcome to if you want.

devnote-dev commented 1 year ago

In terms of actual functionality, nothing should be broken – if anything, the extension should be more performant, especially when it comes to hover capabilities. My only concern is actually testing the extension right now, because some dependencies were updated and I can no longer get it running.

nobodywasishere commented 1 year ago

Apologies for that. What are the errors you're running into?

devnote-dev commented 1 year ago

The extension launches in debug mode but after opening the window the debugger stops and I get this message:

image

nobodywasishere commented 1 year ago

Looking at this with my computer now, it looks like hovering isn't working correctly, at least for me. For some reason spawnContextTool() is returning the response of getCompilerPath(), instead of continuing past it.

image

It appears it's also happening with format too.

devnote-dev commented 1 year ago

I'll mark this PR as a draft until I can get vscode to work again and debug the situation.

tlkh40 commented 1 year ago

@nobodywasishere I have made some changes, can you try it out again? format and hover seem to be working again for me

nobodywasishere commented 1 year ago

Format seems to work now. Trying out hover it doesn't show anything when hovering anything (not sure where it's supposed to be), though when hovering in a spec file it shows an import error:

image

Also, there was an error popping up in symbols.ts that I fixed with this patch (basically just checks if matches is null before checking the length):

https://hastebin.com/share/anahehecir.kotlin

Did you see the comments I left in the review?