Repository navigation
refactor(language-service): using the ls public API to check the acti… - #57165
ivanwonder wants to merge 1 commit into
Conversation
|
@ivanwonder what's the benefit of implementing this TS language service method if it's not used automatically? It seems like we also need some string conversions here and it's a little more ambiguous what the function returns (i.e. code fix ids? error codes as string? etc) I don't see a downside to the custom method. It's unused right now, but exposed as it might be useful late. We've been also using customs for refactoring actions, for simpler integration |
|
I think It's confusing to have two APIs(
But, this method is defined by the typescript, and return codes as string. It's better to stay consistent and rewrite the function defined by the typescript. |
I don't think so, personally. There seem to be many methods that aren't necessarily updated. There doesn't seem to be a benefit, except for the downside of ambiguous w/ string conversions IMO— not feeling super strongly.
That's the part that's not super clear IMO. Could also be a fix id for example. It's not well documented, if at all. |
|
@atscott convert to draft. I will open it after we have a conclusion.
Yes, there is no document for this method. For me, the GitHub issue and PR are the best ways to learn it. From this PR, This method will be called by the built-in typescript extension if we need to support the developer to use the |
Is that something we support? cc. @atscott |
No, I don't believe so. There was some attempt at one point to consider this as a possibility but I don't believe it was ever attempted, tested, or supported. |
|
@dylhunn @clydin Do you have any thoughts on this? You both have more experience than me with the ecosystem and using the language service in contexts other than the VSCode extension. I didn't mean to say this shouldn’t be done, just that the “language service as a typescript plugin” was never attempted. It may still be valuable to keep this as a potential to explore, or at least keep to the current convention of using existing function names from the Typescript Language Service where possible. |
|
IMO probably not worth, given:
|
…on codes A public API called [`getSupportedCodeFixes`][0] is used to check if the compiler can fix the diagnostics. Remove the unnecessary export custom API. [0]: https://github.com/microsoft/TypeScript/blob/6d3be985c82bead3b41348de76efec8110c677c5/src/services/types.ts#L697
c5fdb43 to
c73901a
Compare
|
I'm doing some cleanup and close old drafts. |
|
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. |
…on codes
A public API called
getSupportedCodeFixesis used to check if the compiler can fix the diagnostics. Remove the unnecessary export custom API.PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information