<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: tanishiking</title>
    <description>The latest articles on DEV Community by tanishiking (@tanishiking).</description>
    <link>https://dev.to/tanishiking</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F13261%2Ff3963049-06af-4fdc-98cb-8bbcbbabb55e.jpeg</url>
      <title>DEV Community: tanishiking</title>
      <link>https://dev.to/tanishiking</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tanishiking"/>
    <language>en</language>
    <item>
      <title>Consistent warnings between IntelliJ and Metals</title>
      <dc:creator>tanishiking</dc:creator>
      <pubDate>Sun, 26 Nov 2023 23:30:35 +0000</pubDate>
      <link>https://dev.to/tanishiking/consistent-warnings-between-intellij-and-metals-2m65</link>
      <guid>https://dev.to/tanishiking/consistent-warnings-between-intellij-and-metals-2m65</guid>
      <description>&lt;p&gt;Maybe your team, some people use IntelliJ and other people use Metals.&lt;br&gt;
While IntelliJ shows a bunch of warnings out of the box in their IDE, Metals requires some settings (like unused imports).&lt;/p&gt;

&lt;p&gt;Metals' warnings depends on Scala compilers warnings, while IntelliJ uses its own typechecker and shows them out of the box.&lt;br&gt;
Which means, we have to add some &lt;code&gt;scalacOptions&lt;/code&gt; to scala compiler such as &lt;code&gt;scalacOptions ++= Seq( "-Ywarn-unused:imports")&lt;/code&gt; (for unused imports).&lt;/p&gt;

&lt;p&gt;For Scala2, this blog post might be a good read &lt;a href="https://medium.com/life-at-hopper/make-your-scala-compiler-work-harder-971be53ae914"&gt;Make Your Scala Compiler Work Harder | by Dick Wall | Life at Hopper | Medium&lt;/a&gt;&lt;/p&gt;

</description>
      <category>scala</category>
    </item>
    <item>
      <title>import $ivy, $dep, and using directive</title>
      <dc:creator>tanishiking</dc:creator>
      <pubDate>Mon, 03 Jul 2023 15:56:40 +0000</pubDate>
      <link>https://dev.to/tanishiking/import-ivy-dep-and-using-directive-26lb</link>
      <guid>https://dev.to/tanishiking/import-ivy-dep-and-using-directive-26lb</guid>
      <description>&lt;p&gt;In &lt;a href="https://scala-cli.virtuslab.org/"&gt;scala-cli&lt;/a&gt;, external libraries can be easily downloaded and used in scripts and REPLs using a convenient notation called &lt;a href="https://scala-cli.virtuslab.org/docs/guides/dependencies"&gt;using directive&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;On the other hand, the &lt;a href="https://scalameta.org/metals/docs/editors/vscode/#worksheets"&gt;worksheet functionality&lt;/a&gt; provided by IDEs such as Metals allows you to download external libraries in the same way using &lt;code&gt;import $ivy&lt;/code&gt; or &lt;code&gt;import $dep&lt;/code&gt;.&lt;br&gt;
However, worksheets cannot make use of the using directive (at least as of mdoc v2.3.7) (&lt;a href="https://github.com/scalameta/mdoc"&gt;mdoc&lt;/a&gt; is the library used behind the scenes to provide the worksheet functionality).&lt;/p&gt;

&lt;p&gt;Which notations can be used in which environments? It's a bit confusing, so I'll leave a note.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;// using dep&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;import $ivy&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;import $dep&lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;scala-cli&lt;/td&gt;
&lt;td&gt;⭕️&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ammonite&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;⭕️&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IntelliJ worksheet (Ammonite)&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;⭕️&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Metals Worksheet&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;td&gt;⭕️&lt;/td&gt;
&lt;td&gt;⭕️&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Note&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/VirtusLab/scala-cli/pull/1787"&gt;scala-cli dropped ammonite imports&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;import $dep&lt;/code&gt; is available only in mdoc-build tools &lt;a href="https://github.com/scalameta/mdoc/pull/333"&gt;Add support for adding library dependencies via imports. by olafurpg · Pull Request #333 · scalameta/mdoc&lt;/a&gt; such as metals worksheet.&lt;/li&gt;
&lt;li&gt;Follow the &lt;a href="https://www.jetbrains.com/help/idea/work-with-scala-worksheet-and-ammonite.html"&gt;Scala worksheet, Scala REPL and Ammonite | IntelliJ IDEA Documentation&lt;/a&gt; to use Ammonite in IntelliJ worksheet.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>scala</category>
      <category>intellij</category>
      <category>vscode</category>
    </item>
  </channel>
</rss>
