Skip to content
/ vscode Public
  • Notifications You must be signed in to change notification settings
  • Fork 28k
  • Star 160k
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.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jump to bottom

Quickfix popup stopped suggesting imports for JS #131840

Closed
croraf opened this issue Aug 28, 2021 · 6 comments
Closed

Quickfix popup stopped suggesting imports for JS #131840

croraf opened this issue Aug 28, 2021 · 6 comments
Assignees
@mjbvz
Labels
*caused-by-extension Issue identified to be caused by an extension

Comments

@croraf
Copy link

croraf commented Aug 28, 2021

Does this issue occur when all extensions are disabled?: Yes/No (It requires ESLint extension to reproduce)

  • VS Code Version: 1.59.1
  • OS Version: Linux x64 5.4.0-45-generic

Version: 1.59.1
Commit: 3866c35
Date: 2021-08-19T11:54:37.513Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Linux x64 5.4.0-45-generic

Steps to Reproduce:

  1. Context:
  • have a JS project with package.json with "type": "module" property.
  • Have ESLint extension installed, eslint dependency installed locally with npm install eslint
  • Have the following eslint configuration file .eslintrc.cjs:
module.exports = {
  'env': {
    'node': true,
    'es2021': true,
  },
  'extends': 'eslint:recommended',
  'parserOptions': {
    'ecmaVersion': 12,
    'sourceType': 'module'
  },
  'rules': {
  }
};
  1. have two JS files first.js and second.js
// second.js
const myItem = 5;
export {myItem};
// first.js
const temp = myItem;

During typing of myItem in first.js the editor does suggest me to complete it and import, and on confirm it does complete and import myItem. (this part works even without ESLint extension and library)

But, if it is already completed, it does get underlined as a missing error and you can open a Quickfix popup. But in the Quickfix popup there is no suggestion to "Add the missing import".
Screenshot from 2021-08-28 12-53-06
Screenshot from 2021-08-28 12-55-07

The "Add the missing import" suggestion was present until sometime in the mid 2021. (But perhaps I disabled something in the settings also.)

@croraf croraf changed the title Quickfix for javascript stopped suggesting imports Quickfix popup stopped suggesting imports for JS Aug 28, 2021
@croraf croraf closed this as completed Aug 28, 2021
@croraf croraf reopened this Aug 28, 2021
@croraf croraf mentioned this issue Aug 28, 2021
Quick Fix popup stopped suggesting "Add missing import" for JS microsoft/vscode-eslint#1326
Closed
@vscode-triage-bot vscode-triage-bot assigned mjbvz Aug 28, 2021
@mjbvz mjbvz added the *caused-by-extension Issue identified to be caused by an extension label Aug 30, 2021
@mjbvz
Copy link
Contributor

mjbvz commented Aug 30, 2021

If this only happens when eslint is enabled, please start by filing it against that extension

@croraf
Copy link
Author

croraf commented Aug 30, 2021

vscode-eslint hasn't had production release since 2020, and this issue started to appear mid 2021.

Are typescript language features (built in into vscode) in charge of providing Quick Fix option Add missing import in JS files?

