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

No file ending when adding import #60451

Open
jrieken opened this issue Nov 7, 2024 · 2 comments · May be fixed by microsoft/vscode#233928
Open

No file ending when adding import #60451

jrieken opened this issue Nov 7, 2024 · 2 comments · May be fixed by microsoft/vscode#233928
Assignees
Labels
Needs Investigation This issue needs a team member to investigate its status.

Comments

@jrieken
Copy link
Member

jrieken commented Nov 7, 2024

  • vscode at commit f0a0037
  • open src/vs/workbench/contrib/chat/browser/chatEditorOverlay.ts
  • on line 42 write this._editor.getOption(EditorOption) and make sure to use auto complete with import for EditorOption
  • 🐛 the import will be without .js

excerpt from the logs

Info 10477[09:55:25.163] response:
    {"seq":0,"type":"response","command":"updateOpen","request_seq":303,"success":true,"body":true}
Info 10478[09:55:25.214] request:
    {
      "seq": 304,
      "type": "request",
      "command": "updateOpen",
      "arguments": {
        "changedFiles": [
          {
            "fileName": "/Users/jrieken/Code/vscode/src/vs/workbench/contrib/chat/browser/chatEditorOverlay.ts",
            "textChanges": [
              {
                "newText": "import { EditorOption } from '../../../../editor/common/config/editorOptions';\n",
                "start": {
                  "line": 21,
                  "offset": 1
                },
                "end": {
                  "line": 21,
                  "offset": 1
                }
              }
            ]
          }
        ],
        "closedFiles": [],
        "openFiles": []
      }
    }

tsserver.log

@mjbvz mjbvz transferred this issue from microsoft/vscode Nov 7, 2024
@mjbvz mjbvz removed their assignment Nov 7, 2024
@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Nov 7, 2024
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 5.8.0 milestone Nov 7, 2024
@RyanCavanaugh
Copy link
Member

RyanCavanaugh commented Nov 15, 2024

This is the intended behavior unless you have set the importModuleSpecifierEnding preference to js, because the controlling tsconfig here says moduleResolution: node, which has never needed file extensions (and which were idiomatically not included in that era).

You can either set the preference, or update the module resolution setting to nodenext, or both. I've sent a PR for the former

@RyanCavanaugh RyanCavanaugh added Question An issue which isn't directly actionable in code and removed Needs Investigation This issue needs a team member to investigate its status. labels Nov 15, 2024
@typescript-bot
Copy link
Collaborator

This issue has been marked as "Question" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2024
@andrewbranch andrewbranch self-assigned this Nov 26, 2024
@andrewbranch andrewbranch added Needs Investigation This issue needs a team member to investigate its status. and removed Question An issue which isn't directly actionable in code labels Nov 26, 2024
@andrewbranch andrewbranch reopened this Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Investigation This issue needs a team member to investigate its status.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants