OScript Language for Visual Studio CodeProvides syntax checking and fixing, highlighting, autocompletion, hints, symbol outline, identifier recognition and renaming and other features for the OScript language in Visual Studio Code. InstallationInstall this extension to your Visual Studio Code from the marketplace, or download a specific version of a released package and install it from the file. FeaturesExcept for the first four features below, the others depend on the OScript language server, which will be started in the background automatically.
Syntax HighlightingThe source code is broken down to tokens like keyword, identifier or literal, which are recognised by the highlighter. You just choose a visual theme to colourise them. An example of the syntax highlighting in the Dark+ theme: An example of the syntax highlighting in the Light+ theme: Scope FoldingFoldable scopes are comments, preprocessor directive blocks, objects, scripts and functions. The scope-closing token (the Code Commenting / UncommentingCommands "Toggle Line Comment" ( Bracket MatchingParentheses, square brackets and curly braces are recognised as pairs, so that you can navigate between them or emphasize them. You can make use of it using commands like "Go to Bracket" ( Syntax CheckingStatic source code analysis can point to syntax errors, which would make the later compilation fail. Parsing of the source code will stop after the first error is encountered. Problems that the compiler can recover from are reported as warnings. You can see all problems in the Problems sidebar: You can also show details about a problem that you focused in-place by the command "Peek Problem" ( Quick FixesSome problems encountered during the syntax check can be corrected automatically. They are reported as warnings. If you hover above the problem location, you will be able to click on "Quick Fix..." ( When executing the command, you will be able to pick a kind of the fix to perform on the source code: AutocompletionAutocompletion with details collapsed: Autocompletion with details expanded: The autocompletion works currently only for the built-in global functions and object methods. Hints on HoverA hint about the usage of a keyword or an identifier will be displayed when hovering the mouse cursor above it. The information is the same as for the autocompletion. The hover hints work currently only for the built-in global functions and object methods. Symbol OutlineSymbols that introduce scopes to the code, like objects, functions or script are displayed in the Outline sidebar or in the document breadcrumb area to help you orientate yourself in the source file. Definition and ReferencesYou can jump to the definition of a variable or a function by the command "Go to Definition" ( You can cycle over references of a variable or a function one-by-one by the command "Go to References" ( You can also list all references of a variable or a function by the command "Find All References" ( The support for definitions and references works currently only for the locally declared variables and functions. RenamingYou can rename a variable or a function by the command "Rename Symbol" ( Identifier renaming works currently only for the locally declared variables and functions. Run ScriptYou can run a script (ending with
Will print "Hello, world!" to the console output. This feature is in the development and depended on the state of oscript-interpreter. SettingsThis extension contributes the following settings. Names of the properties in table are shortened not to occupy so much space. They have to be prefixed by "oscript." to get the full name:
Expected values for the Expected values for the If Planned
NotesIf you keep to the official OScript coding standard, use tabs and set the visual tab size to 4 in
TroubleshootingIf you encounter an unexpected behaviour, inspecting the debug output may help to pinpoint the problem. Diagnostic messages can be enabled by:
If you encounter problems with features supplied by the OScript language server, you can disable them by boolean flags described above. If you encounter performance problems, you can disable all features using the language server and retain just features supplied by the static language description like syntax highlighting:
If you do encounter such problems, file a bug report about it, please. Thank you! ContributingIn lieu of a formal styleguide, take care to maintain the existing coding
style. Run OthersUsers of TextMate can install the OScript Bundle. Other editors with the syntax highlighting for OScript are based on Scintilla, for example. SciTE, Geany, Nodepad++ and others include a colourful theme for the OScript lexer. Web pages can highlight the OScript syntax of a code example using JavaScript. LicenseCopyright (c) 2020-2022 Ferdinand Prantl The logo was based on an original icon published among vscode by Roberto Huertas under the Creative Commons Attribution 4.0 International (CC BY 4.0) license. Thank you! Licensed under the MIT license. |