atom-language-idris
atom-language-idris copied to clipboard
Add Semantic Highlighting to the TextEditor
ide-mode gives us back data on how to highlight the sourcecode: http://docs.idris-lang.org/en/latest/reference/ide-protocol.html#source-code-highlighting
this would need some sort of dynamic grammar
see discussions on how to do it: https://discuss.atom.io/t/syntax-highlighting-using-existing-tokenizer/13608 https://discuss.atom.io/t/automatically-update-to-dynamic-grammar/10181 https://discuss.atom.io/t/defining-a-language-grammar-via-code/14784/2 https://discuss.atom.io/t/dynamic-grammers/14927/3
The Emacs mode uses an API similar to this one: https://atom.io/docs/api/v0.201.0/TextEditor#instance-decorateMarker
Might want to look into that as well.
@david-christiansen I thought markers where for things like showing type information, line errors and things like that. Not to change the highlighting. But the doc is not too clear:
Represents a buffer annotation that remains logically stationary even as the buffer changes. This is used to represent cursors, folds, snippet targets, misspelled words, and anything else that needs to track a logical location in the buffer over time.
But I will look at it, thanks :)
@david-christiansen have you seen this? :)
https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide
It seems they've finally settled on an API, which is good! I'm happy to see more editors get good features.
the bad part is that it's VS Code and not yet Atom :(
but Atom might follow :)