Closed NullVoxPopuli closed 2 years ago
You need filetype to be something like typescriptglimmer
Or use g:coc_filetype_map
You need filetype to be something like
typescriptglimmer
why? what's the difference? (other than the missing dot) and why does it have an effect?
g:coc_filetype_map
I couldn't find any examples how this is used -- do you have examples?
:h g:coc_filetype_map
I added
let g:coc_filetype_map = {
\ 'typescript.glimmer': '',
\ }
to my init.vim, and confirmed it's set with :echo g:coc_filetype_map
however, tsserver is still starting up on typescript.glimmer
files
Empty string not work since it considered as false value.
gotchya.
setting to
let g:coc_filetype_map = {
\ 'typescript.glimmer': 'glint',
\ }
appears to do the trick! thanks!
next up -- coc-glint!
oh, is there a way a language server plugin can provide a config like this so users don't have to configure their coc_filetype_map
?
No, main filetype from filetype with dot is considered as languageId, it should have a different language id.
oh :thinking: are there docs somewhere on filetype formats?
:h 'filetype'
nothing else.
kind of overwhelming amount of text in there that mostly seems unrelated :sweat_smile:
the words "language" and "Id" do not appear in this document :upside_down_face:
My overall problem is that I want to have multiple buffers open, containing files with extensions
ts
andgts
, wherets
- should have coc-tsserver enabled --filetype
is:typescript
gts
- should not have coc-tsserver enabled --filetype
is:typescript.glimmer
<- this is a custom syntax I'm helping with, and because tsserver doesn't allow syntax plugins, I gotta do some custom stuff (like what Vue and Svelte do), so I need tsserver turned off for this file type.I tried doing this within vim
but active/deactivate extension applies to the whole vim instance and is not per-buffer.
I'm going to poke around the code here to see if I can find anything obvious to help out, because the behavior for vue and svelte is what I want -- just need to figure out how (custom language server -- which already exsits -- just need to disable tsserver)