Logtalk for VSCodeA VSCode extension which provides language support for Logtalk. Forked from the original plugin by Arthur Wang. Developed and tested in Logtalk 3.78.0 and VSCode 1.88.1 on macOS 14.4 and Windows 10 with Node 21. 🙏 Sponsored by Permion and GitHub Sponsors. Features | Configuration | Known Issues | Development | Acknowledgements | Licence InstallationThis extension can be installed directly from VSCode, from its Marketplace, or by downloading its This extension must be configured before it can be used. Notably, the following settings are required:
For details, see Configuration. FeaturesSyntax highlighting
Indentation, snippets and auto-completion
Note: Relations between entities use choice snippets: The snippets for built-ins all are triggered by natural prefix, i.e. Refer to the table below for other snippets:
Linter
CommandsWorkspace commandsWorkspace commands can be triggered from command palette via entering 'Logtalk' to pop up the list of all commands of this extension. Alternatively, Ctrl+click (Windows, Linux, BSD, ...) or Cmd+click (macOS) in a Logtalk source file in the Explorer.
The output of the Directory and source file specified commandsThese commands can be triggered from editor/context and explorer/context menus via right click editor area or Logtalk files in explorer area respectively. In explorer context, the file name at which right click occurs will be passed in the command as argument. File specified commands can also be triggered from command palette so that active file name in the editor will be passed in the command.
Code NavigationCode navigation experimental features require the code to be loaded, typically by opening the project loader file and selecting the "Load File" menu or context menu item.
Additionally, code must be compiled with the Code navigation support require Logtalk 3.78.0 or a later version. Go to DeclarationClick in a predicate name and select the "Go to Declaration" menu or context menu item to go to the predicate scope directive. Go to DefinitionClick in a predicate name in a goal or Go to Type DefinitionEntities (objects, protocols, and categories) are interpreted as types. Click in an entity name and select the "Go to Type Definition" menu or context menu item to go to the entity opening directive. Go to ReferencesClick in a predicate name in a scope directive, goal, or Click in an entity name in its entity opening directive to find references to it in other entity opening directives (i.e. entities in an implementing, importing, complementing, extending, instantiating, or specializing relation with the with the selected entity), Go to ImplementationsClick in the middle of a predicate name in a scope directive and select the "Go to Implementations" or "Find All Implementations" menu or context menu items. Note that you can go to a predicate scope directive by clicking the predicate name in a goal and selecting the "Go to Declaration" menu or context menu item. Go to Symbol in Editor...Symbols include object, protocol, and category identifiers in entity opening directives plus predicate (and non-terminal) indicators in predicate scope directives. Note that VSCode doesn't support customization of symbol kind names and icons, thus forcing adapting the pre-defined names and icons. This feature doesn't require the code to be loaded. Assumes that a single predicate (or non-terminal) is declared per scope directive. Go to Symbol in Workspace...Symbols include object, protocol, and category identifiers in entity opening directives plus predicate (and non-terminal) indicators in predicate scope directives. Note that VSCode doesn't support customization of symbol kind names and icons, thus forcing adapting the pre-defined names and icons. This feature doesn't require the code to be loaded. Assumes that a single predicate (or non-terminal) is declared per scope directive. Show Call HierarchyClick in the middle of a predicate name in a goal or in a clause head and select the "Show Call Hierarchy" context menu item to browse callers and callees of the selected predicate. Note that callers and callees that can only be resolved at runtime (e.g. in a message to self goal or when dynamic predicates are used) may not be returned. Show Type HierarchyClick in the middle of an entity name and select the "Show Type Hierarchy" context menu item to browse ancestors and descendants of the selected entity. Here, ancestor is interpreted as any entity from which the selected entity inherits and descendant is interpreted as any entity that inherits from the selected entity. Hover contentsHover contents is provided for built-in directives, built-in predicates, and built-in methods. ConfigurationThe user can configure settings via VSCode menu Logtalk home and user paths
No defaults (VSCode doesn't support using environment variables to define settings). Must be set to the Logtalk executable
Logtalk executable or integration script plus its arguments. On POSIX systems (e.g. macOS, Linux, or BSD), the
On Windows systems, use the absolute path to the Prolog backend executable and then set the arguments to load Logtalk (look into the properties of the Logtalk integration shortcuts that are available from the Start Menu after installing Logtalk). For example (assuming the default Logtalk installation) and using SWI-Prolog as the backend:
Logtalk project testers
Automation script for running tests and its arguments. The arguments must included at least the Prolog backend. For example, assuming a POSIX system (e.g. macOS, Linux, or BSD) and using SWI-Prolog as the backend:
On Windows systems, these settings must be set differently. For example (assuming the default Logtalk installation) and using SWI-Prolog as the backend:
Logtalk project doclets
Automation script for running doclets and its arguments. The arguments must included at least the Prolog backend. For example, assuming a POSIX system (e.g. macOS, Linux, or BSD) and using SWI-Prolog as the backend:
On Windows systems, these settings must be set differently. For example (assuming the default Logtalk installation) and using SWI-Prolog as the backend:
Logtalk project documentation
Documentation script and its arguments for converting the XML files generated by the Logtalk
On Windows systems, these settings must be set differently. For example (assuming the default Logtalk installation):
Logtalk project diagrams
Script and its arguments for converting the On Windows systems, these settings must be set differently. For example (assuming the default Logtalk installation):
Diagrams script for converting the Timeout for waiting to run conversion scripts
The number of milliseconds to wait before running the scripts that convert Known IssuesOn Windows systems, the file paths on the "Problems" pane are not relative to the workspace directory. On Windows systems, some Prolog backends such as ECLiPSe and XSB are not usable due to file path representation issues. Also, GNU Prolog cannot be used as it starts a GUI shell instead of running on the terminal. If you're migrating from the old "VSC-Logtalk" extension, you may see duplicated context menu items even after uninstalling it. If that happens, delete any extension leftovers in the DevelopmentThis extension has been package and tested with Node 21. After running See the CHANGELOG.md file for the most recent changes. Contributions and bug reports are most welcome. AcknowledgementsDue to Arthur's current unavailability and since-deprecated modules, this extension has been adopted by new maintainers. Arthur Wang (Original Author)"The original author of this extension thanks Professor Paulo Moura who is the author of Logtalk for his patient help and support. Syntax highlighting, some snippets, and some commands are integrated from his distro of Logtalk." LicenseThis extension is published under the MIT license. |