agda-mode icon indicating copy to clipboard operation
agda-mode copied to clipboard

Syntax Highlighting

Open banacorn opened this issue 9 years ago • 6 comments

  • ~~General Syntax Highlighting~~ (by language-agda)
  • Custom Syntax Highlighting (generated dynamically by Agda per source)

banacorn avatar Feb 08 '15 04:02 banacorn

+1 How is this supposed to work? I don't have syntax highlighting after type checking on a fresh atom 1.0.0 installation with agda-mode.

ajrouvoet avatar Jun 30 '15 22:06 ajrouvoet

Please install language-agda for general syntax highlighting, I suppose this is what you are looking for : )

Syntax highlighting is usually handled by language-blahblah in Atom

banacorn avatar Jul 01 '15 02:07 banacorn

No I understood that part; sorry for not being clear. I actually wanted to know about the agda type-driven syntax highlight that requires agda to compile the source.

ajrouvoet avatar Jul 01 '15 09:07 ajrouvoet

Agda sends syntax highlighting informations every time when the file is loaded, which looks something like this:

(agda2-highlight-add-annotations '(59 65 (keyword) nil) '(66 70 (module) nil ("/Users/banacorn/agda/test/Test.agda" . 1)) '(71 76 (keyword) nil))

But currently only terminationproblem and unsolvedmeta are highlighted, and other tokens are ignored, mostly for performance concerns (okay maybe it's just because I'm too lazy XD)

I'm not sure if there's any other way (other than Markers) to do the highlighting, but recently they've optimized the markers a bit, maybe it worths trying.

banacorn avatar Jul 01 '15 12:07 banacorn

I'm not sure how it's done in Emacs, but it's not uncommon for the syntax highlight to be slightly off while editing before you compile again (e.g. a function name colored in 2 colors); so I'm not sure that emacs really does a big effort to track highlighted regions when the file changes.

ajrouvoet avatar Jul 01 '15 19:07 ajrouvoet

I believe that Emacs simply erase all highlightings and repaint them again with the annotations sent from Agda, the same can be done in Atom, too.

banacorn avatar Jul 02 '15 01:07 banacorn