-
Notifications
You must be signed in to change notification settings - Fork 13
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
Many false compatibilities: weak checks on interface
members
#32
Comments
@planger, I have created a branch where this problem is addressed by using internal TypeScript API to check types. I'm hesitant to make a PR because it requires modifying the TS source code in a I want to pull @alvsan09 into the discussion as well: like his PR, this adds a third category of warning to the dashboard. The question I want to pose is the purpose of this repo: is it an internal tool for planning development efforts on the Theia project, or is it a tool for plugin developers interested in ensuring that their plugins will work in particular versions of Theia? In the former case, the value of metadata is fairly limited, since the goal of development on Theia is ensure compatibility where possible, and the degree of compatibility in the past is of limited interest. In the latter case, accurate metadata is important, since it can provide more detailed information about real compatibility. In either case, the accuracy of the actual comparison is important, but the two approaches differ in the value of the |
@colin-grant-work : Thank you for raising this. IMHO, the report should actually fulfill both purposes. The idea is actually to make our planing visible and transparent and thereby allow plugin developers to also consume the report. So in a nutshell,
What we should revisit is the version columns. For Theia, we can probaly use "main" "last release" and "last community release" for VS Code "main" "last release" and "current compatibility target" |
I had an offline discussion with @colin-grant-work and my understanding on the alternative solution to visualize Provided that the new more accurate type checker is in place
The above alternative has several clear advantages as the stubbing is automatically detected and inserted in the actual source. So given the not ideal way of forcing typescript to expose internal API,
|
Question about this mismatched structure: How do we differentiate between "mismatched structure but implemented" and "mismatched structure because subbed"? |
At the moment, the approach I'm taking poses a simple boolean question to TypeScript: whether the type of a certain declaration in Theia is identical to the corresponding declaration in VSCode. However, TypeScript capable of answering more detailed questions, and the old parser infrastructure shows one way - we can extract a lot of textual detail from declarations, so if we want to annotate things in |
@colin-grant-work : I thing a marker such as @stubbed (or similar) is a great suggestion and for me a perfect solution. It documents the "stubbed" in code and we can automatically keep the comparator report up to date. I do not see an issue with forgetting to remove the tag when implementing something. If somebody forgets, we will identify that in the report still. |
@colin-grant-work Sorry for chiming in late! First of all, thank you for this great work so far! Imho it is excellent to reuse TypeScript's own evaluation to decide whether declarations match or not instead of relying on an own set of extracted metadata.
I wouldn't be opposed to that. It may not be elegant, but I wouldn't expect it to cause a lot of maintenance work for us in the future, as we are not changing TypeScript version all too often. Or do you think I'm misjudging that?
I believe it is very useful for both purposes. I guess, however, currently it is more used for planning the development efforts and tracking progress, rather than ensuring a certain plugin will work. It makes clear what is missing for which VS Code version, whether missing API is already tracked, and by following the link to the issue what is already being worked on. E.g. for me it was the basis for creating eclipse-theia/theia#11520. But I think it is also relevant to adopters in planning with which Theia versions they can integrate certain VS Code extensions (third-party ones or own development). For the use case of testing compatibility or ensuring it during development of a VS Code extension, I find https://github.com/eclipse-theia/theia-vscodecov very interesting. It might not be ready yet (see https://github.com/eclipse-theia/theia-vscodecov/issues?q=is%3Aissue+is%3Aopen+bug%3A), but it addresses this use case more directly, as otherwise you'd have to know which API an extension actually uses and then manually match it against the report we generate with vscode-theia-comparator, which seems impracticable anyway. So maybe it is worth optimizing theia-vscodecov for testing and ensuring compatibility of a specific VS Code plugin and vscode-theia-comparator for planning and tracking progress of compatibility in general?
Yes, I agree. Adding a I also don't particularly enjoy editing the I'll give #36 a try to today or tomorrow! I'm excited to see these improvements! Thanks! |
One more thought: |
I also think that having a decorator like @colin-grant-work, during your investigation of the identical matching, did you see any API from typescript that would be useful for this purpose? |
Resolved by #36 |
When checking the compatibility of declared interfaces (for example
InputBoxOptions
), the current code in thecomparator
checks only for a match with an identical name: other metadata is ignored. For example, when comparing Theiamaster
(0c0f8c7a7aedd67930bf65d6f63d827721707d60) with VSCodemain
(ef65649326cff17aae488a4fe953f0f4a6d70260),InputBoxOptions.validateInput
is marked as compatible even though the declarations differ considerably:Theia:
VSCode:
Where
InputBoxValidationMessage
(which is marked as missing from Theia) is defined asThe problem occurs here:
vscode-theia-comparator/src/comparator.ts
Lines 286 to 301 in 572e711
When checking for compatibility among members of interfaces, the only check performed is on the
name
field (l. 290). All other metadata is ignored.The text was updated successfully, but these errors were encountered: