atom-language-idris icon indicating copy to clipboard operation
atom-language-idris copied to clipboard

Add Semantic Highlighting to the TextEditor

Open archaeron opened this issue 10 years ago • 5 comments

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

archaeron avatar May 23 '15 15:05 archaeron

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 avatar May 26 '15 21:05 david-christiansen

@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 :)

archaeron avatar May 28 '15 21:05 archaeron

@david-christiansen have you seen this? :)

https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide

archaeron avatar May 18 '20 19:05 archaeron

It seems they've finally settled on an API, which is good! I'm happy to see more editors get good features.

david-christiansen avatar May 18 '20 21:05 david-christiansen

the bad part is that it's VS Code and not yet Atom :(

but Atom might follow :)

archaeron avatar May 19 '20 08:05 archaeron