GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Codefix: convert const to let · Issue #22473 · microsoft/TypeScript

Codefix: convert const to let  #22473

New issue
Copy link
New issue
Copy link
Closed
#33157
Closed
Codefix: convert const to let #22473
#33157
Copy link
Labels
Domain: LS: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.SuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
TypeScript 3.7.0

Description

@jwbay
jwbay
opened on Mar 11, 2018
Issue body actions

TypeScript Version: 2.8.0-dev.20180308

Search Terms:
const let codefix

Code

const x = 42;

// lots of code

x/*1*/ = 75;

Expected behavior:
Error with codefix offered at 1 to convert the declaration from const to let

Actual behavior:
Just an error, no codefix

Related Issues:
The exact opposite of #13133

Reacted by Youngrok Kim, Steven, Isabella Skořepová and Oleksandr Tarasiuk

Activity

  1. Mohamed Hegazy (mhegazy)
    added
    SuggestionAn idea for TypeScriptAn idea for TypeScript
    help wanted
    good first issue
    Domain: LS: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.
    on Mar 30, 2018
  2. Mohamed Hegazy (mhegazy)
    added this to the This milestone has been deleted milestone on Mar 30, 2018
  3. MagWeaver commented on Apr 3, 2018

    @MagWeaver
    Chris Weaver (MagWeaver)
    on Apr 3, 2018
    More actions

    Can I take this one?

  4. DanielRosenwasser commented on Apr 3, 2018

    @DanielRosenwasser
    Daniel Rosenwasser (DanielRosenwasser)
    on Apr 3, 2018
    Member
    More actions

    Go for it!

  5. RubenMateus commented on Apr 8, 2018

    @RubenMateus
    Ruben Mateus (RubenMateus)
    on Apr 8, 2018
    More actions

    Chris Weaver (@MagWeaver) any news from this?

  6. Fatehsandhu commented on Jun 8, 2018

    @Fatehsandhu
    Singh Sandhu (Fatehsandhu)
    on Jun 8, 2018
    More actions

    Daniel Rosenwasser (@DanielRosenwasser) Can I please take over if it's possible?
    Thanks

  7. mhegazy commented on Jun 8, 2018

    @mhegazy
    Mohamed Hegazy (mhegazy)
    on Jun 8, 2018
    Contributor
    More actions

    Go for it.

  8. Fatehsandhu commented on Jun 15, 2018

    @Fatehsandhu
    Singh Sandhu (Fatehsandhu)
    on Jun 15, 2018
    More actions

    Mohamed Hegazy (@mhegazy) Can I please get some help getting started? Which files should I be looking at?
    Thanks

  9. mhegazy commented on Jun 19, 2018

    @mhegazy
    Mohamed Hegazy (mhegazy)
    on Jun 19, 2018
    Contributor
    More actions

    Quick fixes are attached to diagnostics. in this case TS Error 2540: Cannot assign to 'x' because it is a constant or a read-only property.

    You can take a look at https://github.com/Microsoft/TypeScript/blob/master/src/services/codefixes/fixAwaitInSyncFunction.ts and https://github.com/Microsoft/TypeScript/blob/master/src/services/codefixes/fixSpelling.ts for a guide to how a quick fix can be implemented.

    Also you will need to add handling for the readonly property case, where the readonly modifier would be removed.

  10. muradkhan101 commented on Oct 2, 2018

    @muradkhan101
    M (muradkhan101)
    on Oct 2, 2018
    More actions

    Singh Sandhu (@Fatehsandhu) Still working on this? If not I'd like to take a shot at it :)

  11. muradkhan101 commented on Oct 3, 2018

    @muradkhan101
    M (muradkhan101)
    on Oct 3, 2018
    More actions

    Hey Mohamed Hegazy (@mhegazy), I have a potential fix for this here , but I couldn't find solid diagnostic messages to use and haven't figured out the readonly case yet though. Just wanted to check in with you to get some info about creating diagnostic messages and see if I'm on the right track here, thanks!

  12. suhailsinghbains commented on Oct 5, 2018

    @suhailsinghbains
    Suhail Singh Bains (suhailsinghbains)
    on Oct 5, 2018
    More actions

    Hi,
    I'm new to open-source, can I please solve this issue?
    Thanks

  13. muradkhan101 commented on Oct 5, 2018

    @muradkhan101
    M (muradkhan101)
    on Oct 5, 2018
    More actions

    Suhail Singh Bains (@suhailsinghbains) I'm currently working on this one and am close to completing so your time may be better spent on another one. I'll let you know if anything changes however.

  14. suhailsinghbains commented on Oct 5, 2018

    @suhailsinghbains
    Suhail Singh Bains (suhailsinghbains)
    on Oct 5, 2018
    More actions

    Sure M (@muradkhan101)

  15. Ryan Cavanaugh (RyanCavanaugh)
    modified the milestones: Community, Backlog on Mar 7, 2019
  16. Orta Therox (orta)
    closed this as completedin #33157on Sep 17, 2019
  17. Daniel Rosenwasser (DanielRosenwasser)
    modified the milestones: Backlog, TypeScript 3.7.0 on Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: LS: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.SuggestionAn idea for TypeScriptAn idea for TypeScript

    Type

    No type

    Projects

    No projects

      Milestone

      • TypeScript 3.7.0

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.