-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathlanguage_support_vscode.html
More file actions
116 lines (116 loc) · 8.7 KB
/
Copy pathlanguage_support_vscode.html
File metadata and controls
116 lines (116 loc) · 8.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SmallBASIC | language_support_vscode</title>
<meta name="description" content="SmallBASIC | One more basic">
<link rel="canonical" href="/language_support_vscode.html">
<link rel="keywords" href="language_support_vscode">
<link rel="stylesheet" href="/css/style.css">
<link rel="icon" type="image/png" href="/images/sb-desktop-32x32.png">
<script src="/clipboard.js"></script>
</head>
<body>
<button onclick="topFunction()" id="BackToTopBtn" title="Go to top">⯅</button>
<script src="/backtotop.js"></script>
<div class="wrapAll clearfix">
<nav class="navigation">
<div class="logo">
<a href="/"><img src='/images/sb-logo.png?v=2' alt="logo"></a>
</div>
<div class="navlinks">
<a href="/pages/download.html">Download</a>
<a href="/pages/news.html">News</a>
<a href="/pages/community.html">Community</a>
<a class='active' href="/pages/articles.html">Resources</a>
<a href="/pages/reference.html">Language Reference</a>
<a href="/pages/guide.html">SmallBASIC Manual</a>
</div>
</nav>
<div class="mainsection">
<div class="tabs clearfix">
<div class="tabsRight">
<a target="_github" href="https://github.com/smallbasic/smallbasic.github.io/blob/master/_build/pages/language_support_vscode.markdown">Edit</a>
<a target="_github" href="https://github.com/smallbasic/smallbasic.github.io/commits/master/_build/pages/language_support_vscode.markdown">History</a>
</div>
</div>
<div class="article">
<h1 id="smallbasic-in-visual-studio-code">SmallBASIC in Visual Studio
Code</h1>
<p><em>“Visual Studio Code is a source-code editor made by Microsoft for
Windows, Linux and macOS. Features include support for debugging, syntax
highlighting, intelligent code completion, snippets, code refactoring,
and embedded Git. Users can change the theme, keyboard shortcuts,
preferences, and install extensions that add additional
functionality.</em> <em>In the Stack Overflow 2021 Developer Survey,
Visual Studio Code was ranked the most popular developer environment
tool, with 70% of 82,000 respondents reporting that they use it.” (<a
href="https://en.wikipedia.org/wiki/Visual_Studio_Code">wikipedia</a>)</em></p>
<figure>
<img
src="https://github.com/smallbasic/smallbasic.syntax-highlighting/raw/main/vscode/screenshot.png"
alt="Example" />
<figcaption aria-hidden="true">Example</figcaption>
</figure>
<h2 id="setup-syntax-highlighting-and-coloring">Setup Syntax
Highlighting and Coloring</h2>
<p>The VSCode extension for syntax highlighting and code snippets can be
downloaded from <a
href="https://github.com/smallbasic/smallbasic.syntax-highlighting/tree/main/vscode">Github</a>
as a VSIX file. To install the extension please select this file in the
VSCode extensions section (View -> Extensions -> … (3 dots) ->
Install from VSIX)</p>
<h2 id="setup-code-execution">Setup Code Execution</h2>
<p>In VSCode tasks can be configured for your project to execute
commands. To create a task go to Terminal->Configure Task. The file
task.json will be displayed (stored in your project folder in the
subfolder .vscode). Replace the content of the file with the following
commands:</p>
<div class="sourceCode" id="cb1"><pre
class="sourceCode json"><code class="sourceCode json"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">{</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> <span class="er">//</span> <span class="er">See</span> <span class="er">https</span><span class="fu">:</span><span class="er">//go.microsoft.com/fwlink/?LinkId=</span><span class="dv">733558</span></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a> <span class="er">//</span> <span class="er">for</span> <span class="er">the</span> <span class="er">documentation</span> <span class="er">about</span> <span class="er">the</span> <span class="er">tasks.json</span> <span class="er">format</span></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a> <span class="st">"version"</span><span class="er">:</span> <span class="st">"2.0.0"</span><span class="fu">,</span></span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">"tasks"</span><span class="fu">:</span> <span class="ot">[</span></span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">{</span></span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">"label"</span><span class="fu">:</span> <span class="st">"Execute sbasicg"</span><span class="fu">,</span></span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a> <span class="dt">"type"</span><span class="fu">:</span> <span class="st">"shell"</span><span class="fu">,</span></span>
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a> <span class="dt">"command"</span><span class="fu">:</span> <span class="st">"sbasicg"</span><span class="fu">,</span></span>
<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a> <span class="dt">"args"</span><span class="fu">:</span> <span class="ot">[</span></span>
<span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a> <span class="st">"-r"</span><span class="ot">,</span></span>
<span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a> <span class="st">"${file}"</span></span>
<span id="cb1-13"><a href="#cb1-13" aria-hidden="true" tabindex="-1"></a> <span class="ot">]</span><span class="fu">,</span></span>
<span id="cb1-14"><a href="#cb1-14" aria-hidden="true" tabindex="-1"></a> <span class="dt">"problemMatcher"</span><span class="fu">:</span> <span class="ot">[]</span><span class="fu">,</span></span>
<span id="cb1-15"><a href="#cb1-15" aria-hidden="true" tabindex="-1"></a> <span class="dt">"group"</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb1-16"><a href="#cb1-16" aria-hidden="true" tabindex="-1"></a> <span class="dt">"kind"</span><span class="fu">:</span> <span class="st">"build"</span><span class="fu">,</span></span>
<span id="cb1-17"><a href="#cb1-17" aria-hidden="true" tabindex="-1"></a> <span class="dt">"isDefault"</span><span class="fu">:</span> <span class="kw">true</span></span>
<span id="cb1-18"><a href="#cb1-18" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb1-19"><a href="#cb1-19" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb1-20"><a href="#cb1-20" aria-hidden="true" tabindex="-1"></a> <span class="ot">]</span></span>
<span id="cb1-21"><a href="#cb1-21" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre></div>
<p>You have to edit the command-keyword to point to the correct location
of the sbasic executable. In Linux it could be for example:</p>
<div class="sourceCode" id="cb2"><pre
class="sourceCode json"><code class="sourceCode json"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="er">"command":</span> <span class="er">"sbasicg"</span></span></code></pre></div>
<p>or</p>
<div class="sourceCode" id="cb3"><pre
class="sourceCode json"><code class="sourceCode json"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="er">"command":</span> <span class="er">"/home/myname/programs/sbasicg"</span></span></code></pre></div>
<p>in Windows for example:</p>
<div class="sourceCode" id="cb4"><pre
class="sourceCode json"><code class="sourceCode json"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="er">"command":</span> <span class="er">"C:\Program</span> <span class="er">Files\SmallBASIC\sbasicg.exe"</span></span></code></pre></div>
<p>You can execute the task either by “Terminal->Run Build Task” or
by pressing Ctrl+Shift+B.</p>
</div>
<div class="pagefooter">
This page was last edited on Tue, 22 Aug 2023 22:36:50 +0200
|
<a href="https://en.wikipedia.org/wiki/Markdown" target="_blank" rel="nofollow">Markdown</a>
processed with
<a href="https://pandoc.org/MANUAL.html#pandocs-markdown" target="_blank" rel="nofollow">pandoc 3.5</a>
</div>
</div>
</div>
</body>
</html>