Because I do see that typescript language features provide Quick Fix options for <variable> is declared but its value is never read.ts(6133) error for example. And it also provides the autocomplete with automatic addition of missing import (which also changed behavior that after deleting the import it doesn't suggest it any more).

@mjbvz
Copy link
Contributor

mjbvz commented Aug 30, 2021

Auto import come from VS Code itself but if this bug only happens when eslint is enabled, something with that extension is causing issues. Please put together a demonstration of the issue that doesn't require anything eslint and we'll take a look

@croraf
Copy link
Author

croraf commented Aug 31, 2021

(Yes, I think it might be better to go with the issue through the vscode-eslint extension repo, even though the error might potentially be in the vscode API)

FYI:

The autoimport on autocompletion dropdown selection works fine! (as on the following two images)
Screenshot from 2021-08-31 01-31-55
Screenshot from 2021-08-31 01-33-48

What does not work is the following:

  • VSCode does provide a Quick Fix feature (API), the example of which can be seen on this image. The link Quick Fix... (Ctrl + .) at the bottom of the popup which opens a list of quick fix options.
    Screenshot from 2021-08-31 01-44-28 (1)
  • the Quick Fix feature suddenly stopped providing "Add missing import" option (which I'm not sure if it is provided by the vscode-eslint Extension with the rule no-undef, or by the typescript language features). And nowonly the three quick fix options shown in the first post remained.
    (NOTE: The "Fix this semi problem" quick fix option provided by vscode-eslint for semicolons is shown correctly for example)
    Screenshot from 2021-08-31 02-21-24

@croraf
Copy link
Author

croraf commented Aug 31, 2021

I made some progress. vscode-eslint is just forwarding the available fixes from the eslint library. And eslint library is not providing fixes for missing imports (and never had).

So either some eslint plugin was providing this or this was VSCode's built in feature.

Could it be that the typescript language features module provided the "Add missing import" and "Add all missing imports" quick fix options, and it stopped providing this two months ago for the JS? Because typescript language features does provide the autoimport on autocompletion.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*caused-by-extension Issue identified to be caused by an extension
Projects
None yet
Development

No branches or pull requests

3 participants
@mjbvz @croraf and others

Footer

© 2024 GitHub, Inc.

哆哆女性网电影无双王和王怎么起人名魔兽之路终极一班2猴子qq表情绿色环保公司起名字大全免费宁姓 起名中国象棋游戏起网名女美国陷阱成语寓意好的起名集团公司名称咋起名邱起名男孩名字天下兴亡匹夫有责是谁说的天注定在线观看完整版三人公司起名路嘉怡医疗器械公司取名起名大全感谢词文明3秘籍竹石古诗格式工厂绿色版adjust神武天帝稳定网站635用睿起名字好听时尚非主流图片手工生辰八字起名袁起名字女人淀粉肠小王子日销售额涨超10倍罗斯否认插足凯特王妃婚姻不负春光新的一天从800个哈欠开始有个姐真把千机伞做出来了国产伟哥去年销售近13亿充个话费竟沦为间接洗钱工具重庆警方辟谣“男子杀人焚尸”男子给前妻转账 现任妻子起诉要回春分繁花正当时呼北高速交通事故已致14人死亡杨洋拄拐现身医院月嫂回应掌掴婴儿是在赶虫子男孩疑遭霸凌 家长讨说法被踢出群因自嘲式简历走红的教授更新简介网友建议重庆地铁不准乘客携带菜筐清明节放假3天调休1天郑州一火锅店爆改成麻辣烫店19岁小伙救下5人后溺亡 多方发声两大学生合买彩票中奖一人不认账张家界的山上“长”满了韩国人?单亲妈妈陷入热恋 14岁儿子报警#春分立蛋大挑战#青海通报栏杆断裂小学生跌落住进ICU代拍被何赛飞拿着魔杖追着打315晚会后胖东来又人满为患了当地回应沈阳致3死车祸车主疑毒驾武汉大学樱花即将进入盛花期张立群任西安交通大学校长为江西彩礼“减负”的“试婚人”网友洛杉矶偶遇贾玲倪萍分享减重40斤方法男孩8年未见母亲被告知被遗忘小米汽车超级工厂正式揭幕周杰伦一审败诉网易特朗普谈“凯特王妃P图照”考生莫言也上北大硕士复试名单了妈妈回应孩子在校撞护栏坠楼恒大被罚41.75亿到底怎么缴男子持台球杆殴打2名女店员被抓校方回应护栏损坏小学生课间坠楼外国人感慨凌晨的中国很安全火箭最近9战8胜1负王树国3次鞠躬告别西交大师生房客欠租失踪 房东直发愁萧美琴窜访捷克 外交部回应山西省委原副书记商黎光被逮捕阿根廷将发行1万与2万面值的纸币英国王室又一合照被质疑P图男子被猫抓伤后确诊“猫抓病”

哆哆女性网 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化