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

#6: Improves grammar #7

Merged
merged 9 commits into from
May 26, 2015
Merged

#6: Improves grammar #7

merged 9 commits into from
May 26, 2015

Conversation

taylon
Copy link
Contributor

@taylon taylon commented May 23, 2015

Hey @benjohnson @jpells @zacharytamas here is the first pull request for #6

It greatly improves the grammar:

  • It doesn't break keyword arguments highlighting anymore
  • "." are not highlighted anymore, to keep consistency with the python grammar
  • Model fields, shortcut functions and settings were updated to sync with Django 1.8
  • Added scripts to extract settings variables and shortcut functions from the Django source code, it will make it easier to update this package when new versions of Django are released.
  • Scope names were updated to be consistent with other packages and scope naming conventions (http://manual.macromates.com/en/language_grammars#language_rules)
  • Added highlighting for Form Fields

I also added keywords to the package.json file to improve package discovery (http://blog.atom.io/2015/03/30/keywords-on-atom-io.html)

Let me know if you guys have any suggestions to further improve this =D

@@ -0,0 +1 @@
DJANGO_PATH = 'ENV/lib/python3.4/site-packages/django/'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm rusty on how Atom plugins are written, but is it not a concern being hardcoded to a certain Python version here?

@taylon
Copy link
Contributor Author

taylon commented May 26, 2015

Hey @zacharytamas

These scripts will never be executed or used by atom. The idea is to use them to update Django settings and shortcuts functions in the grammar when a new version comes out. They may not even be effective actually but I included them since I wrote it anyway to extract that from the source code.

Basically you would run the script, and it would generate something like this:

AutoField|BigIntegerField|BinaryField|BooleanField|CharField|CommaSeparatedIntegerField

Then you copy it into the grammar file.

@zacharytamas
Copy link
Owner

Ah okay. I thought maybe you were training Atom to introspect settings.py files in project folders and learn their variables for highlighting/autocomplete purposes.

zacharytamas added a commit that referenced this pull request May 26, 2015
@zacharytamas zacharytamas merged commit 439f346 into zacharytamas:master May 26, 2015
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.

2 participants