Bug 476942

Summary: TypeScript ctrl+click navigation broken since typescript-language-server 4.1
Product: [Applications] kate Reporter: Karmo Rosental <karmo.rosental>
Component: partAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: lukasfriedrich
Priority: NOR    
Version First Reported In: 23.08.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Karmo Rosental 2023-11-13 14:09:31 UTC
SUMMARY
TypeScript navigation does not work with typescript-language-server 4.1 but works with typescript-language-server 4.0.

STEPS TO REPRODUCE
1. Open a valid TypeScript file that has imports or functions
2. Try to control + click into function

OBSERVED RESULT
Nothing happens, function does not get even underlined

EXPECTED RESULT
Editor navigates to clicked function

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Manjaro with latest updates
(available in About System)
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11
Comment 1 Karmo Rosental 2023-11-13 14:12:15 UTC
Looks like entire TypeScript support is broken not only navigation (type tooltips, autocomplete etc.).
Comment 2 Lukas Friedrich 2023-11-13 14:47:20 UTC
paste this in the user LSP settings to fix it manually
Update comming soon

backlink to the fix: https://invent.kde.org/utilities/kate/-/merge_requests/1349


```
{
    "servers": {
        "javascript": {
            "command": ["typescript-language-server", "--stdio"],
            "rootIndicationFileNames": ["package.json", "package-lock.json"],
            "url": "https://github.com/theia-ide/typescript-language-server",
            "highlightingModeRegex": "^JavaScript.*$",
            "documentLanguageId": true
        }
    }
}

```
Comment 3 Christoph Cullmann 2023-11-13 16:56:32 UTC
Git commit eea11763fef25b7ce2d998c88e084226357557e4 by Christoph Cullmann, on behalf of Lukas Friedrich.
Committed on 13/11/2023 at 17:56.
Pushed by cullmann into branch 'master'.

Newest version of the Typescript/Javascript LSP needs the LanguageID set

GH Issue https://github.com/typescript-language-server/typescript-language-server/issues/794

setting it to true seems to fix it

```
That's likely because your client (Emacs, etc) sends incorrect language ID for those files.

These are the language IDs that should be set for each file type:
js - javascript
ts - typescript
jsx - javascriptreact
tsx - typescriptreact

Previous version of the server was less strict but that likely caused hard to spot issues at a later point.

If you look at the textDocument/didOpen request then you'll see what languageId is being passed.
```

M  +1    -1    addons/lspclient/settings.json

https://invent.kde.org/utilities/kate/-/commit/eea11763fef25b7ce2d998c88e084226357557e4
Comment 4 Christoph Cullmann 2023-11-13 16:56:40 UTC
Git commit eea11763fef25b7ce2d998c88e084226357557e4 by Christoph Cullmann, on behalf of Lukas Friedrich.
Committed on 13/11/2023 at 17:56.
Pushed by cullmann into branch 'master'.

Newest version of the Typescript/Javascript LSP needs the LanguageID set

GH Issue https://github.com/typescript-language-server/typescript-language-server/issues/794

setting it to true seems to fix it

```
That's likely because your client (Emacs, etc) sends incorrect language ID for those files.

These are the language IDs that should be set for each file type:
js - javascript
ts - typescript
jsx - javascriptreact
tsx - typescriptreact

Previous version of the server was less strict but that likely caused hard to spot issues at a later point.

If you look at the textDocument/didOpen request then you'll see what languageId is being passed.
```

M  +1    -1    addons/lspclient/settings.json

https://invent.kde.org/utilities/kate/-/commit/eea11763fef25b7ce2d998c88e084226357557e4