The extension automatically starts wyn lsp when you open a .wyn file. Make sure wyn is in your PATH:
wyn install # or add wyn to PATH manually
LSP provides:
Completions — all keywords, 27 modules with method hints, triggered by .
Hover — type information
Go to Definition — jump to function/struct definitions
Find References — find all usages
Rename — rename symbols across files
Format — format document
Highlighted
Category
Tokens
Keywords
fn var const struct enum impl trait type pub import export module
Flow
return break continue spawn await if else match while for in
Modifiers
mut
Types
int float string bool void ResultInt OptionInt
Modules
File System Terminal HashMap Math Path DateTime Json Regex Csv Http Net Db Task Gui Audio StringBuilder Crypto Encoding Os Uuid Log Process Test Url
Constants
true false None Some Ok Err
Example
struct Server {
port: int
name: string
fn start(self) -> int {
var srv = Http.serve(self.port)
println("${self.name} running on ${self.port.to_string()}")
return srv
}
}
fn main() -> int {
var s = Server{port: 8080, name: "MyApp"}
s.start()
return 0
}