A simple extension for syntax highlighting of generic pseudocode.
Syntax highlighting exists for multiple variants of common pseudocode keywords, allowing you to use your own style and not confining you to a specific format.
The following items have syntax highlighting. Synonyms are separated by spaces.
output print e.g. output "Hello World"
input
if
else
try
catch except
import
while loop
for
foreach
return
set e.g. set x = 1
switch
case
break
continue
do
end
and &&
or ||
not !
in
function
procedure
e.g.
function say(x) do
print x
end
say("Hello World")
class
extends
e.g.
class A do
constructor() do
print "Hi"
end
end
e.g.
class B extends A do
constructor() do
print "Hi"
end
end
struct
e.g.
struct A do
end
${}
e.g.
set user = "John"
print "Hello, ${user}!"
If Else:
Loops:
Switch:
Try Catch:
Functions:
Classes:
Structs:
Note: all snippets have uppercase variants beginning with 'u'
You can also define your own custom keywords in a config file.
If you aren't content with the predefined keywords included, you can now add your own to a .pseudoconfig
file located in your user's home directory (~/.pseudoconfig
or C:\Users\{username}\.pseudoconfig
).
To use this feature you must make sure editor.semanticHighlighting.enabled
is set to true
in VSCode.
The config file should contain a JSON object, with a single key "custom"
containing an object with a single key "keyword"
(the only scope currently supported for custom highlighting) which has a value of an array of strings, which holds your custom keywords.
Example:
{
"custom": {
"keyword": [
"customKeyword",
"exampleWord"
]
}
}
In the above example, both customKeyword
and exampleWord
will be highlighted as keywords.
NOTE: You must reload the extension after editing the config file.
NOTE: Local config files in the active directory are not currently supported. You can currently only use a global config file which is placed in the home directory.
- do end autocloses in variables
- Added customisable keywords
- Added optional config file (used to define customisable keywords)
- Added
static
,public
, andprivate
modifiers for structs, classes, and functions - Added the
continue
keyword
- Added template strings (e.g.
"Hi ${user.name}"
)
- Added structs
- Added
struct
andstructdo
snippets
- Fixed bug where do end would be autoclose in strings and comments
- Fixed bug which prevented comments in functions and procedures
- Minor changes to extension information
- Initial release with syntax highlighting and snippets for basic statements and definitions.