Created attachment 161877 [details] settings SUMMARY I encountered an issue when configuring an LSP server for a Python-like language named "Please" in the Kate text editor. I added a new filetype with correct file extensions with python syntax highlighting. And then added a corresponding LSP server with `"highlightingModeRegex": "^Please$"`. Despite adding a new filetype for syntax highlighting and configuring the LSP client with the "highlightingModeRegex": "^Please$" entry, Kate continues to launch the Python LSP server instead of the one I configured. A good solution would be to allow LSP Client to match against file extensions directly. STEPS TO REPRODUCE 1. Add a new filetype mode with python syntax highlighting 2. Add an LSP server matching the filetype OBSERVED RESULT Python's LSP (pylsp) is launched EXPECTED RESULT Filetype's configured LSP should be launched (please_lsp_helper.sh in the screenshot) SOFTWARE/OS VERSIONS Linux/KDE Plasma: Kde neon KDE Plasma Version: 5.27.7 KDE Frameworks Version: 5.110.0 Qt Version: 5.15.10 ADDITIONAL INFORMATION (This is similar to Bug 447185, however this one is about kate running the wrong lsp)
We match atm first the hl mode, then the file mode name, I would propose we just swap that order, then it would work for this use case, too.
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1310
Git commit 35bae3d56d19118e1f710531267c03c7db177a4c by Christoph Cullmann. Committed on 26/09/2023 at 22:18. Pushed by cullmann into branch 'master'. improve language id computation prefer the mode over the highlighting to allow to use known a highlighting with existing LSP for a mode for a new language and own LSP M +9 -2 addons/lspclient/lspclientservermanager.cpp https://invent.kde.org/utilities/kate/-/commit/35bae3d56d19118e1f710531267c03c7db177a4c