Closed Alexey-T closed 3 years ago
it can be
{
"lexers": ["HTML aa", "HTML bb", "HTML more"],
"server_lang": "html",
"cmd": ["/home/user/pathtoserver"]
}
I can do that, but for servers with multiple language ids (e.g. C,C++) you will need to create config file for each lang_id, since I am required to give lang_id of the document to server.
The other way - user adds mapping of 'lexer_name -> lang_id' somewhere; maybe a command like 'Set language id for current lexer'?
it is Ok if users need to create 2 configs.
the 2nd way is ok too
the 'mapping' lexername->langid is OK in 1 cfg file too, no?
the 'mapping' lexername->langid is OK in 1 cfg file too, no?
hm... how such a config would look like? I can't see a clear and nice way.
{
"lexers": {
"onelexer": "id1",
"twolexer": "id2"
},
//rest
}
yep... going with your format
new format
{
// supported langids
"langids": ["python"],
// map additional non-default lexers to langids
"lexers": {
"Rainbow python": "python"
},
// command to start LSP server
"cmd": ["pyls"]
}
первый ключ избыточен- можно его получить по всем значениям 'lexers' @halfbrained
Да, я сначала без первого сделал, но это:
{
"langids": ["python"],
"cmd": ["pyls"]
}
лучше этого мне кажется
{
"lexers": {
"Python": "python"
},
"cmd": ["pyls"]
}
кстати оба варианта сейчас работают... так что я могу либо написать в ридми, что 'lexers' и 'langids' взаимозаменяемы, либо убрать 'langids' из примера конфига, и упомянуть отдельно.
{
"lexers": {
"Python": "python"
},
"cmd": ["pyls"]
}
это то что надо. потому что тут мы можем указать 2-3 лексера и 2-3 языка сервера
updated readme, no related code changes
https://github.com/halfbrained/cuda_lsp/commit/9d5419af2d3b3af9bb24f19547aa338eb5b040c6
eg for HTML server users may need to set N lexers for 1 server:
HTML PHP and
so lang_ids is not needed, let user write this mapping!