apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.65k stars 850 forks source link

Cannot auto indent in TypeScript files (*.ts) #7645

Closed hebrerillo closed 2 months ago

hebrerillo commented 2 months ago

Apache NetBeans version

Apache NetBeans 22

What happened

When I open TypeScript files (*.ts), the auto indentation does not work. The cursor starts at the beginning of the line.

Language / Project Type / NetBeans Component

HTML5/JS Application

How to reproduce

Just open any file with the 'ts' extension, for example "app.ts

https://github.com/user-attachments/assets/d9eeefd5-ef25-445b-a56e-88335f440c9b

Screenshot 2024-08-08 at 08 39 44 "

Did this work correctly in an earlier version?

No / Don't know

Operating System

MACOs Monterey, version 12.6.3

JDK

19.0.2

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

No

matthiasblaesing commented 2 months ago

I use the typescript integration daily, so it is not a general problem. This looks as if the typescript language server is not active. Do you have node on your path? Please provide the message.log and a sample project, that reproduces your problem.

hebrerillo commented 2 months ago

Hello @matthiasblaesing !

Yes, I have node on my path. The command "node -v" yields version v19.6.0.

I attach a sample project. But I can't find any message.log file in the project.

typescript.zip

Thank you so much!

matthiasblaesing commented 2 months ago

@hebrerillo thanks for the test project. That works for me, so we need to dig further. Could you please provide the message.log file (or the full output from the View -> IDE Log command)? I suspect, that the language server could not be started.

hebrerillo commented 2 months ago

@matthiasblaesing it is my pleasure! I love the NetBeans IDE.

I attach the IDE Log. ide_log_MACOS.txt

I have a Linux computer where the bug is also happening. I provide some info:

I also attach the IDE log and a sample project from the Linux computer ide_log_LINUX.txt typescript_LINUX.zip

hebrerillo commented 2 months ago

Hello @matthiasblaesing , I have some news

To open the projects I attached before, I used the PKG installation on Mac and the deb installation on Linux.

If the project is opened using a binary, the auto indentation in TypeScript files works! ide_log_Linux_binary.txt

matthiasblaesing commented 2 months ago

Thanks. Regrettably the message logs are inconclusive. I tested the Ubuntu 22.04 live iso, installed Amazon Corretto as JDK via the deb installer, nodejs via https://deb.nodesource.com/setup_18.x and netbeans using the deb installer, works with your sample.

Please run NetBeans with the parameter -J-Dorg.netbeans.modules.lsp.client.LSPBindings.level=FINEST. That raises the log level for the LSP integration and might reveal some more information. At least it should print something regarding LSP into the IDE log, as that is currently missing.

hebrerillo commented 2 months ago

Hello @matthiasblaesing ,

Something very very wrong just happened... The auto indentation in TypeScript now works in the installable Netbeans, both Ubuntu and MacOS.

Even if I uninstall the installable packages and install them again, the auto-indentation in TypeScript files still works.

It seems the execution of the binary Netbeans changed some global configuration on the computers that make auto-indentation work in TypeScript.

I cannot reproduce the bug anymore.

matthiasblaesing commented 2 months ago

@hebrerillo this is a cup-half-empty-full situation. As indicated I could not reproduce the issue with a clean Ubuntu image (with the deb installer), so your final finding matches the baseline. I understand, that it is frustrating not to know why it suddenly works, but without reproducability, we should be happy, that it now works.

Feel free to reopen if the issue comes up again.