title: How to get file name when overriding VS Code snippet
body: <p>I'm trying to override the <code>rfce</code> snippet in VS code but I can't seem to be able to get the filename autofilled when there's a named file. Where the file is not saved(unnamed) it should just be <code>NameOfComponent</code> but if the file is saved(has a name), the snippet should name the component the same as the file name but without the extension. Here's what I have so far:</p>
  <pre><code>&quot;React Component&quot;: {
    &quot;prefix&quot;: &quot;rfce&quot;,
    &quot;body&quot;: [
      &quot;import React, { useState, useEffect } from \&quot;react\&quot;;&quot;,
      &quot;&quot;,
      &quot;const ${1:NameOfComponent} = () =&gt; {&quot;,
      &quot;  return (&quot;,
      &quot;    &lt;&gt;&quot;,
      &quot;       ${2:&lt;div&gt;Hello World&lt;/div&gt;}&quot;,
      &quot;    &lt;/&gt;&quot;,
      &quot;  );&quot;,
      &quot;};&quot;,
      &quot;&quot;,
      &quot;export default ${1:NameOfComponent};&quot;
    ],
    &quot;description&quot;: &quot;React Component&quot;
  }
  </code></pre>