Skip to content

Support SQL Keyword Formatting Inside C# String Literals #9369

@Tamil03krishna

Description

@Tamil03krishna

When writing SQL queries inside C# string literals (especially verbatim strings and raw string literals), it would be helpful if Visual Studio Code and C# tooling could recognize SQL content and provide:

  • SQL syntax highlighting
  • SQL IntelliSense
  • Automatic SQL formatting
  • SQL keyword capitalization (SELECT, FROM, WHERE, JOIN, etc.)
  • Validation of SQL syntax inside strings

Example:

var query = """
select *
from employee
where id = 1
""";

Expected behavior:

The editor recognizes the content as SQL and optionally formats it as:

SELECT *
FROM employee
WHERE id = 1;

This would significantly improve readability and productivity for developers who frequently embed SQL queries in C# applications.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions