diff --git a/configs/verilog.configuration.json b/configs/verilog.configuration.json index 7a70ef59..cc838dc2 100644 --- a/configs/verilog.configuration.json +++ b/configs/verilog.configuration.json @@ -1,44 +1,41 @@ -{ - "comments": { - "lineComment": "//", - "blockComment": [ "/*", "*/" ] - }, - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["begin", "end"], - ["case", "endcase"], - ["casex", "endcase"], - ["casez", "endcase"], - ["checker", "endchecker"], - ["class", "endclass"], - ["clocking", "endclocking"], - ["config", "endconfig"], - ["covergroup", "endgroup"], - ["fork", "join"], - ["fork", "join_any"], - ["fork", "join_none"], - ["function", "endfunction"], - ["generate", "endgenerate"], - ["interface", "endinterface"], - ["macromodule", "endmodule"], - ["module", "endmodule"], - ["package", "endpackage"], - ["primitive", "endprimitive"], - ["program", "endprogram"], - ["property", "endproperty"], - ["randcase", "endcase"], - ["specify", "endspecify"], - ["sequence", "endsequence"], - ["table", "endtable"], - ["task", "endtask"] - ], +// Copyright (c) 2021 xiaohuyz - "autoClosingPairs": [ - {"open":"(", "close":")"}, - {"open":"[", "close":"]"}, - {"open":"{", "close":"}"}, - {"open":"\"", "close":"\"", "notIn":["string"]} - ] -} +{ + "comments": { + "lineComment": "//", + "blockComment": [ "/*", "*/" ] + }, + // symbols used as brackets + "brackets": [["{", "}"], ["[", "]"], ["(", ")"]], + // symbols that are auto closed when typing + "autoClosingPairs": [ + { "open": "{", "close": "}" }, + { "open": "[", "close": "]" }, + { "open": "(", "close": ")" }, + { "open": "\"", "close": "\"", "notIn": ["string", "comment"]}, + { "open": "/*", "close": "*/", "notIn": ["string"]}, + ], + // symbols that that can be used to surround a selection + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["/* ", " */"] + ], + "wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)", + "indentationRules": { + "increaseIndentPattern": "^\\s*(((priority|unique|unique0)\\s+)?(case|casex|casez)|checker|(virtual\\s+)?class|config|covergroup|generate|interface|module|package|primitive|program|property|randcase|randsequence|sequence|specify|((virtual\\s+)?((local|protected|static)\\s+)?|(local|protected|static)\\s+(virtual\\s+)?)(function|task))\\b|^((?!\\/\\/|\\/\\*).)*\\bbegin\\b(?!.*\\bend\\b)|^((?!\\/\\/|\\/\\*|\\bdisable\\b|\\bwait\\b).)*\\bfork\\b(?!.*\\b(join(_any|_none|))\\b)|^((?!\\/\\/|\\/\\*).)*\\{\\s*((\\/\\/|\\/\\*).*|$)|^\\s*((default|global)\\s+)?(clocking\\b).*\\@", + "decreaseIndentPattern": "^\\s*(end(case|checker|class|clocking|config|function|generate|group|interface|module|package|primitive|program|property|sequence|specify|task)\\b)|^\\s*end\\b|^\\s*join(_any|_none|)\\b|^\\s*\\}", + // sadly there is no option to include multi lines... so this rule fails on the first unterminated block comment line. Life is cruel. ^^ + // "indentNextLinePattern": "^(?!.*(begin|end|fork|join|\\`\\w+(\\(.*\\))?|\\;|\\{)\\s*(\\/\\/|\\/\\*)?).*[^\\s;{}]\\s*$", + // unIndented contains: comments, macros, attributes + "unIndentedLinePattern": "^\\s*(\\/\\/|\\/\\*|\\`\\w+|\\(\\*).*$" + }, + "folding": { + "markers": { + "start": "^\\s*(`celldefine|`ifdef|`ifndef|`pragma\\s+protect\\b.*\\b(begin|begin_protected)\\b|`unconnected_drive)\\b|^\\s*(((priority|unique|unique0)\\s+)?(case|casex|casez)|checker|(virtual\\s+)?class|config|covergroup|generate|interface|module|package|primitive|program|property|randcase|randsequence|sequence|specify|(virtual\\s+)?((local|protected|static)\\s+)?(function|task))\\b|^((?!\\/\\/|\\/\\*).)*\\bbegin\\b(?!.*\\bend\\b)|^((?!\\/\\/|\\/\\*|\\bdisable\\b|\\bwait\\b).)*\\bfork\\b(?!.*\\b(join(_any|_none|))\\b)|^((?!\\/\\/|\\/\\*).)*\\{\\s*((\\/\\/|\\/\\*).*|$)|^\\s*((default|global)\\s+)?(clocking\\b).*\\@", + "end": "^\\s*(`endcelldefine|`endif|`nounconnected_drive|`pragma\\s+protect\\b.*\\b(end|end_protected)|`resetall)\\b|^\\s*(end(case|checker|class|clocking|config|function|generate|group|interface|module|package|primitive|program|property|sequence|specify|task)\\b)|^\\s*end\\b|^\\s*join(_any|_none|)\\b|^\\s*\\}" + } + } +} \ No newline at end of file diff --git a/configs/vhdl.configuration.json b/configs/vhdl.configuration.json index bb3db93d..87192304 100644 --- a/configs/vhdl.configuration.json +++ b/configs/vhdl.configuration.json @@ -1,3 +1,5 @@ +// Copyright (c) 2019 Rich J. Young + { "comments": { "lineComment": "--", @@ -15,11 +17,22 @@ ["\"", "\""], ["'", "'"] ], + "autoCloseBefore": ";:,=])\n\t", "surroundingPairs": [ ["{", "}"], ["[", "]"], ["(", ")"], ["\"", "\""], ["'", "'"] - ] + ], + "wordPattern": "(?New features