<p dir="auto">I've written this task for <a href="https://github.com/sasstools/sass-lint">sass-lint</a> – is it possible to run it automatically when I save a <code class="notranslate">*.scss</code> file?</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
    &quot;version&quot;: &quot;0.1.0&quot;,
    &quot;command&quot;: &quot;sass-lint&quot;,
    &quot;isShellCommand&quot;: true,
    &quot;args&quot;: [&quot;-c&quot;, &quot;path/to/.sass-lint.yml&quot;, &quot;-v&quot;, &quot;${file}&quot;],
    &quot;showOutput&quot;: &quot;silent&quot;,
    &quot;problemMatcher&quot;: {
        &quot;owner&quot;: &quot;sass&quot;,
        &quot;fileLocation&quot;: &quot;absolute&quot;,
        &quot;pattern&quot;: [
            {
                &quot;regexp&quot;: &quot;^([^\\s].*)$&quot;,
                &quot;file&quot;: 1
            },
            {
                &quot;regexp&quot;: &quot;^\\s+(\\d+):(\\d+)\\s+(error|warning|info)\\s+(.*)\\s\\s+(.*)$&quot;,
                &quot;line&quot;: 1,
                &quot;column&quot;: 2,
                &quot;severity&quot;: 3,
                &quot;message&quot;: 4,
                &quot;code&quot;: 5,
                &quot;loop&quot;: true
            }
        ]
    }
}"><pre class="notranslate">{
    <span class="pl-ent">"version"</span>: <span class="pl-s"><span class="pl-pds">"</span>0.1.0<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"command"</span>: <span class="pl-s"><span class="pl-pds">"</span>sass-lint<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"isShellCommand"</span>: <span class="pl-c1">true</span>,
    <span class="pl-ent">"args"</span>: [<span class="pl-s"><span class="pl-pds">"</span>-c<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>path/to/.sass-lint.yml<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>-v<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>${file}<span class="pl-pds">"</span></span>],
    <span class="pl-ent">"showOutput"</span>: <span class="pl-s"><span class="pl-pds">"</span>silent<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"problemMatcher"</span>: {
        <span class="pl-ent">"owner"</span>: <span class="pl-s"><span class="pl-pds">"</span>sass<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"fileLocation"</span>: <span class="pl-s"><span class="pl-pds">"</span>absolute<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"pattern"</span>: [
            {
                <span class="pl-ent">"regexp"</span>: <span class="pl-s"><span class="pl-pds">"</span>^([^<span class="pl-cce">\\</span>s].*)$<span class="pl-pds">"</span></span>,
                <span class="pl-ent">"file"</span>: <span class="pl-c1">1</span>
            },
            {
                <span class="pl-ent">"regexp"</span>: <span class="pl-s"><span class="pl-pds">"</span>^<span class="pl-cce">\\</span>s+(<span class="pl-cce">\\</span>d+):(<span class="pl-cce">\\</span>d+)<span class="pl-cce">\\</span>s+(error|warning|info)<span class="pl-cce">\\</span>s+(.*)<span class="pl-cce">\\</span>s<span class="pl-cce">\\</span>s+(.*)$<span class="pl-pds">"</span></span>,
                <span class="pl-ent">"line"</span>: <span class="pl-c1">1</span>,
                <span class="pl-ent">"column"</span>: <span class="pl-c1">2</span>,
                <span class="pl-ent">"severity"</span>: <span class="pl-c1">3</span>,
                <span class="pl-ent">"message"</span>: <span class="pl-c1">4</span>,
                <span class="pl-ent">"code"</span>: <span class="pl-c1">5</span>,
                <span class="pl-ent">"loop"</span>: <span class="pl-c1">true</span>
            }
        ]
    }
}</pre></div>
<p dir="auto"><em>From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jsturtevant/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jsturtevant">@jsturtevant</a> on October 26, 2015 23:25</em></p>
<p dir="auto">Is there an API or way to detect which lines are visible in the current editor?</p>
<p dir="auto">In a large file if i use</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="let count = doc.getLineCount();"><pre class="notranslate"><span class="pl-k">let</span> <span class="pl-s1">count</span> <span class="pl-c1">=</span> <span class="pl-s1">doc</span><span class="pl-kos">.</span><span class="pl-en">getLineCount</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">I get all the count of all the lines in the document but I my case I need to restrict my search to only the current visible lines.  In the example below I would get a count of 35 lines although the file is 90+.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/648372/10745288/bae66598-7c16-11e5-8337-641032000ba7.png"><img src="https://cloud.githubusercontent.com/assets/648372/10745288/bae66598-7c16-11e5-8337-641032000ba7.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><em>Copied from original issue: Microsoft/vscode-extensionbuilders#63</em></p>