aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/ISSUE_TEMPLATE/general_issue.yaml8
-rw-r--r--.github/ISSUE_TEMPLATE/new_package_request.yaml33
-rw-r--r--.github/ISSUE_TEMPLATE/new_server_request.yaml41
-rw-r--r--.github/ISSUE_TEMPLATE/package_installation_form.yaml (renamed from .github/ISSUE_TEMPLATE/server_installation_form.yaml)10
-rw-r--r--.github/ISSUE_TEMPLATE/package_issue.yaml (renamed from .github/ISSUE_TEMPLATE/server_issue.yaml)10
-rw-r--r--.github/workflows/auto-assign-issues.yml6
-rw-r--r--.github/workflows/stylua.yml1
-rw-r--r--README.md12
-rw-r--r--doc/mason.txt7
-rw-r--r--lua/mason/settings.lua6
-rw-r--r--lua/mason/ui/components/main/package_list.lua6
-rw-r--r--lua/mason/ui/instance.lua16
-rw-r--r--tests/core/ui_spec.lua39
13 files changed, 85 insertions, 110 deletions
diff --git a/.github/ISSUE_TEMPLATE/general_issue.yaml b/.github/ISSUE_TEMPLATE/general_issue.yaml
index 059d3fb2..c445976f 100644
--- a/.github/ISSUE_TEMPLATE/general_issue.yaml
+++ b/.github/ISSUE_TEMPLATE/general_issue.yaml
@@ -1,5 +1,5 @@
-name: Non-server-related issue
-description: Report an issue not related to installation or usage of servers
+name: Non-package-related issue
+description: Report an issue not related to installation or usage of packages
body:
- type: markdown
@@ -42,8 +42,8 @@ body:
- type: input
attributes:
- label: Affected language servers
- description: If this issue is specific to one or more language servers, list them here. If not, write 'all'.
+ label: Affected packages
+ description: If this issue is specific to one or more packages, list them here. If not, write 'all'.
validations:
required: true
diff --git a/.github/ISSUE_TEMPLATE/new_package_request.yaml b/.github/ISSUE_TEMPLATE/new_package_request.yaml
new file mode 100644
index 00000000..0e131943
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/new_package_request.yaml
@@ -0,0 +1,33 @@
+name: New package request
+description: Request a new package not currently available
+title: "[New package]: "
+labels:
+ - new-package-request
+
+body:
+ - type: input
+ attributes:
+ label: Package name
+ description: Which package would you like to request to be added?
+ validations:
+ required: true
+
+ - type: input
+ attributes:
+ label: Package homepage
+ description: e.g., a GitHub page
+ validations:
+ required: true
+
+ - type: input
+ attributes:
+ label: Languages
+ description: Which languages does this package target?
+ placeholder: typescript, javascript
+ validations:
+ required: true
+
+ - type: textarea
+ attributes:
+ label: How is this package distributed?
+ description: Is the package distributed through a standardized channel (such as GitHub release files, npm, pip, etc.)? Leave empty if you don't know.
diff --git a/.github/ISSUE_TEMPLATE/new_server_request.yaml b/.github/ISSUE_TEMPLATE/new_server_request.yaml
deleted file mode 100644
index 6e75722c..00000000
--- a/.github/ISSUE_TEMPLATE/new_server_request.yaml
+++ /dev/null
@@ -1,41 +0,0 @@
-name: New server request
-description: Request a new server not currently available
-title: "[New server]: "
-labels:
- - new-server-request
-
-body:
- - type: input
- attributes:
- label: Server name
- description: Which server would you like to request to be added?
- validations:
- required: true
-
- - type: input
- attributes:
- label: Server homepage
- description: e.g., a GitHub page
- validations:
- required: true
-
- - type: input
- attributes:
- label: Languages
- description: Which languages does this server target?
- placeholder: typescript, javascript
- validations:
- required: true
-
- - type: checkboxes
- attributes:
- label: Is this server added in lspconfig?
- description: Is there a server configuration for this server in [lspconfig](https://github.com/neovim/nvim-lspconfig)?
- options:
- - label: "Yes"
- - label: "No"
-
- - type: textarea
- attributes:
- label: How is this server distributed?
- description: Is the server distributed through a standardized channel (such as GitHub release files, npm, pip, etc.)? Leave empty if you don't know.
diff --git a/.github/ISSUE_TEMPLATE/server_installation_form.yaml b/.github/ISSUE_TEMPLATE/package_installation_form.yaml
index 6464d539..dbd6a2e1 100644
--- a/.github/ISSUE_TEMPLATE/server_installation_form.yaml
+++ b/.github/ISSUE_TEMPLATE/package_installation_form.yaml
@@ -1,5 +1,5 @@
-name: Server installation issue
-description: Report an issue that occurs during the installation of a server
+name: Package installation issue
+description: Report an issue that occurs during the installation of a package
labels:
- installation-issue
@@ -44,8 +44,8 @@ body:
- type: input
attributes:
- label: Affected language servers
- description: If this issue is specific to one or more language servers, list them here. If not, write 'all'.
+ label: Affected language packages
+ description: If this issue is specific to one or more packages, list them here. If not, write 'all'.
validations:
required: true
@@ -73,7 +73,7 @@ body:
- type: textarea
attributes:
label: Installation log
- description: "Make sure you set DEBUG level before installing the server. Refer to `:help mason-debugging`"
+ description: "Make sure you set DEBUG level before installing the package. Refer to `:help mason-debugging`"
placeholder: ":MasonLog"
render: Text
validations:
diff --git a/.github/ISSUE_TEMPLATE/server_issue.yaml b/.github/ISSUE_TEMPLATE/package_issue.yaml
index d9c19098..9a7716a3 100644
--- a/.github/ISSUE_TEMPLATE/server_issue.yaml
+++ b/.github/ISSUE_TEMPLATE/package_issue.yaml
@@ -1,7 +1,7 @@
-name: Server issue
-description: Report an issue with using a server installed via mason.nvim
+name: Package issue
+description: Report an issue with using a package installed via mason.nvim
labels:
- - server-issue
+ - package-issue
body:
- type: markdown
@@ -57,8 +57,8 @@ body:
- type: input
attributes:
- label: Affected language servers
- description: If this issue is specific to one or more language servers, list them here. If not, write 'all'.
+ label: Affected language packages
+ description: If this issue is specific to one or more packages, list them here. If not, write 'all'.
validations:
required: true
diff --git a/.github/workflows/auto-assign-issues.yml b/.github/workflows/auto-assign-issues.yml
index 0f99bd46..3c7a2d56 100644
--- a/.github/workflows/auto-assign-issues.yml
+++ b/.github/workflows/auto-assign-issues.yml
@@ -23,11 +23,11 @@ jobs:
- name: Create a PR comment
uses: peter-evans/create-or-update-comment@v1
- if: contains(github.event.issue.labels.*.name, 'new-server-request')
+ if: contains(github.event.issue.labels.*.name, 'new-package-request')
with:
token: ${{ secrets.PAT }}
issue-number: ${{ github.event.issue.number }}
body: |
- Hello! Cool! Pull requests are always very welcomed to add new servers. If the distribution of the
- server is simple, the installation will most likely be so as well (existing server installers may be
+ Hello! Cool! Pull requests are always very welcomed to add new packages. If the distribution of the
+ package is simple, the installation will most likely be so as well (existing package installers may be
used for reference!). Otherwise, @williamboman will get around to looking into this ASAP!
diff --git a/.github/workflows/stylua.yml b/.github/workflows/stylua.yml
index e28130be..1532fc6f 100644
--- a/.github/workflows/stylua.yml
+++ b/.github/workflows/stylua.yml
@@ -3,7 +3,6 @@ name: Stylua check
on:
push:
branches:
- - "main"
pull_request:
jobs:
diff --git a/README.md b/README.md
index be96c276..8c12348c 100644
--- a/README.md
+++ b/README.md
@@ -95,9 +95,9 @@ Example:
require("mason").setup({
ui = {
icons = {
- server_installed = "✓",
- server_pending = "➜",
- server_uninstalled = "✗"
+ package_installed = "✓",
+ package_pending = "➜",
+ package_uninstalled = "✗"
}
}
})
@@ -152,11 +152,11 @@ local DEFAULT_SETTINGS = {
},
-- Controls to which degree logs are written to the log file. It's useful to set this to vim.log.levels.DEBUG when
- -- debugging issues with server installations.
+ -- debugging issues with package installations.
log_level = vim.log.levels.INFO,
- -- Limit for the maximum amount of servers to be installed at the same time. Once this limit is reached, any further
- -- servers that are requested to be installed will be put in a queue.
+ -- Limit for the maximum amount of packages to be installed at the same time. Once this limit is reached, any further
+ -- packages that are requested to be installed will be put in a queue.
max_concurrent_installers = 4,
github = {
diff --git a/doc/mason.txt b/doc/mason.txt
index e698a006..6d6ecbd9 100644
--- a/doc/mason.txt
+++ b/doc/mason.txt
@@ -161,11 +161,11 @@ Example:
},
-- Controls to which degree logs are written to the log file. It's useful to set this to vim.log.levels.DEBUG when
- -- debugging issues with server installations.
+ -- debugging issues with package installations.
log_level = vim.log.levels.INFO,
- -- Limit for the maximum amount of servers to be installed at the same time. Once this limit is reached, any further
- -- servers that are requested to be installed will be put in a queue.
+ -- Limit for the maximum amount of packages to be installed at the same time. Once this limit is reached, any further
+ -- packages that are requested to be installed will be put in a queue.
max_concurrent_installers = 4,
github = {
@@ -178,6 +178,7 @@ Example:
},
}
+
==============================================================================
DOWNLOAD MIRRORS *mason-download-mirrors*
diff --git a/lua/mason/settings.lua b/lua/mason/settings.lua
index bfa7fd9f..df3585e8 100644
--- a/lua/mason/settings.lua
+++ b/lua/mason/settings.lua
@@ -51,11 +51,11 @@ local DEFAULT_SETTINGS = {
},
-- Controls to which degree logs are written to the log file. It's useful to set this to vim.log.levels.DEBUG when
- -- debugging issues with server installations.
+ -- debugging issues with package installations.
log_level = vim.log.levels.INFO,
- -- Limit for the maximum amount of servers to be installed at the same time. Once this limit is reached, any further
- -- servers that are requested to be installed will be put in a queue.
+ -- Limit for the maximum amount of packages to be installed at the same time. Once this limit is reached, any further
+ -- packages that are requested to be installed will be put in a queue.
max_concurrent_installers = 4,
github = {
diff --git a/lua/mason/ui/components/main/package_list.lua b/lua/mason/ui/components/main/package_list.lua
index 49f82c5a..696b838f 100644
--- a/lua/mason/ui/components/main/package_list.lua
+++ b/lua/mason/ui/components/main/package_list.lua
@@ -176,7 +176,7 @@ local function Installed(state)
keybinds = {
Ui.Keybind(settings.current.ui.keymaps.update_package, "INSTALL_PACKAGE", package),
Ui.Keybind(settings.current.ui.keymaps.uninstall_package, "UNINSTALL_PACKAGE", package),
- Ui.Keybind(settings.current.ui.keymaps.toggle_package_expand, "TOGGLE_EXPAND_SERVER", package),
+ Ui.Keybind(settings.current.ui.keymaps.toggle_package_expand, "TOGGLE_EXPAND_PACKAGE", package),
},
})
end,
@@ -253,7 +253,7 @@ local function Failed(state)
icon = p.error(settings.current.ui.icons.package_pending),
keybinds = {
Ui.Keybind(settings.current.ui.keymaps.install_package, "INSTALL_PACKAGE", package),
- Ui.Keybind(settings.current.ui.keymaps.toggle_package_expand, "TOGGLE_EXPAND_SERVER", package),
+ Ui.Keybind(settings.current.ui.keymaps.toggle_package_expand, "TOGGLE_EXPAND_PACKAGE", package),
},
})
end,
@@ -272,7 +272,7 @@ local function Uninstalled(state)
icon = p.muted(settings.current.ui.icons.package_uninstalled),
keybinds = {
Ui.Keybind(settings.current.ui.keymaps.install_package, "INSTALL_PACKAGE", package),
- Ui.Keybind(settings.current.ui.keymaps.toggle_package_expand, "TOGGLE_EXPAND_SERVER", package),
+ Ui.Keybind(settings.current.ui.keymaps.toggle_package_expand, "TOGGLE_EXPAND_PACKAGE", package),
},
})
end,
diff --git a/lua/mason/ui/instance.lua b/lua/mason/ui/instance.lua
index d01a8782..a6db4d25 100644
--- a/lua/mason/ui/instance.lua
+++ b/lua/mason/ui/instance.lua
@@ -182,10 +182,8 @@ local function mutate_package_visibility(mutate_fn)
_.T
)
for __, package in ipairs(packages) do
- state.packages.visible[package.name] = _.all_pass(
- { view_predicate[state.view.current], language_predicate },
- package.spec
- )
+ state.packages.visible[package.name] =
+ _.all_pass({ view_predicate[state.view.current], language_predicate }, package.spec)
end
end)
end
@@ -203,10 +201,8 @@ local function setup_handle(handle)
local function handle_spawninfo_change()
mutate_state(function(state)
- state.packages.states[handle.package.name].latest_spawn = handle
- :peek_spawninfo_stack()
- :map(tostring)
- :or_else(nil)
+ state.packages.states[handle.package.name].latest_spawn =
+ handle:peek_spawninfo_stack():map(tostring):or_else(nil)
end)
end
@@ -430,7 +426,7 @@ local function dequeue_package(event)
)
end
-local function toggle_expand_server(event)
+local function toggle_expand_package(event)
---@type Package
local package = event.payload
mutate_state(function(state)
@@ -562,7 +558,7 @@ local effects = {
["SET_VIEW"] = set_view,
["TERMINATE_PACKAGE_HANDLE"] = terminate_package_handle,
["TOGGLE_EXPAND_CURRENT_SETTINGS"] = toggle_expand_current_settings,
- ["TOGGLE_EXPAND_SERVER"] = toggle_expand_server,
+ ["TOGGLE_EXPAND_PACKAGE"] = toggle_expand_package,
["TOGGLE_HELP"] = toggle_help,
["TOGGLE_JSON_SCHEMA"] = toggle_json_schema,
["TOGGLE_JSON_SCHEMA_KEY"] = toggle_json_schema_keys,
diff --git a/tests/core/ui_spec.lua b/tests/core/ui_spec.lua
index b60ba6a1..215a7283 100644
--- a/tests/core/ui_spec.lua
+++ b/tests/core/ui_spec.lua
@@ -66,7 +66,7 @@ describe("ui", function()
win_width = 120,
},
Ui.CascadingStyleNode({ "INDENT" }, {
- Ui.Keybind("i", "INSTALL_SERVER", { "sumneko_lua" }, true),
+ Ui.Keybind("i", "INSTALL_PACKAGE", { "sumneko_lua" }, true),
Ui.HlTextNode {
{
{ "Hello World!", "MyHighlightGroup" },
@@ -81,7 +81,7 @@ describe("ui", function()
},
},
Ui.StickyCursor { id = "sticky" },
- Ui.Keybind("<CR>", "INSTALL_SERVER", { "tsserver" }, false),
+ Ui.Keybind("<CR>", "INSTALL_PACKAGE", { "tsserver" }, false),
Ui.DiagnosticsNode {
message = "yeah this one's outdated",
severity = vim.diagnostic.severity.WARN,
@@ -117,13 +117,13 @@ describe("ui", function()
sticky_cursors = { line_map = { [3] = "sticky" }, id_map = { ["sticky"] = 3 } },
keybinds = {
{
- effect = "INSTALL_SERVER",
+ effect = "INSTALL_PACKAGE",
key = "i",
line = -1,
payload = { "sumneko_lua" },
},
{
- effect = "INSTALL_SERVER",
+ effect = "INSTALL_PACKAGE",
key = "<CR>",
line = 3,
payload = { "tsserver" },
@@ -212,25 +212,16 @@ describe("integration test", function()
assert.spy(buf_set_option).was_called_with(match.is_number(), "undolevels", -1)
assert.spy(set_lines).was_called(1)
- assert.spy(set_lines).was_called_with(
- match.is_number(),
- 0,
- -1,
- false,
- { "Line number 1!", "Initial state", "My highlighted text" }
- )
+ assert
+ .spy(set_lines)
+ .was_called_with(match.is_number(), 0, -1, false, { "Line number 1!", "Initial state", "My highlighted text" })
assert.spy(set_extmark).was_called(0)
assert.spy(add_highlight).was_called(1)
- assert.spy(add_highlight).was_called_with(
- match.is_number(),
- match.is_number(),
- "MyHighlightGroup",
- 2,
- 0,
- 19
- )
+ assert
+ .spy(add_highlight)
+ .was_called_with(match.is_number(), match.is_number(), "MyHighlightGroup", 2, 0, 19)
assert.spy(set_keymap).was_called(2)
assert.spy(set_keymap).was_called_with(
@@ -257,13 +248,9 @@ describe("integration test", function()
a.scheduler()
assert.spy(set_lines).was_called(2)
- assert.spy(set_lines).was_called_with(
- match.is_number(),
- 0,
- -1,
- false,
- { "Line number 1!", "New state", "My highlighted text" }
- )
+ assert
+ .spy(set_lines)
+ .was_called_with(match.is_number(), 0, -1, false, { "Line number 1!", "New state", "My highlighted text" })
end)
)