aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-07-24 15:05:22 +0200
committerWilliam Boman <william@redwill.se>2022-07-24 15:06:55 +0200
commitc92cc60866930a330ddbf5e92996b46a1dab23ee (patch)
treebb3f23da69b05c01fa5b9dc01996cf9f78f37007 /lua
parentfeat: add vale (#121) (diff)
downloadmason-c92cc60866930a330ddbf5e92996b46a1dab23ee.tar
mason-c92cc60866930a330ddbf5e92996b46a1dab23ee.tar.gz
mason-c92cc60866930a330ddbf5e92996b46a1dab23ee.tar.bz2
mason-c92cc60866930a330ddbf5e92996b46a1dab23ee.tar.lz
mason-c92cc60866930a330ddbf5e92996b46a1dab23ee.tar.xz
mason-c92cc60866930a330ddbf5e92996b46a1dab23ee.tar.zst
mason-c92cc60866930a330ddbf5e92996b46a1dab23ee.zip
stable branch release
Diffstat (limited to 'lua')
-rw-r--r--lua/mason/ui/components/header.lua7
-rw-r--r--lua/mason/ui/components/help/dap.lua7
-rw-r--r--lua/mason/ui/components/help/formatter.lua13
-rw-r--r--lua/mason/ui/components/help/init.lua12
-rw-r--r--lua/mason/ui/components/help/linter.lua13
5 files changed, 45 insertions, 7 deletions
diff --git a/lua/mason/ui/components/header.lua b/lua/mason/ui/components/header.lua
index a4e466db..52aacc7d 100644
--- a/lua/mason/ui/components/header.lua
+++ b/lua/mason/ui/components/header.lua
@@ -6,14 +6,10 @@ return function(state)
return Ui.CascadingStyleNode({ "CENTERED" }, {
Ui.HlTextNode {
Ui.When(state.view.is_showing_help, {
- p.none " ",
p.header_secondary(" " .. state.header.title_prefix .. " mason.nvim "),
- p.Comment " alpha branch",
p.none((" "):rep(#state.header.title_prefix + 1)),
}, {
- p.none " ",
p.header " mason.nvim ",
- p.Comment " alpha branch",
}),
Ui.When(
state.view.is_showing_help,
@@ -21,9 +17,6 @@ return function(state)
{ p.none "press ", p.highlight "?", p.none " for help" }
),
{ p.Comment "https://github.com/williamboman/mason.nvim" },
- {
- p.Comment "Give usage feedback: https://github.com/williamboman/mason.nvim/discussions/new?category=ideas",
- },
},
})
end
diff --git a/lua/mason/ui/components/help/dap.lua b/lua/mason/ui/components/help/dap.lua
index 0dec10cf..6344e234 100644
--- a/lua/mason/ui/components/help/dap.lua
+++ b/lua/mason/ui/components/help/dap.lua
@@ -16,5 +16,12 @@ return function(state)
{
p.none "between a development tool (e.g. IDE or editor) and a debugger.",
},
+ {
+ p.none "This provides editors with a standardized interface for enabling debugging",
+ },
+ {
+ p.none "capabilities - such as pausing execution, stepping through statements,",
+ },
+ { p.none "and inspecting variables." },
}
end
diff --git a/lua/mason/ui/components/help/formatter.lua b/lua/mason/ui/components/help/formatter.lua
new file mode 100644
index 00000000..45e83e9b
--- /dev/null
+++ b/lua/mason/ui/components/help/formatter.lua
@@ -0,0 +1,13 @@
+local Ui = require "mason-core.ui"
+local p = require "mason.ui.palette"
+
+---@param state InstallerUiState
+return function(state)
+ return Ui.HlTextNode {
+ { p.none "A code formatter is a tool that reformats code to fit a certain" },
+ { p.none "formatting convention. This usually entails things like adjusting" },
+ { p.none "indentation, breaking long lines into smaller lines, adding or" },
+ { p.none "removing whitespaces. Formatting rules are often included as a" },
+ { p.none "separate configuration file within the project." },
+ }
+end
diff --git a/lua/mason/ui/components/help/init.lua b/lua/mason/ui/components/help/init.lua
index f6c9debb..28ff3e37 100644
--- a/lua/mason/ui/components/help/init.lua
+++ b/lua/mason/ui/components/help/init.lua
@@ -6,6 +6,8 @@ local log = require "mason-core.log"
local LSPHelp = require "mason.ui.components.help.lsp"
local DAPHelp = require "mason.ui.components.help.dap"
+local LinterHelp = require "mason.ui.components.help.linter"
+local FormatterHelp = require "mason.ui.components.help.formatter"
---@param state InstallerUiState
local function Ship(state)
@@ -140,6 +142,16 @@ return function(state)
DAPHelp(state),
Ui.EmptyLine(),
}
+ elseif state.view.current == "Linter" then
+ heading = Ui.Node {
+ LinterHelp(state),
+ Ui.EmptyLine(),
+ }
+ elseif state.view.current == "Formatter" then
+ heading = Ui.Node {
+ FormatterHelp(state),
+ Ui.EmptyLine(),
+ }
end
return Ui.CascadingStyleNode({ "INDENT" }, {
diff --git a/lua/mason/ui/components/help/linter.lua b/lua/mason/ui/components/help/linter.lua
new file mode 100644
index 00000000..d0809de3
--- /dev/null
+++ b/lua/mason/ui/components/help/linter.lua
@@ -0,0 +1,13 @@
+local Ui = require "mason-core.ui"
+local p = require "mason.ui.palette"
+
+---@param state InstallerUiState
+return function(state)
+ return Ui.HlTextNode {
+ { p.none "A linter is a static code analysis tool used to provide diagnostics around" },
+ { p.none "programming errors, bugs, stylistic errors and suspicious constructs." },
+ { p.none "Linters can be executed as a standalone program in a terminal, where it" },
+ { p.none "usually expects one or more input files to lint. There are also Neovim plugins" },
+ { p.none "that integrate these diagnostics directly inside the editor, for a richer experience." },
+ }
+end