Skip to content

Commit

Permalink
Merge pull request #23 from chrehall68/22-improve-variable-completions
Browse files Browse the repository at this point in the history
[Improve] Add variable completions and snippets
  • Loading branch information
chrehall68 authored Nov 22, 2024
2 parents 557fcec + 3c04262 commit a1bb6df
Show file tree
Hide file tree
Showing 8 changed files with 315 additions and 162 deletions.
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A language server for Verilog",
"author": "chrehall68",
"license": "MIT",
"version": "1.0.4",
"version": "1.0.5",
"repository": {
"type": "git",
"url": "https://github.com/chrehall68/vls"
Expand Down
49 changes: 49 additions & 0 deletions server/internal/lang/keywords.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package lang

var Keywords = []string{
"endmodule",
"begin",
"end",
"endcase",
"endgenerate",
"assign",
"initial",
"negedge",
"posedge",
"default",
"endtask",
"include",
"define",
"timescale",
"wire",
"reg",
"genvar",
"parameter",
"integer",
"input",
"output",
"inout",
"defparam",
}
var Snippets = map[string]string{
"module": "module $1();\nendmodule",
"generate": "generate\nendgenerate",
"case": "case ($1)\nendcase",
"task": "task $1();\nendtask",
"if": "if ($1) begin\nend",
"else": "else begin\nend",
"for": "for ($1; $2; $3) begin\nend",
"always": "always @($1) begin\nend",
"buf": "buf ${1:name}(${2:a}, ${3:b});",
"not": "not ${1:name}(${2:a}, ${3:b});",
"and": "and ${1:name}(${2:a}, ${3:b});",
"or": "or ${1:name}(${2:a}, ${3:b});",
"xor": "xor ${1:name}(${2:a}, ${3:b});",
"xnor": "xnor ${1:name}(${2:a}, ${3:b});",
"nand": "nand ${1:name}(${2:a}, ${3:b});",
"nor": "nor ${1:name}(${2:a}, ${3:b});",
"bufif0": "bufif0 ${1:name}(${2:a}, ${3:b}, ${4:c});",
"bufif1": "bufif1 ${1:name}(${2:a}, ${3:b}, ${4:c});",
"notif0": "notif0 ${1:name}(${2:a}, ${3:b}, ${4:c});",
"notif1": "notif1 ${1:name}(${2:a}, ${3:b}, ${4:c});",
}
Loading

0 comments on commit a1bb6df

Please sign in to comment.