c3lang / editor-plugins

Editor plugins for C3
MIT License
42 stars 20 forks source link

vscode c3 #23

Closed carlosvneves closed 3 months ago

carlosvneves commented 3 months ago

This PR proposes some improvements in the C3 syntax highlighting in the VS Code extension. The main adjustments include:

  1. Function and Method Calls:

    • Added distinct highlighting for function calls (e.g., malloc(), free())
    • Improved method call highlighting (e.g., object.method())
  2. Variable and Struct Member Access:

    • Enhanced differentiation between variables and struct members
    • Ensured proper highlighting for patterns like self.member
  3. Contract Comments:

    • Added special highlighting for contract comments (/** */)
    • Distinct colors for contract keywords (@require, @ensure, @param)
    • Highlighting for contract-specific constructs ([in], [out], $function)
  4. General Improvements:

    • Refined keyword recognition
    • Enhanced type and identifier highlighting
    • Improved README, LICENSE, publishing informations
  5. Code snippets

    • Few code snippets

Testing:

Limitations and futures improvements:

Feedback on the new highlighting scheme is welcome.

lerno commented 3 months ago

This seems to erase all the other editor plugins??

carlosvneves commented 3 months ago

This seems to erase all the other editor plugins??

Hmmm... I will check that out. Because it shouldn't. Thank you.

lerno commented 3 months ago

A few things I wondered about:

  1. It deletes EVERY other editor highlighting
  2. It introduces highlighting for the Euphoria language (why?)
  3. It contains MIT code from a lot of different authors, ok, this is fine in theory, but with everything looking like copy-paste I am worried that this is not a tightly added set of changes to the old highlighting.
  4. There are notes in the readme of versions 0.0.1 to 0.0.3, but this is the first readme?
  5. The updated examples to not conform to the coding standard of other C3 examples.
  6. The added examples have comments that are not in English
  7. There is a .DS_Store in the commit
  8. Why is there a louis-c3 as well as the regular c3.tmLanguage?
carlosvneves commented 3 months ago
  1. I made a mess with my local repo. I am sorry;
  2. I used Euphoria as one of my examples (it was in my local repo), but I erased it;
  3. I started with the old highlighting and built upon it. I even started another from scratch. If you see all the commits of my repo, I tested many things until get to the “final” code, as I was learning about the grammar and plugin thing (I am not experienced at all). I had another repo to test the changes and the copy and paste came mainly from that;
  4. Is the first read me for the vscode plugin. But I understood it was the version following the 0.0.2 plugin version;
  5. The example.c3 is the same that was already in the repo. I read the documentation and tested against the standard lib and another project that I am developing;
  6. I will fix that (I am not native English speaker and the comments were only for me);
  7. The ._DStore was another mistake in the repo
  8. louisc3 was one of the files that I took as a reference. But in the final push, I erased that (but stayed in the history)

I think the main problem is that I mixed the tests I made in my local repo with the code I submitted to the remote. Maybe is better to erase the PR.

If you think it is ok, I will fix that and open another PR.

And if you have another comments or suggestions, please let me know. As a beginner, I am still learning how things work and I will take care that it will not happen again.

Thanks for your attention.