Bug 480025

Summary: cjs, cts, mjs, mts file extensions are ignored by LSP
Product: [Applications] kate Reporter: Karmo Rosental <karmo.rosental>
Component: partAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED WAITINGFORINFO    
Severity: normal CC: christoph
Priority: NOR    
Version First Reported In: 23.08.4   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Karmo Rosental 2024-01-19 00:32:45 UTC
SUMMARY

cjs, cts, mjs, mts file extensions are ignored by LSP (no ctrl + click & no typecheck).

They were not ignored until bug #476942 appeared. After bugfix for #476942 js, jsx, ts & tsx files are working again but not cjs, cts, mjs, mts. I'm using default LSP config.

STEPS TO REPRODUCE
1. Have project with valid cjs, cts, mjs or mts file
2. Open it with Kate

OBSERVED RESULT
There is only syntax highlighting. No ctrl + click and no typecheck (for cts, mts).

EXPECTED RESULT
cjs, mjs should be loaded like js and cts, mts loaded like ts.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Manjaro with latest updates
(available in About System)
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.113.0
Qt Version: 5.15.12
Comment 1 Karmo Rosental 2024-01-19 12:52:25 UTC
typescript-language-server is 4.3.

On another laptop I have locked typescript-language-server at 4.0 and problem does not occur. Since TSLS 4.1 issues started to happen.
Comment 2 Karmo Rosental 2024-01-24 21:09:57 UTC
{
    "servers": {
        "typescript": {
            "use": "javascript",
            "highlightingModeRegex": "^TypeScript.*$",
            "documentLanguageId": true
        }
    }
}

Fix is to use this LSP server override to enable support for more TypeScript file extensions but then almost everything is underlined in React TypeScript (.tsx) files.
Comment 3 Christoph Cullmann 2024-04-20 18:56:59 UTC
Hmm, in current master the extensions 

cjs, mjs should be loaded like js and cts, mts loaded like ts.

should be fixed.