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

Holding ctrl when hovering paths in text_button.dart returns a range far larger than expected #3867

Closed
DanTup opened this issue Mar 9, 2022 · 2 comments
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug
Milestone

Comments

@DanTup
Copy link
Member

DanTup commented Mar 9, 2022

Holding ctrl while hovering the path on line 57 highlights a region far larger than expected:

Screenshot 2022-03-09 at 13 57 36

@DanTup DanTup added is bug in editor Relates to code editing or language features labels Mar 9, 2022
@DanTup
Copy link
Member Author

DanTup commented Mar 9, 2022

Seems to be coming from the server like this:

"originSelectionRange": {
	"start": {
		"line": 56,
		"character": 19
	},
	"end": {
		"line": 124,
		"character": 26
	}
},

Full request/response:

==> {
	"jsonrpc": "2.0",
	"id": 96,
	"method": "textDocument/definition",
	"params": {
		"textDocument": {
			"uri": "file:///Users/danny/Dev/Google/flutter/packages/flutter/lib/src/material/text_button.dart"
		},
		"position": {
			"line": 56,
			"character": 37
		}
	}
}
<== {
	"id": 96,
	"jsonrpc": "2.0",
	"result": [
		{
			"originSelectionRange": {
				"start": {
					"line": 56,
					"character": 19
				},
				"end": {
					"line": 124,
					"character": 26
				}
			},
			"targetUri": "file:///Users/danny/Dev/Google/flutter/examples/api/lib/material/text_button/text_button.0.dart",
			"targetRange": {
				"start": {
					"line": 0,
					"character": 0
				},
				"end": {
					"line": 0,
					"character": 0
				}
			},
			"targetSelectionRange": {
				"start": {
					"line": 0,
					"character": 0
				},
				"end": {
					"line": 0,
					"character": 0
				}
			}
		}
	]
}

@DanTup DanTup added the in lsp/analysis server Something to be fixed in the Dart analysis server label Mar 9, 2022
@DanTup DanTup added this to the v3.38.0 milestone Mar 9, 2022
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Mar 9, 2022
…mple links

Fixes Dart-Code/Dart-Code#3867.

Change-Id: Icdfc93c1b03fdd4c40e3ea4563045d993cb50c32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236221
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
@DanTup
Copy link
Member Author

DanTup commented Mar 9, 2022

Fixed by dart-lang/sdk@da5670c.

@DanTup DanTup closed this as completed Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug
Projects
None yet
Development

No branches or pull requests

1 participant