Feature Request: Detect dialect inside a comment or filename
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- sql, typescript, vscode
- Domain
- developer-experience, tooling
Research direction
No files or tests are named. Start by tracing the existing sql-formatter-disable comment handling and the VS Code extension's project-wide dialect setting; clarify whether comment detection, filename detection, or both are in scope, then define tests showing that each file selects its intended dialect.
Written by the indexing model from the issue text.
Description
Describe the Feature
just like the /* sql-formatter-disable */ feature, would love to be able to specify the dialect inside a comment before the query.
Maybe something like /* sql-formatter-dialect: postgresql */ in the first line of the file.
Why do you want this feature?
Specially in vscode extension, where one project can have multiple dialects in different files but you're currently forced to choose one only for the whole project in the extension settings
Alternative
Another solution could be to identify the dialect in the filename, so myquery.snowflake.sql or even myquery.postgresql could be used to pick the correct dialect.
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 456
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 3
Contributor guide
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.
More from sql-formatter-org/sql-formatter
-
feature
Difficulty 5/5 Over a week Newbie friendliness 35/100
sql-formatter-org/sql-formatter#951 · 4 comments ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 54/100
sql-formatter-org/sql-formatter#942 · 1 comment ·
-
feature
Difficulty 3/5 1-2 days Newbie friendliness 48/100
sql-formatter-org/sql-formatter#939 · 2 comments ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
sql-formatter-org/sql-formatter#928 · 3 comments ·
-
feature
Difficulty 3/5 1-2 days Newbie friendliness 56/100
sql-formatter-org/sql-formatter#914 · 7 comments ·
All issues in sql-formatter-org/sql-formatter
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:tools bug good first issue help wanted priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
newrelic-experimental/preflight#793 · 1 comment ·
-
bug 🐞
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·