netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

[TS] Automatic closing bracket is missing, when inserting opening bracket

Open Chris2011 opened this issue 1 year ago • 3 comments

Description

When I type "export class Test {" and hitting enter, the editor sets the cursor into the correct position but without adding an automatic closing bracket as for JS or other languages.

Use case/motivation

For the first thing I would suggest to do the same as for JS and later on, we can add an option to hit { and it automatically adds a closing bracket as for ( in js. So this should work for normal, array diamond (in the right context) and block brackets.

Related issues

No response

Are you willing to submit a pull request?

Yes

Chris2011 avatar Sep 24 '24 20:09 Chris2011

This is the behavior of the LSP module. Needs to be checked if it is even possible to configure the typescript LSP, so that it conforms to NB default behavior.

matthiasblaesing avatar Sep 25 '24 20:09 matthiasblaesing

Yes I thought so too. I think it is not possible to get everything 100% from the LSP so we need to interop with it and extends the stuff. But I dunno yet. I thought I will just add this w/o touching LSP.

Chris2011 avatar Sep 25 '24 20:09 Chris2011

Atm I'm at the vuejs.de conf and I've been watching a talk from an JetBrains Advocate about volar. And he gave this insights about how they handle the LSP. Here specifically about vue but afaik for TypeScript, they also can merge things coming from the LSP and adding IDE stuff to it.

photo_5199712448100297433_y

So I mean it is like TS has couple of hints and if there are hints missing, we need to add them by our own. So maybe there needs to be a proxy in NetBeans, which take the stuff from the LSP and mix them up with NB stuff. Just an IDEA !1111!!!!!11

Chris2011 avatar Oct 08 '24 21:10 Chris2011