Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
445 views
in Technique[技术] by (71.8m points)

javascript - 选择文件的完整清理时,Jetbrains Rider无法清理JavaScript文件(Jetbrains Rider not cleaning JavaScript files when full cleanup of file selected)

Latest version of Rider does not clean up JS files (C# file cleanup working fine), such as removing extra spaces, extra lines, or fixing lines greater than defined acceptable length.(最新版本的Rider无法清理JS文件(C#文件清理工作正常),例如删除多余的空格,多余的行或固定大于定义的可接受长度的行。)

However, Resharper cleans up the files correctly.(但是,Resharper会正确清理文件。) NET Core 3.0 web project.(NET Core 3.0 Web项目。) All JS files located in the wwwroot/js directory.(位于wwwroot / js目录中的所有JS文件。) Has anyone experienced this?(有人经历过吗?) If yes, how did you fix it.(如果是,您如何解决它。)

To be explicit: cleanup using Ctrl+E, C(明确地说:使用Ctrl + E,C进行清理)

Tried:(尝试过:)

  • Restarting IDE(重新启动IDE)
  • Invalidating cache(使缓存无效)
  • Moving files to different folder(将文件移动到其他文件夹)
  ask by JJJulien translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Started from 2019.1 Rider supports JavaScript/TypeScript languages using WebStorm Engine.(从2019.1开始,Rider使用WebStorm Engine支持JavaScript / TypeScript语言。)

Earlier, ReSharper was responsible for this part.(此前,ReSharper负责这部分。) Clean Up function is a ReSharper action.(清理功能是一种ReSharper操作。) This fact explains why js/ts files are not affected by it.(这个事实解释了为什么js / ts文件不受它的影响。) One needs to configure separate settings for JS and TS code style:(需要为JS和TS代码样式配置单独的设置:)
Preferences | Editor | Code Style | JavaScript

Preferences | Editor | Code Style | TypeScript

And then, to apply code format on ts/js files, one need to call the "Reformat Code" action.(然后,要将代码格式应用于ts / js文件,则需要调用“重新格式化代码”操作。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...