typed-ember / glint

TypeScript powered tooling for Glimmer templates
https://typed-ember.gitbook.io/glint
MIT License
109 stars 51 forks source link

Add JS/TS code folding support to language server #632

Open camerondubas opened 11 months ago

camerondubas commented 11 months ago

Part of https://github.com/typed-ember/glint/issues/626

This adds support for code folding in js & ts files. This implementation is based on tsserver's. This does not add support for gts/gjs files.

Folding seems to work as expected, but two odd things had to be handled:

Any guidance on better ways to handle either of these would be appreciated!

https://github.com/camerondubas/glint/assets/6216460/b132d090-5ebb-46bb-bd65-1dd1113d9465

dfreeman commented 11 months ago

Thank you @camerondubas!

I just wanted to say this hasn't been forgotten about; you've asked some good questions about the implementation that I'm expecting will take a little time to investigate, and I haven't had a lot of uninterrupted time this week. I'm aiming to give a more thorough look early next week, but please ping me if you don't hear anything—I want to make sure this doesn't sit idle too long!

camerondubas commented 10 months ago

@dfreeman I updated this with the latest main. Friendly bump to take a look at this when you have some time. No rush though, life's busy! Cheers

lifeart commented 9 months ago

Here is template part if needed: https://github.com/lifeart/ember-language-server/blob/component-context-info-origin/src/folding-provider/template-folding-provider.ts, quite easy to implement.

NullVoxPopuli commented 5 months ago

@camerondubas any chance you want to rebase? <3

NullVoxPopuli commented 5 months ago

looks like a floating dep dropped node 16, breaking our ci.

I'd consider this non-blocking for merge, myself, and fixing the floating dep issue can happen in a different PR