Bug 480025 - cjs, cts, mjs, mts file extensions are ignored by LSP
Summary: cjs, cts, mjs, mts file extensions are ignored by LSP
Status: RESOLVED WAITINGFORINFO
Alias: None
Product: kate
Classification: Applications
Component: part (show other bugs)
Version: 23.08.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-19 00:32 UTC by Karmo Rosental
Modified: 2024-04-20 18:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.