Skip to content

Razor format issue #12631

@goyometeojorito

Description

@goyometeojorito

is vscode with the settings:

        "editor.wordWrap": "wordWrapColumn",
        "editor.wordWrapColumn": 2000,
        "editor.defaultFormatter": "ms-dotnettools.csharp",
        "csharp.formatting.maxLineLength": 0,

this code (single line):

@await Component.InvokeAsync("ReviewAndPublishModal", new { id = "ReviewPublishModal", title = "Review and publish", text = Model.ReviewNotes, state = Model.State, allowSave = allowSaveReview, allowPublish = allowPublish, isPublished = isCurrentPublished })

format as:

@await Component.InvokeAsync("ReviewAndPublishModal", new { id = "ReviewPublishModal", title = "Review and publish",
text = Model.ReviewNotes, state = Model.State, allowSave = allowSaveReview, allowPublish = allowPublish, isPublished =
isCurrentPublished })

¿why? i remove the line limit, i ask to chatgpt for additional settings a nothing works, somebody hardcoded the max line length

if a change to:

@await Component.InvokeAsync("ReviewAndPublishModal", 
    new { 
        id = "ReviewPublishModal", 
        title = "Review and publish",
        text = Model.ReviewNotes, 
        state = Model.State, 
        allowSave = allowSaveReview, 
        allowPublish = allowPublish, 
        isPublished =isCurrentPublished     
    }
)

show the error:

Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='3222' end='3219'. (Parameter 'end')
  Code: -32000 
[object Object]

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions