This document is still a WIP
Welcome to the Systemtap language server guide. The language server implements the language-server-protocol and currently supports the following features
When features are added, make sure to update the above
The language-server, which can be run with stap --language-server, will start a process that will communicate with the parent language-server-client using stdio. Below describes some tested clients, and how to set them up to run the language server
# For unix installation $ curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
" The Vim Language-Server plugins call plug#begin() Plug 'prabirshrestha/vim-lsp' Plug 'prabirshrestha/asyncomplete.vim' Plug 'prabirshrestha/asyncomplete-lsp.vim' call plug#end() " Optional logs " let g:lsp_log_verbose = 1 " let g:lsp_log_file = expand('LOG_FILE_NAME.log') " Tab Completion " Tab and Shift-Tab back and forth through completion options " Tab Ctrl-y to accept a completion inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" inoremap <expr> <cr> pumvisible() ? "\<C-y>\<cr>" : "\<cr>" if (executable('stap')) autocmd User lsp_setup call lsp#register_server({ \ 'name': 'systemtap-language-server', \ 'cmd': {server_info->['stap', '--language-server']}, \ 'whitelist': ['stp'] \ }) endif
PlugInstallM-x package-install RET lsp-mode RETlsp-mode, systemtap-mode, company are installed(require 'lsp-mode) ; The language-server client (require 'systemtap-mode) ; Provides the major mode - systemtap-mode (require 'company) ; The library response for the code completion frontend ; Register the systemtaptap mode with the lsp-mode (with-eval-after-load 'lsp-mode (with-eval-after-load 'systemtap-mode (add-to-list 'lsp-language-id-configuration '(systemtap-mode . "systemtap")) ) ) ; Configurations (setq company-idle-delay 0.0 ; How fast to response to typed input company-minimum-prefix-length 1 ; The prefix length before auto completing lsp-idle-delay 0.1 ; stap --language-server is fast ) (lsp-register-client (make-lsp-client :new-connection (lsp-stdio-connection '("stap" "--language-server")) :activation-fn (lsp-activate-on "systemtap") :server-id 'stap-ls))
M-x lsp while a .stp file is openC-h or <F1>$ pip install jupyterlab-lsp
{ "LanguageServerManager": { "language_servers": { "stap-language": { "version": 2, "argv": ["stap", "--language-server"], "debug_argv": ["stap", "--language-server", "-v"], "languages": ["systemtap"], "mime_types": ["text/systemtap", "text/x-systemtap"], "display_name": "systemtap-language-server" } } } }
#!/bin/bash CONFIG_FILE="jupyter_stap_lsp.json" JCONFIG=`jupyter --config` cp $CONFIG_FILE "$JCONFIG/jupyter_server_config.d/$CONFIG_FILE" jupyter server extension enable --user --py jupyter_lsp
This is the development usage, and a proper vscode extension should be published
vscode-workspace-root-directory ├── .vscode │ ├── launch.json // Launch configuration │ ├── settings.json │ └── tasks.json │ ├── src // Language Client │ └── client.ts // Language Client entry point │ ├── package.json // The extension manifest │ └── tsconfig.json // TypeScript compiler options
The above files should be in the root of the vscode current working directory
npm install package.jsonctrl + shift + D)Launch Client and press Start Debbuging (Play Button / F5)This is the development usage, and a proper eclipse plugin should be published
Run As > Eclipse ApplicationIf you use a another client, please feel free to submit a patch to the above with the added usage recipe