Skip to content

[Request] Add config to key on StringSyntaxAttribute #16

@TheBrambleShark

Description

@TheBrambleShark

I find myself getting a lot of false positives in regards to strings being detected as SQL when they are not. I'm not sure how much of an undertaking this would be, but it might be nice to have an opt-in mode that only activates syntax highlighting and suggestions if the property/parameter/field is annotated with StringSyntaxAttribute.

[StringSyntax("SQL")]
public const string GetEmployeesByJobTitleQuery = """
    SELECT * FROM [dbo].[Employees]
    WHERE JobTitle = @JobTitle
    """;

This would not work for variables declared within messages, since these cannot be annotated, and I'm not sure how best to handle that scenario. One option is to have a child toggle - if we opt in to using StringSyntaxAttribute, then we can choose whether standard detection is used for local variables or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions