MagicStack / MagicStack/MagicPython
Highlighting of SQL inside strings
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
Description
The stock Python package performs syntax highlighting inside strings containing SQL commands. That's rather useful, even though the implementation might need some more work. In this example:
``` python
create = 'CREATE TABLE test (id INT, name TEXT);'
insert = 'INSERT INTO test VALUES (1, "Bob")'
```
in the second line, words recognized as SQL are highlighted, but not in the first one, where "CREATE TABLE" has the same color as the non-reserved names.
(Actually, as you can see, even Github's Markdown does it, with exactly the same behavior, so perhaps something is wrong with the first line, although it does execute properly)
Do you consider this a useful addition?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Reproduce the two Python string examples in the supported editor integrations, then inspect the Python string-handling and SQL-highlighting entry points to understand why CREATE TABLE differs from INSERT. Done means SQL keywords receive consistent highlighting in both examples without breaking ordinary Python strings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sql
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100