Welcome to the PSS Language Server project, a dedicated backend service for providing robust language support for Accellera's Portable Stimulus Standard (PSS) across any IDE that supports the LSP protocol.
- Syntax Analysis: Fast and accurate parsing for PSS source files.
- Code Completion: Intelligent suggestions for PSS keywords, types, functions, and user-defined elements.
- Signature Help: Display function signatures with parameter descriptions.
- Diagnostics: Inline error detection and syntax validation.
- Hover Documentation: Detailed tooltips for PSS constructs.
- Embedded Code Support: Parsing and diagnostics for embedded C and SystemVerilog code.
Ensure NodeJS is installed on your system. If not, just get it from here
Just run npm i -g pss-langserver
and start it using pss-langserver
. To update to latest version (if already installed), run npm update -g
.
-
Clone the repository:
git clone https://github.com/thisisthedarshan/pss-langserver.git cd pss-langserver
-
Install dependencies:
npm install
-
Build the project:
npm run build
-
Start the language server in development mode:
npm run dev
Before integrating with any IDE, please ensure you have installed the language server globally by running:
npm install -g pss-langserver
This installs the pss-langserver
command, which you can start using the --stdio
option (among others).
-
Install the Extension:
- Visit the VS Code Marketplace and download it directly
- Or visit the Project Repository and follow the Installation Guide
- Or Open VS Code and navigate to the Extensions view (Ctrl+Shift+X on Windows/Linux or Cmd+Shift+X on macOS). Search for Darshan.dsp-vsc-pss click Install.
- Or Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter:
ext install darshan.dsp-vsc-pss
-
Configure Workspace Settings:
-
Open VS Code settings (via File β Preferences β Settings or by clicking the gear icon).
-
Under the extensionβs section (titled "PSS Support"), set the following options:
- PSS.tabspaces: Number of tab spaces to use (default is 4; allowed values: 1β9).
- PSS.fileAuthor: Specify the author name for automated file headers.
-
Alternatively, add the following to your workspace or user
settings.json
:{ "PSS.tabspaces": 4, "PSS.fileAuthor": "" }
-
-
Install a Plugin Manager:
- If you donβt have one already, install vim-plug.
-
Install an LSP Client Plugin:
- For example, using coc.nvim:
-
Add this to your
~/.vimrc
:call plug#begin('~/.vim/plugged') Plug 'neoclide/coc.nvim', {'branch': 'release'} call plug#end()
-
Restart VIM and run
:PlugInstall
.
-
- For example, using coc.nvim:
-
Configure the Language Server in coc.nvim:
-
Create or update your
~/.vim/coc-settings.json
with the following:{ "languageserver": { "pss": { "command": "pss-langserver", "args": ["--stdio"], "filetypes": ["pss"], "rootPatterns": ["*.pss"], "initializationOptions": { "PSS": { "tabspaces": 4, "fileAuthor": "" } } } } }
-
-
Workspace Configuration:
- Make sure your VIM workspace (or project folder) includes your
.pss
files. Coc.nvim will automatically activate the language server when you open such a file.
- Make sure your VIM workspace (or project folder) includes your
-
Install a Plugin Manager:
- If needed, use vim-plug.
-
Install nvim-lspconfig:
-
Add this to your
init.vim
orinit.lua
:call plug#begin('~/.local/share/nvim/plugged') Plug 'neovim/nvim-lspconfig' call plug#end()
-
Run
:PlugInstall
within NeoVim.
-
-
Configure the Language Server:
-
In your
init.lua
(or equivalent), add:require('lspconfig').pss_langserver = { default_config = { cmd = {"pss-langserver", "--stdio"}, filetypes = {"pss"}, root_dir = function(fname) return lspconfig.util.root_pattern("*.pss")(fname) or lspconfig.util.path.dirname(fname) -- Fallback to the file's directory end, settings = { PSS = { tabspaces = 4, fileAuthor = "" } } } } require('lspconfig').pss_langserver.setup{}
-
- Replace
"pss_langserver"
with your desired server name if necessary.
- Workspace Setup:
- Ensure that your project directories containing
.pss
files are opened in NeoVim, so the language server activates automatically.
- Ensure that your project directories containing
GVIM uses the same configuration as VIM. Follow these steps:
-
Install a Plugin Manager:
- Use vim-plug if not already installed.
-
Install an LSP Client Plugin:
- Add coc.nvim as shown in the VIM section to your GVIM configuration.
-
Configure the Language Server:
-
Update your
coc-settings.json
(usually located in your home directory or GVIM configuration folder) with the same settings as for VIM:{ "languageserver": { "pss": { "command": "pss-langserver", "args": ["--stdio"], "filetypes": ["pss"], "rootPatterns": ["*.pss"], "initializationOptions": { "PSS": { "tabspaces": 4, "fileAuthor": "" } } } } }
-
-
Restart GVIM:
- Restart GVIM to load the new configuration. Files with the
.pss
extension will trigger the language server.
- Restart GVIM to load the new configuration. Files with the
-
Install lsp-mode:
-
Configure MELPA in your Emacs configuration (
init.el
or equivalent):(require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) (package-initialize) (unless (package-installed-p 'lsp-mode) (package-refresh-contents) (package-install 'lsp-mode))
-
-
Configure lsp-mode for the PSS Language Server:
-
Add the following configuration snippet to your Emacs configuration:
(require 'lsp-mode) ;; Associate .pss files with a custom major mode if needed (add-to-list 'auto-mode-alist '("\\.pss\\'" . text-mode)) (lsp-register-client (make-lsp-client :new-connection (lsp-stdio-connection '("pss-langserver" "--stdio")) :activation-fn (lsp-activate-on "pss") :server-id 'pss-ls :initialized-fn (lambda (workspace) (with-lsp-workspace workspace (lsp--set-configuration `(:PSS (:tabspaces 4 :fileAuthor "")))))) )) ;; Optional: Automatically start lsp-mode for .pss files (add-hook 'text-mode-hook #'lsp)
-
This registers the language server for files identified with
.pss
and sets the initial configuration forPSS.tabspaces
andPSS.fileAuthor
.
-
-
Workspace and File Setup:
- Open any
.pss
file in EMACS, and lsp-mode will automatically activate the PSS language server with the specified settings.
- Open any
- Explore the Portable Stimulus Standard (PSS) Specification.
- Read the official PSS 3.0 Language Reference Manual.
Contributions are welcome! If you would like to contribute, please:
- Fork the repository.
- Create a new branch.
- Submit a pull request with a detailed description of your changes.
This project is released under the GNU General Public License v3.0.