Skip to content
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

Consider more informative guidance for customers trying to migrate code #699

Open
billti opened this issue Sep 14, 2023 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@billti
Copy link
Member

billti commented Sep 14, 2023

Rather than just 'identifier not found' (such as for trying to use an API from the old library that no longer exists), or 'syntax error' (such as for interpolated string changes), we could perhaps detect these cases and have a more helpful error message, perhaps redirecting to a page that lists the changes and how to migrate such code (or open an issue to request an API/feature).

@billti billti modified the milestone: 2309 Sep 14, 2023
@billti
Copy link
Member Author

billti commented Oct 6, 2023

Lots of fun debate on this one. I think we still need to 'triage' further to come to agreement.

@filipw
Copy link
Contributor

filipw commented Oct 6, 2023

I vote for a compatibility layer (for missing library functions)

swernli added a commit that referenced this issue Oct 30, 2023
This change introduces the `@Unimplemented()` attributed which can be used to mark an item as something that should not be used. The motivation behind including this and not just treating it as a `Not Found` error is to give the user more information that this API may have previously existing and is not currently supported (see #699 for context).
swernli added a commit that referenced this issue Oct 30, 2023
This change introduces the @unimplemented() attributed which can be used to mark an item as something that should not be used. The motivation behind including this and not just treating it as a Not Found error is to give the user more information that this API may have previously existing and is not currently supported (see #699 for context).
swernli added a commit that referenced this issue Nov 9, 2023
This change introduces the @unimplemented() attributed which can be used to mark an item as something that should not be used. The motivation behind including this and not just treating it as a Not Found error is to give the user more information that this API may have previously existing and is not currently supported (see #699 for context).
github-merge-queue bot pushed a commit that referenced this issue Nov 9, 2023
This change introduces the `@Unimplemented()` attributed which can be
used to mark an item as something that should not be used. The
motivation behind including this and not just treating it as a `Not
Found` error is to give the user more information that this API may have
previously existing and is not currently supported (see #699 for
context).

---------

Co-authored-by: Scott Carda <[email protected]>
@billti billti added this to the 2401 milestone Dec 11, 2023
@swernli
Copy link
Collaborator

swernli commented Dec 11, 2023

The @Unimplemented attribute was added to the language to help provide guidance on this, but does not allow for adding any extra text to the error. After discussion with @DmitryVasilevsky we landed at wanting support for an optional string that gets added to the error output. I'll work on that, and that should enable any additional libraries we want to add with guidance for users on what to use.

@swernli
Copy link
Collaborator

swernli commented Jan 2, 2024

Diggin into this further, we hit some complications:

  • Adding support of a string in the @Unimplemented attribute parameters would mean copying that string across AST->HIR, which makes some of the data structures non-Copy and interferes with the way they are being used. This can be fixed, but becomes a larger refactor that ideally would use Copy identifiers (like integers) to index into a cache of strings. At that point it just becomes a small implementation of string interning, which we have wanted to get across the compiler anyway, but shouldn't be done quickly for just one part of the code.
  • APIs marked as unimplemented should be suppressed in completion lists, which will require an update to the language server to make it attribute aware when putting together the completion list.

Given that, the updated behavior we want for this doesn't seem reasonable to squeeze into 2401, so I'll remove the milestone tag.

@swernli swernli removed this from the 2401 milestone Jan 2, 2024
@swernli swernli removed their assignment Jul 25, 2024
@swernli swernli removed the bug-bash label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants