inkytonik / cooma

The Cooma project is investigating secure programming language design based on fine-grained object capabilities.
Mozilla Public License 2.0
3 stars 2 forks source link

Fix argument hover #17

Closed inkytonik closed 3 years ago

inkytonik commented 3 years ago

I think it doesn't get highlighted nicely like val, def etc. Probably because it doesn't have a keyword in front of it.

Same presumably happens for fields.

Not clear how to fix this. Generating a markdown block that uses the cooma language name as in

```cooma
Foo
```

doesn't seem to change anything. The def and val ones still work but the argument one just gets "cooma" stuck in front of it.

It seems that we can use MarkedStrings instead of a single String. Marked strings are like language-tagged code blocks see Hover from LSP4J. We can apparently build one from a list of strings or marked strings. It's not clear how best to incorporate this into Kiama, since the current version just returns a single Markdown string. And will it even work when I do it since the ```cooma thing doesn't work.

inkytonik commented 3 years ago

Fixed by 9426c165bc0c97ce9f30bd3802439db93c522a2b

For posterity: it turned out that the bug in some of the Markdown formatting was because we needed a newline at the end of the string.