Skip to content

Commit

Permalink
Add infos on scoped completion
Browse files Browse the repository at this point in the history
  • Loading branch information
suzizecat committed Dec 30, 2024
1 parent e4eaac5 commit 240bf02
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion diplomat-lsp-src/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'Julien FAUCHER'

# The full version, including alpha/beta/rc tags
release = '0.2.0'
release = '0.3.0-dev'


# -- General configuration ---------------------------------------------------
Expand Down
10 changes: 10 additions & 0 deletions diplomat-lsp-src/source/introduction/intro.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Introduction
============

Diplomat is a bundle of tools used to ease the development and debugging of SystemVerilog designs.
While its aim is to be as complete and useful as possible in a seamless and straightforward way,
it cannot be guaranteed to work without bugs or issues.

If you found bugs, usability problems or missing features, please drop a word by raising an issue against the element that seems to cause an issue:
* The `VSCode extension <https://github.com/suzizecat/diplomat-vscode/issues>`_ is reponsible for the GUI and everything not related to code analysis proper.
* The `Language server <https://github.com/suzizecat/slang-lsp-tools/issues>`_ is reponsible for providing informations about the design to the extension.


VS Code extension
------------------

Expand All @@ -11,6 +20,7 @@ is the provided client for interfacing with Diplomat Server.
It features:
* Workspace analysis using the `slang <https://github.com/MikePopoloski/slang>`_ open source SystemVerilog compiler.
* Error checking and elaboration-level linting
* Scope-aware autocompletion suggestions
* Jump to definition/reference across files
* Syntax coloration
* Rename symbol
Expand Down
30 changes: 30 additions & 0 deletions diplomat-lsp-src/source/vscode/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,36 @@ Only the following warnings are ignored:
.. note:: When a top level module is specified, the design is elaborated before reporting the errors and warning.
Thus effectively ommiting diagnostics from file that are not used in the design.

Completion suggestions
----------------------

*Available since Diplomat Server 0.3.0*


Using the language server analysis capabilities, Diplomat provide autocompletion suggestion to VSCode.
Those completion propositions will be made available on-the-fly when typing code in a file that is processed by the language server.

A file is available for autocompletion as long as :
* It defines at least one element used in the current projet (it is present in the design hierarchy)
* It is not excluded from diplomat paths
* The index has been built (the parsing and analysis of the file went well).

The completion will propose any processed symbol **which has been declared before the cursor position** and which is visible in the current scope.
This is done in order to avoid "used before declaration" errors.
In example, in the following code, using completion on the highlighted line would only show ``foo`` but not ``bar``

.. code-block:: sv
:linenos:
:emphasize-lines: 2
logic foo;
assign // Trigger here
logic bar;
By default, the completion is triggered by typing almost anything.
It may also be triggered manually by using the ``Ctrl + Space`` shortcut (default binding).


Code navigation
--------------------

Expand Down

0 comments on commit 240bf02

Please sign in to comment.