-
Notifications
You must be signed in to change notification settings - Fork 780
fix(2426): goToDefinition for pattern ambient module no longer goes to implementation #2429
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
base: main
Are you sure you want to change the base?
Conversation
| targetRange := lsproto.Range{ | ||
| Start: lsproto.Position{ | ||
| Line: 0, | ||
| Character: 0, | ||
| }, | ||
| End: lsproto.Position{ | ||
| Line: 0, | ||
| Character: 0, | ||
| }, | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To minimize some of the diffs, can you do something like this?
l.converters.ToLSPRange(reference.file, reference.file.Loc)
(not sure if file might be nil though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DanielRosenwasser thanks for the feedback. The file can be nil., even if it exists, this case is handled using a range with zero positions
if the file is used for the range, the selection will look like this
-// [||] export class Foo {}
+// [| export class Foo {}|]
Several differences in this PR are due to handling whitespace at the start of the file, for example
Before
// [||]export class Foo {}
After
//[||] export class Foo {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several differences in this PR are due to handling whitespace at the start of the file, for example
In that case, createLspRangeFromNode or createLspRangeFromRange should take care of those differences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These diffs are related to missing chompLeadingSpace from the test parser. I’m not sure whether this behavior should be preserved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple of failing formatting tests, but they’re all in gen folder, which shouldn’t be modified directly. We probably need to regenerate the tests for these cases. For example, Strada behaviour for some of them,
this test has 4 spaces after ///
https://github.com/microsoft/TypeScript/blob/f3770c9b89ba7969b163c5cea7805d5df23b2086/tests/cases/fourslash/semicolonFormattingInsideAStringLiteral.ts#L3
but the behavior is validated with 3 spaces
https://github.com/microsoft/TypeScript/blob/f3770c9b89ba7969b163c5cea7805d5df23b2086/tests/cases/fourslash/semicolonFormattingInsideAStringLiteral.ts#L9
Anyway, the remaining question is whether we should proceed with or without the chompLeadingSpace helper.
Fixes #2426