diff --git a/bin/assets/plugins/formatters.json b/bin/assets/plugins/formatters.json index 3605d0d2f..f68cd1d56 100644 --- a/bin/assets/plugins/formatters.json +++ b/bin/assets/plugins/formatters.json @@ -9,34 +9,40 @@ { "language": ["javascript", "typescript", "JSX"], "file_patterns": ["%.js$", "%.ts$", "%.jsx$", "%.tsx$"], - "command": "prettier $FILENAME" + "command": "prettier $FILENAME", + "url": "https://prettier.io" }, { "language": ["c", "cpp", "objective-c"], "file_patterns": ["%.inl$", "%.cpp$", "%.hpp$", "%.cc$", "%.cxx$", "%.c++$", "%.hh$", "%.hxx$", "%.h++$", "%.objcpp$", "%.m$"], - "command": "clang-format --style=file $FILENAME" + "command": "clang-format --style=file $FILENAME", + "url": "https://clang.llvm.org/docs/ClangFormat.html" }, { "language": "python", "file_patterns": ["%.py$", "%.pyw$"], "command": "black $FILENAME", - "type": "inplace" + "type": "inplace", + "url": "https://black.readthedocs.io/en/stable/" }, { "language": "kotlin", "file_patterns": ["%.kt$"], "command": "ktlint -F $FILENAME", - "type": "inplace" + "type": "inplace", + "url": "https://pinterest.github.io/ktlint/" }, { "language": "rust", "file_patterns": ["%.rs"], - "command": "rustfmt --emit stdout --color never $FILENAME" + "command": "rustfmt --emit stdout --color never $FILENAME", + "url": "https://rust-lang.github.io/rustfmt/" }, { "language": "go", "file_patterns": ["%.go"], - "command": "gopls format $FILENAME" + "command": "gopls format $FILENAME", + "url": "https://pkg.go.dev/golang.org/x/tools/gopls" }, { "language": "json", @@ -60,17 +66,20 @@ "language": "zig", "file_patterns": ["%.zig"], "command": "zig fmt $FILENAME", - "type": "inplace" + "type": "inplace", + "url": "https://ziglang.org" }, { "language": "haskell", "file_patterns": ["%.hs$"], - "command": "ormolu $FILENAME" + "command": "ormolu $FILENAME", + "url": "https://github.com/tweag/ormolu" }, { "language": "v", "file_patterns": ["%.v$"], - "command": "v fmt $FILENAME" + "command": "v fmt $FILENAME", + "url": "https://vlang.io" } ] } diff --git a/bin/assets/plugins/linters.json b/bin/assets/plugins/linters.json index 705a48cdd..b0348eafb 100644 --- a/bin/assets/plugins/linters.json +++ b/bin/assets/plugins/linters.json @@ -8,7 +8,8 @@ "file_patterns": ["%.php$"], "warning_pattern": "[%a ]+:%s+(.*)%s+in%s.*on%sline%s+(%d+)", "warning_pattern_order": { "line": 2, "col": 0, "message": 1 }, - "command": "php -l $FILENAME" + "command": "php -l $FILENAME", + "url": "https://www.php.net" }, { "language": "json", @@ -18,54 +19,62 @@ "command": "jq -e . $FILENAME", "expected_exitcodes": [1, 2, 3, 4], "no_errors_exit_code": 0, - "use_tmp_folder": true + "use_tmp_folder": true, + "url": "https://stedolan.github.io/jq/" }, { "language": ["javascript", "typescript", "JSX"], "file_patterns": ["%.js$", "%.ts$", "%.jsx$", "%.tsx$"], "warning_pattern": "[^:]:(%d+):(%d+): ([^%[]+)%[([^\n]+)", "warning_pattern_order": { "line": 1, "col": 2, "message": 3, "type": 4 }, - "command": "eslint --no-ignore --format unix $FILENAME" + "command": "eslint --no-ignore --format unix $FILENAME", + "url": "https://eslint.org" }, { "language": "lua", "file_patterns": ["%.lua$"], "warning_pattern": "[^:]:(%d+):(%d+):[%s]?([^\n]+)", - "command": "luacheck $FILENAME --formatter=plain -g --no-max-line-length" + "command": "luacheck $FILENAME --formatter=plain -g --no-max-line-length", + "url": "https://github.com/mpeterv/luacheck" }, { "language": "python", "file_patterns": ["%.py$"], "warning_pattern": "[^:]:(%d+):(%d+):%s([^\n]+)", - "command": "ruff $FILENAME" + "command": "ruff $FILENAME", + "url": "https://ruff.rs" }, { "language": "bash", "file_patterns": ["%.sh$"], "warning_pattern": "[^:]:(%d+):(%d+):%s?([^%s]*)([^\n]*)", "warning_pattern_order": { "line": 1, "col": 2, "message": 4, "type": 3 }, - "command": "shellcheck -f gcc $FILENAME" + "command": "shellcheck -f gcc $FILENAME", + "url": "https://www.shellcheck.net" }, { "language": "solidity", "file_patterns": ["%.sol$"], "warning_pattern": "(%d+):(%d+)%s.(%w*)%s.([^\n]*)", "warning_pattern_order": { "line": 1, "col": 2, "message": 4, "type": 3 }, - "command": "solhint $FILENAME" + "command": "solhint $FILENAME", + "url": "https://protofire.github.io/solhint/" }, { "language": ["c", "cpp"], "file_patterns": ["%.inl$", "%.cpp$", "%.hpp$", "%.cc$", "%.cxx$", "%.c++$", "%.hh$", "%.hxx$", "%.h++$", "%.objcpp$"], "warning_pattern": "$FILENAME:(%d+):(%d+):%s?([^%s]*)([^\n]*)", "warning_pattern_order": { "line": 1, "col": 2, "message": 4, "type": 3 }, - "command": "cppcheck --language=c++ --enable=all --template=gcc $FILENAME" + "command": "cppcheck --language=c++ --enable=all --template=gcc $FILENAME", + "url": "https://github.com/danmar/cppcheck" }, { "language": "kotlin", "file_patterns": ["%.kt$"], "warning_pattern": "[^:]:(%d+):(%d+):%s([^\n]+)", "warning_pattern_order": { "line": 1, "col": 2, "message": 3, "type": 4 }, - "command": "ktlint $FILENAME" + "command": "ktlint $FILENAME", + "url": "https://pinterest.github.io/ktlint/" }, { "language": "zig", @@ -74,7 +83,8 @@ "warning_pattern_order": { "line": 1, "col": 2, "message": 4, "type": 3 }, "command": "zig ast-check $FILENAME", "deduplicate": true, - "expected_exitcodes": [0, 1] + "expected_exitcodes": [0, 1], + "url": "https://ziglang.org" }, { "language": "nim", @@ -84,28 +94,32 @@ "warning_pattern_order": { "line": 1, "col": 2, "message": 4, "type": 3 }, "deduplicate": true, "expected_exitcodes": [0, 1], - "use_tmp_folder": true + "use_tmp_folder": true, + "url": "https://nim-lang.org" }, { "language": "nelua", "file_patterns": ["%.nelua$"], "warning_pattern": "[^:]:(%d+):(%d+):%s([%w%s]*):%s?([^\n]*)", "warning_pattern_order": { "line": 1, "col": 2, "message": 4, "type": 3 }, - "command": "nelua --lint $FILENAME" + "command": "nelua --lint $FILENAME", + "url": "https://nelua.io" }, { "language": "teal", "file_patterns": ["%.tl$"], "warning_pattern": "[^:]:(%d+):(%d+):[%s]?([^\n]+)", "command": "tl check $FILENAME", - "expected_exitcodes": [0] + "expected_exitcodes": [0], + "url": "https://github.com/teal-language/tl" }, { "language": "haskell", "file_patterns": ["%.hs$"], "warning_pattern": "$FILENAME:(%d+):(%d+):%s(%w*):%s([^\n]*)", "warning_pattern_order": { "line": 1, "col": 2, "message": 4, "type": 3 }, - "command": "hlint --color=never -j $FILENAME" + "command": "hlint --color=never -j $FILENAME", + "url": "https://github.com/ndmitchell/hlint" } ] } diff --git a/src/eepp/ui/doc/syntaxdefinitionmanager.cpp b/src/eepp/ui/doc/syntaxdefinitionmanager.cpp index f6028e143..af3acbbea 100644 --- a/src/eepp/ui/doc/syntaxdefinitionmanager.cpp +++ b/src/eepp/ui/doc/syntaxdefinitionmanager.cpp @@ -1439,8 +1439,11 @@ static void addRust() { { { { "//.-\n" }, "comment" }, { { "/%*", "%*/" }, "comment" }, + { { "r#\"", "\"#", "\\" }, "string" }, { { "\"", "\"", "\\" }, "string" }, { { "`", "`", "\\" }, "string" }, + { { "'.'" }, "string" }, + { { "'%a+" }, "keyword2" }, { { "0[oO_][0-7]+" }, "number" }, { { "-?0x[%x_]+" }, "number" }, { { "-?%d+_%d" }, "number" }, @@ -3608,6 +3611,7 @@ static void addElixir() { { { "\"\"\"", "\"\"\"", "\\" }, "string" }, { { "\"", "\"", "\\" }, "string" }, { { "'", "'", "\\" }, "string" }, + { { "~%a\"\"\"", "\"\"\"" }, "string" }, { { "~%a[/\"|'%(%[%{<]", "[/\"|'%)%]%}>]", "\\" }, "string" }, { { "-?0x%x+" }, "number" }, { { "-?%d+[%d%.eE]*f?" }, "number" }, diff --git a/src/tools/ecode/featureshealth.cpp b/src/tools/ecode/featureshealth.cpp index c13171668..3900b4f45 100644 --- a/src/tools/ecode/featureshealth.cpp +++ b/src/tools/ecode/featureshealth.cpp @@ -65,6 +65,7 @@ std::vector FeaturesHealth::getHealth( PluginManager lang.linter.name = String::split( found.command, ' ' )[0]; lang.linter.path = Sys::which( lang.linter.name ); lang.linter.found = !lang.linter.path.empty(); + lang.linter.url = found.url; } } @@ -78,6 +79,7 @@ std::vector FeaturesHealth::getHealth( PluginManager lang.formatter.path = Sys::which( lang.formatter.name ); lang.formatter.found = !lang.formatter.path.empty() || found.type == FormatterPlugin::FormatterType::Native; + lang.formatter.url = found.url; } } @@ -133,9 +135,18 @@ std::string FeaturesHealth::generateHealthStatus( PluginManager* pluginManager, if ( OutputFormat::Markdown == format && !ht.lsp.name.empty() && !ht.lsp.url.empty() ) { lspName = "[" + ht.lsp.name + "](" + ht.lsp.url + ")"; } + std::string linterName = ht.linter.name.empty() ? "None" : ht.linter.name; + if ( OutputFormat::Markdown == format && !ht.linter.name.empty() && + !ht.linter.url.empty() ) { + linterName = "[" + ht.linter.name + "](" + ht.linter.url + ")"; + } + std::string formatterName = ht.formatter.name.empty() ? "None" : ht.formatter.name; + if ( OutputFormat::Markdown == format && !ht.formatter.name.empty() && + !ht.formatter.url.empty() ) { + formatterName = "[" + ht.formatter.name + "](" + ht.formatter.url + ")"; + } - table.add_row( { ht.lang, "✓", lspName, ht.linter.name.empty() ? "None" : ht.linter.name, - ht.formatter.name.empty() ? "None" : ht.formatter.name } ); + table.add_row( { ht.lang, "✓", lspName, linterName, formatterName } ); auto& row = table[table.size() - 1]; diff --git a/src/tools/ecode/plugins/formatter/formatterplugin.cpp b/src/tools/ecode/plugins/formatter/formatterplugin.cpp index 641348bad..3f60e1ad7 100644 --- a/src/tools/ecode/plugins/formatter/formatterplugin.cpp +++ b/src/tools/ecode/plugins/formatter/formatterplugin.cpp @@ -204,6 +204,7 @@ void FormatterPlugin::loadFormatterConfig( const std::string& path, bool updateC formatter.files.push_back( pattern.get() ); formatter.command = obj["command"].get(); + formatter.url = obj.value( "url", "" ); if ( obj.contains( "type" ) ) { std::string typeStr( obj["type"].get() ); diff --git a/src/tools/ecode/plugins/formatter/formatterplugin.hpp b/src/tools/ecode/plugins/formatter/formatterplugin.hpp index ffecf160e..c9a5e09f5 100644 --- a/src/tools/ecode/plugins/formatter/formatterplugin.hpp +++ b/src/tools/ecode/plugins/formatter/formatterplugin.hpp @@ -28,6 +28,7 @@ class FormatterPlugin : public UICodeEditorPlugin { std::string command; FormatterType type{ FormatterType::Output }; std::vector languages{}; + std::string url; }; static PluginDefinition Definition() { diff --git a/src/tools/ecode/plugins/linter/linterplugin.cpp b/src/tools/ecode/plugins/linter/linterplugin.cpp index fc42a7f7e..e7514ead0 100644 --- a/src/tools/ecode/plugins/linter/linterplugin.cpp +++ b/src/tools/ecode/plugins/linter/linterplugin.cpp @@ -195,6 +195,7 @@ void LinterPlugin::loadLinterConfig( const std::string& path, bool updateConfigF } linter.command = obj["command"].get(); + linter.url = obj.value( "url", "" ); if ( obj.contains( "expected_exitcodes" ) ) { auto ee = obj["expected_exitcodes"]; diff --git a/src/tools/ecode/plugins/linter/linterplugin.hpp b/src/tools/ecode/plugins/linter/linterplugin.hpp index b6c08bbcb..3bbb3765c 100644 --- a/src/tools/ecode/plugins/linter/linterplugin.hpp +++ b/src/tools/ecode/plugins/linter/linterplugin.hpp @@ -35,6 +35,7 @@ struct Linter { std::string command; std::vector expectedExitCodes{}; int noErrorsExitCode{ 0 }; + std::string url; }; struct LinterMatch {