feat(language-service): view template typecheck block #39974
Conversation
This patch adds a command to retrieve and display the typecheck block for a template under the user's active selection (if any), and highlights the span of the node(s) in the typecheck block that correspond to the template node under the user's active selection (if any). The typecheck block is made available via a dedicated text document provider that queries fresh typecheck block content whenever the `getTemplateTcb` command is invoked. Probably not something we want to land soon, but a useful debugging tool for folks working with TCBs. See also angular/angular#39974, which provides the language service implementations needed for this feature.
|
@ayazhafiz Yeah, we are releasing Ivy LS today. After that we would like to move on to next set of features, like view TCB. Are you available in the coming weeks to work on this? If not @atscott could help land the PR. |
Yeah, I can land this one. Just wasn't sure if this was a feature the team wanted to release. Going through the comments right now. |
This patch adds an API to retrieve the template typecheck block for a template (if any) at a file location, and a selection of the TS node in the TCB corresponding to the template node at which the request for a TCB was made (if any). Probably not something we want to land soon, but a useful debugging tool for folks working with TCBs.
|
|
||
| return { | ||
| fileName: sf.fileName, | ||
| content: sf.text, |
kyliau
Jan 21, 2021
Member
nit: Do you remember the difference between .text and .getText()? I think one is normalized (line endings etc) and the other is not, but I don't remember which is which. If we are calling getEnd() and getStart(), we should probably also call getText() here to be consistent.
nit: Do you remember the difference between .text and .getText()? I think one is normalized (line endings etc) and the other is not, but I don't remember which is which. If we are calling getEnd() and getStart(), we should probably also call getText() here to be consistent.
ayazhafiz
Jan 21, 2021
Author
Contributor
Neither is normalizing; text gets the raw text and getText (like getEnd and getStart) performs some assertions that the positions of the source file are not synthetic. Changed accordingly.
Neither is normalizing; text gets the raw text and getText (like getEnd and getStart) performs some assertions that the positions of the source file are not synthetic. Changed accordingly.
|
|
||
| return { | ||
| fileName: sf.fileName, | ||
| content: sf.getFullText(), |
kyliau
Jan 21, 2021
Member
for context, I was referring to offset bugs due to differences between .getText() and .text:
angular/packages/language-service/src/template.ts
Lines 103 to 105
in
69385f7
for context, I was referring to offset bugs due to differences between .getText() and .text:
angular/packages/language-service/src/template.ts
Lines 103 to 105 in 69385f7
ayazhafiz
Jan 21, 2021
•
Author
Contributor
🤦 you're right.
ayazhafiz
Jan 21, 2021
Author
Contributor
But possibly that comment is wrong: https://github.com/microsoft/TypeScript/blob/2f47527b99028d969ea90352a13dffc005a50a7d/src/services/services.ts#L47-L88
But possibly that comment is wrong: https://github.com/microsoft/TypeScript/blob/2f47527b99028d969ea90352a13dffc005a50a7d/src/services/services.ts#L47-L88
This patch adds a command to retrieve and display the typecheck block for a template under the user's active selection (if any), and highlights the span of the node(s) in the typecheck block that correspond to the template node under the user's active selection (if any). The typecheck block is made available via a dedicated text document provider that queries fresh typecheck block content whenever the `getTemplateTcb` command is invoked. Probably not something we want to land soon, but a useful debugging tool for folks working with TCBs. See also angular/angular#39974, which provides the language service implementations needed for this feature.
This patch adds a command to retrieve and display the typecheck block for a template under the user's active selections (if any), and highlights the span of the node(s) in the typecheck block that correspond to the template node under the user's active selection (if any). The typecheck block is made available via a dedicated text document provider that queries fresh typecheck block content whenever the `getTemplateTcb` command is invoked. See also angular/angular#39974, which provides the language service implementations needed for this feature.
This patch adds a command to retrieve and display the typecheck block for a template under the user's active selections (if any), and highlights the span of the node(s) in the typecheck block that correspond to the template node under the user's active selection (if any). The typecheck block is made available via a dedicated text document provider that queries fresh typecheck block content whenever the `getTemplateTcb` command is invoked. See also angular/angular#39974, which provides the language service implementations needed for this feature.
This patch adds a command to retrieve and display the typecheck block for a template under the user's active selections (if any), and highlights the span of the node(s) in the typecheck block that correspond to the template node under the user's active selection (if any). The typecheck block is made available via a dedicated text document provider that queries fresh typecheck block content whenever the `getTemplateTcb` command is invoked. See also angular/angular#39974, which provides the language service implementations needed for this feature.
This patch adds a command to retrieve and display the typecheck block for a template under the user's active selections (if any), and highlights the span of the node(s) in the typecheck block that correspond to the template node under the user's active selection (if any). The typecheck block is made available via a dedicated text document provider that queries fresh typecheck block content whenever the `getTemplateTcb` command is invoked. See also angular/angular#39974, which provides the language service implementations needed for this feature.
This patch adds a command to retrieve and display the typecheck block for a template under the user's active selections (if any), and highlights the span of the node(s) in the typecheck block that correspond to the template node under the user's active selection (if any). The typecheck block is made available via a dedicated text document provider that queries fresh typecheck block content whenever the `getTemplateTcb` command is invoked. See also angular/angular#39974, which provides the language service implementations needed for this feature.
This patch adds a command to retrieve and display the typecheck block for a template under the user's active selections (if any), and highlights the span of the node(s) in the typecheck block that correspond to the template node under the user's active selection (if any). The typecheck block is made available via a dedicated text document provider that queries fresh typecheck block content whenever the `getTemplateTcb` command is invoked. See also angular/angular#39974, which provides the language service implementations needed for this feature.
This patch adds a command to retrieve and display the typecheck block for a template under the user's active selections (if any), and highlights the span of the node(s) in the typecheck block that correspond to the template node under the user's active selection (if any). The typecheck block is made available via a dedicated text document provider that queries fresh typecheck block content whenever the `getTemplateTcb` command is invoked. See also angular/angular#39974, which provides the language service implementations needed for this feature.
This patch adds a command to retrieve and display the typecheck block for a template under the user's active selections (if any), and highlights the span of the node(s) in the typecheck block that correspond to the template node under the user's active selection (if any). The typecheck block is made available via a dedicated text document provider that queries fresh typecheck block content whenever the `getTemplateTcb` command is invoked. See also angular/angular#39974, which provides the language service implementations needed for this feature.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This patch adds an API to retrieve the template typecheck block for a
template (if any) at a file location, and a selection of the TS node
in the TCB corresponding to the template node at which the request for
a TCB was made (if any).
Probably not something we want to land soon, but a useful debugging tool
for folks working with TCBs.