Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use TextDocumentChangeRegistrationOptions for didChange registration #73462

Merged
merged 1 commit into from
May 15, 2024

Conversation

ryzngard
Copy link
Contributor

@ryzngard ryzngard commented May 14, 2024

When dynamically registering for razor, the didChange was registered incorrectly. This changes to make sure the change exist and uses incremental, which is what xaml registers as

Confirmed didchange LSP event in the LSP logs

[Trace - 6:13:47 PM] Sending notification 'textDocument/didChange'.
Params: {
    "textDocument": {
        "uri": "file:///s:/BlazorServer/Pages/Counter.razor",
        "version": 2
    },
    "contentChanges": [
        {
            "range": {
                "start": {
                    "line": 16,
                    "character": 24
                },
                "end": {
                    "line": 16,
                    "character": 25
                }
            },
            "rangeLength": 1,
            "text": ""
        }
    ]
}

@ryzngard ryzngard requested a review from a team as a code owner May 14, 2024 01:20
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 14, 2024
@ryzngard ryzngard requested a review from dibarbet May 14, 2024 01:21
@ryzngard
Copy link
Contributor Author

Thanks @dibarbet for helping me track down this issue :)

RegisterOptions = new TextDocumentChangeRegistrationOptions()
{
DocumentSelector = documentFilters,
SyncKind = TextDocumentSyncKind.Incremental
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sync kind was more important here, but I went ahead and updated the documentFilter as well

@ryzngard ryzngard merged commit 86099b1 into dotnet:main May 15, 2024
25 checks passed
@ryzngard ryzngard deleted the hr_fix_didchange branch May 15, 2024 01:38
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone May 15, 2024
@Cosifne Cosifne modified the milestones: Next, 17.11 P2 May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants