core icon indicating copy to clipboard operation
core copied to clipboard

inconsistent syntax highlighting in table examples

Open 0pcom opened this issue 9 months ago • 7 comments

Describe the bug

https://www.cogentcore.org/core/table

Image

Image

Image

Just providing some feedback. I did not see an issue ticket referring to this already.

How to reproduce

view https://www.cogentcore.org/core/table

Example code


Relevant output


Platform

Web

0pcom avatar Mar 25 '25 17:03 0pcom

I note also that core.NewTable...SetReadOnly(true) does not set boolean table fields as read only.

It's still possible to toggle the state of the boolean table field with SetReadOnly(true)

0pcom avatar Mar 25 '25 17:03 0pcom

On further inspection, I believe the syntax highlighting was intentionally done that way for SetReadOnly in the docs

0pcom avatar Mar 25 '25 23:03 0pcom

@0pcom Thank you for filing this issue. That syntax highlighting is indeed incorrect and is a bug in our parser and the way it handles chained functions. We will probably be switching our parsing logic when we implement LSP in Cogent Code (https://github.com/cogentcore/cogent/issues/305), which we will hopefully have more time for soon. I will keep this issue open as it is an issue with Cogent Core.

The read only bool fields issue is #677; I thought I had fixed most of the problems with that, but I can fix the switch logic now.

kkoreilly avatar Mar 27 '25 11:03 kkoreilly

I fixed the read only bool fields issue in #1495.

kkoreilly avatar Mar 28 '25 11:03 kkoreilly

That syntax highlighting is indeed incorrect and is a bug in our parser and the way it handles chained functions.

oh, my mistake, I thought it was intentional right there because of the SetReadOnly to indicate that basically the data there was not going to change from the user input.

as a follow-up question, is it possible or will it be possible to put widgets in a table?

0pcom avatar Apr 03 '25 19:04 0pcom

Yes, it is possible to put widgets in a table. See my response here: https://github.com/cogentcore/core/discussions/1494#discussioncomment-12727294. Please let me know if you have any further questions.

kkoreilly avatar Apr 04 '25 19:04 kkoreilly