Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add a lookahead for DELETE to avoid mistaking HTTP strings for SQL #315

Merged
merged 3 commits into from
Jan 27, 2021
Merged

Add a lookahead for DELETE to avoid mistaking HTTP strings for SQL #315

merged 3 commits into from
Jan 27, 2021

Conversation

illright
Copy link
Contributor

Description of the Change

Currently, the uppercase DELETE is a trigger to initiate coloring for embedded SQL. That comes into conflict with the HTTP request descriptions, where DELETE is one of the allowed methods.

So an API-describing string like:

"""
GET /endpoint
POST /endpoint
DELETE /endpoint
PATCH /endpoint
"""

starts getting wrong highlighting starting from the DELETE keyword.
image

This PR aims to cover this particular case of the occurence of DELETE in a string.

Benefits

API descriptions in Python strings will look more appealing, and provided that servers are frequently written in Python, this is a considerable use case.

Possible Drawbacks

Looks a little hacky.

@calebmeyer
Copy link

Thanks for your submission!

We require automated tests for all pull requests that include new or changed code. We do this so that we can ensure that we don't accidentally break your shiny new code the next time we or some other contributor submits a change. If you need help writing automated tests for Atom, check out Discuss, the official Atom and Electron message board or join the Atom Slack team. There are a bunch of helpful community members that should be willing to point you in the right direction.

@illright
Copy link
Contributor Author

illright commented Dec 6, 2020

@calebmeyer Could you please take a look at the latest failing build? I don't think it's failing because of my changes

@darangi
Copy link
Contributor

darangi commented Jan 27, 2021

Thanks @illright for your contribution,

The failure isn't related to your change, this is a problem with Travis service.

@darangi darangi merged commit 2ba8196 into atom:master Jan 27, 2021
@illright illright deleted the fix/mistaken-sql branch January 28, 2021 11:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants