-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Add source mappings for serialized properties with available declaration #60005
base: main
Are you sure you want to change the base?
Conversation
const folder = this.getRealFolder(base); | ||
// this line can throw on purpose, don't use Debug.assert to avoid redundant debugger hits | ||
// eslint-disable-next-line no-restricted-syntax | ||
if (folder === null || folder === undefined) { | ||
throw new Error(`Directory not found: ${base}`); | ||
} |
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.
Do you mind sending this as a separate change; I've been wanting to do this for a while so would be nice to get in regardless of the status of this PR.
No need to leave the comment, and I suspect that a plain truthiness check is fine too.
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.
@@ -985,6 +985,7 @@ import { | |||
setNodeFlags, | |||
setOriginalNode, | |||
setParent, | |||
setSourceMapRange, |
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.
I feel like it's suspicious that the checker did not already import this but presumably gets things right for other nodes...
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.
Heh, ye - definitely. I was quite surprised that this was the first time this had to be imported here.
Usually, this gets called by transforms but this case is different than that use case. There might also be other issues like this one. In general, declaration maps bugs are less likely to be reported than typechecking bugs etc so 🤷
openFilesForSession([mainTs], session); | ||
session.executeCommandSeq<ts.server.protocol.DefinitionAndBoundSpanRequest>({ | ||
command: ts.server.protocol.CommandTypes.DefinitionAndBoundSpan, | ||
arguments: { file: mainTs.path, line: 3, offset: "caller.foo".length - 2 }, |
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.
Pls use protocolFileLocationFromSubstring
to get line and offset
fixes #60004