Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add odin mode #5169

Merged
merged 5 commits into from May 17, 2023
Merged

feat: add odin mode #5169

merged 5 commits into from May 17, 2023

Conversation

laytan
Copy link
Contributor

@laytan laytan commented May 12, 2023

Issue #, if available: N/A

Description of changes: Added a basic mode for Odin

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@akoreman
Copy link
Contributor

akoreman commented May 13, 2023

Thanks for your contribution, could you also add an example doc for the mode to the demo/kitchen-sink/docs folder and add it to the modelist in src/ext/modelist.js. For reference on what to add where, see PR #5037.

@laytan
Copy link
Contributor Author

laytan commented May 13, 2023

@akoreman I have added the things you asked :)

@codecov
Copy link

codecov bot commented May 13, 2023

Codecov Report

Patch coverage: 97.64% and project coverage change: +0.01 🎉

Comparison is base (64c7758) 86.96% compared to head (43cc628) 86.98%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5169      +/-   ##
==========================================
+ Coverage   86.96%   86.98%   +0.01%     
==========================================
  Files         562      565       +3     
  Lines       45016    45103      +87     
  Branches     6922     6931       +9     
==========================================
+ Hits        39147    39231      +84     
- Misses       5869     5872       +3     
Flag Coverage Δ
unittests 86.98% <97.64%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/mode/odin_test.js 96.55% <96.55%> (ø)
src/mode/odin.js 96.77% <96.77%> (ø)
src/mode/odin_highlight_rules.js 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@akoreman
Copy link
Contributor

Thanks :) I've been comparing your mode with the syntax highlighting found in the Odin docs examples and it seems to match that pretty well.

One small quirk I noticed was highlighting for names which start with a capital (see picture, e.g. Vector3):

Screenshot 2023-05-14 192913

I don't know enough about Odin to tell what the desired behaviour is here but could you take a look at this?

Could you also add a test covering the indent/outdent behavior (for an example of such tests, see e.g. here).

@laytan
Copy link
Contributor Author

laytan commented May 15, 2023

@akoreman I've added the tests, let me know if they are ok like this.

Also removed the uppercase === constant rule because of the issue you were having and also that it can cause false-positives anyway.

@akoreman
Copy link
Contributor

akoreman commented May 15, 2023

Thanks for adding the tests, they look good to me.

Correct me if I'm wrong, but I think you might have removed the wrong lines from the highlight file. The lines you removed are for #xyz_abc (which, afaict, are Odin directives if I read correctly). I think you meant to remove these lines?

@laytan
Copy link
Contributor Author

laytan commented May 17, 2023

@akoreman You are totally correct, my bad, I have updated it

@InspiredGuy InspiredGuy merged commit d455e9b into ajaxorg:master May 17, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants