Complete language support for Qi - A Lisp that flows.
- Keywords:
def,defn,defn-,fn,let,if,do,when,while,until,while-some,until-error,each,match,try,defer,loop,recur,use,export,module - Keyword Literals:
:keywordsyntax - Operators:
- Pipeline operators:
|>,||>,|>?,~> - Match arrows:
->,=> - Spread operator:
... - Arithmetic:
+,-,*,/,%,=,!=,<,>,<=,>=
- Pipeline operators:
- Strings:
- Regular strings:
"hello" - Triple-quoted strings:
"""multi-line""" - F-strings:
f"Hello {name}" - Triple-quoted f-strings:
f"""multi-line with {interpolation}"""
- Regular strings:
- Comments: Line comments with
; - Numbers: Integer and floating-point literals
- Constants:
nil,true,false - Predicates:
nil?,list?,map?,string?,integer?, etc. - Built-in Functions:
atom,deref,swap!,reset!,print,println,error,tap, etc. - Module System: Highlighting for
str/,list/,map/,go/,io/,http/,db/,kvs/, etc.
- Auto-closing pairs:
(),[],{},"" - Bracket matching
- Comment toggling (
;line comments)
- Run Qi File (
Ctrl+F5/Cmd+F5) - Execute current Qi file - Start Qi REPL (
Ctrl+Shift+R/Cmd+Shift+R) - Start interactive REPL - Debug Qi File (
F5) - Debug current file with breakpoints and step execution - Show Documentation - Open Qi documentation
The extension provides full debugging support via the Debug Adapter Protocol (DAP):
- Breakpoints: Set breakpoints by clicking on the gutter
- Step Execution: Step over, step into, step out of functions
- Call Stack: View the current call stack
- Variables: Inspect variables and scopes
- Continue/Pause: Control program execution
- Standard Input: Send input to programs using
.stdincommand
- Open a
.qifile - Set breakpoints by clicking on the line numbers
- Press
F5or click "Debug Qi File" in the command palette - Use the debug toolbar to step through your code
When debugging programs that use io/stdin-line or io/stdin-lines, you can send input via the Debug Console:
Single line input:
.stdin Hello, World!
Multiple lines (use \n for newlines):
.stdin Line 1\nLine 2\nLine 3
Tab-separated values:
.stdin Column1\tColumn2\tColumn3
Example program:
;; test-stdin.qi
(println "Enter your name:")
(def name (io/stdin-line))
(println f"Hello, {name}!")
- Set a breakpoint on line 2
- Start debugging with F5
- Continue to the breakpoint
- Open Debug Console
- Type
.stdin Aliceand press Enter - Continue execution - output will show "Hello, Alice!"
Note: Make sure the Qi executable is built with the dap-server feature:
cargo build --features dap-server --release- Clone this repository
- Copy the
qi-vscodefolder to your VSCode extensions directory:- Windows:
%USERPROFILE%\.vscode\extensions - macOS:
~/.vscode/extensions - Linux:
~/.vscode/extensions
- Windows:
- Reload VSCode
- Install dependencies:
cd qi-vscode npm install - Compile TypeScript:
npm run compile
- Open this folder in VSCode
- Press
F5to launch Extension Development Host - Open a
.qifile to test the extension
The extension can be configured via VSCode settings:
{
"qi.executablePath": "qi",
"qi.enableLinting": true,
"qi.repl.autoStart": false
}qi.executablePath(string, default:"qi") - Path to the Qi executable. Ifqiis in your PATH, you can use"qi". Otherwise, specify the full path.qi.enableLinting(boolean, default:true) - Enable linting (planned).qi.repl.autoStart(boolean, default:false) - Automatically start REPL when opening Qi files.
Qi is a modern Lisp dialect focused on flow-oriented programming with:
- Pipeline operators for data transformation
- Pattern matching with destructuring
- Async/concurrent programming primitives
- Module system with public/private exports
- Rich standard library (HTTP, DB, JSON, CSV, etc.)
;; Pipeline processing
(use str :as s)
(use list :only [take filter])
("hello world"
|> s/upper
|> (s/split " ")
|> (filter (fn [w] (> (s/length w) 4)))
|> first)
;=> "HELLO"
;; F-strings with interpolation
(def name "Alice")
(def age 30)
(println f"Hello, {name}! You are {age} years old.")
;; => Hello, Alice! You are 30 years old.
;; Pattern matching
(match [1 2 3]
[] -> "empty"
[x] -> f"single: {x}"
[x y ...rest] -> f"x={x}, y={y}, rest={rest}")
;=> "x=1, y=2, rest=(3)"
;; Module system
(defn- private-helper []
"Only visible in this module")
(defn public-api [data]
"Public API function"
(private-helper))
(export [public-api])
このVSCode拡張機能のバージョンは、qi-langのバージョンと同期しています。
- 現在のバージョン: 0.1.0
- 対応するqi-langバージョン: 0.1.0
- バージョン管理方式: 手動同期
qi-langのバージョンを更新する際は、以下の手順でこの拡張機能のバージョンも更新してください:
package.jsonのversionフィールドを更新CHANGELOG.mdに変更内容を記録- 新しいバージョンのタグを作成してプッシュ
例:
# package.jsonのバージョンを更新
vim package.json # "version": "0.2.0"に変更
# CHANGELOGを更新
vim CHANGELOG.md # 変更内容を追記
# コミットしてタグを作成
git add package.json CHANGELOG.md
git commit -m "バージョン0.2.0にアップデート"
git tag v0.2.0
git push origin main --tags詳細な変更履歴はCHANGELOG.mdを参照してください。
MIT OR Apache-2.0