Skip to content

Commit ed9f78b

Browse files
authored
feat: adds analyzer_web_port config which starts the LSP analysis server with the given port (#479)
1 parent 8a761c6 commit ed9f78b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lua/flutter-tools/config.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ local utils = lazy.require("flutter-tools.utils") ---@module "flutter-tools.util
4343
---@field outline? {auto_open: boolean, open_cmd?: string}
4444
---@field dev_log? flutter.DevLogOpts
4545
---@field dev_tools? {autostart: boolean, auto_open_browser: boolean}
46+
---@field analyzer_web_port? number
4647

4748
local M = {}
4849

lua/flutter-tools/lsp/init.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ local function get_server_config(user_config, callback)
232232

233233
config.cmd = config.cmd or { paths.dart_bin, "language-server", "--protocol=lsp" }
234234

235+
if config.analyzer_web_port then
236+
table.insert(config.cmd, "--port=" .. tostring(config.analyzer_web_port))
237+
end
238+
235239
config.filetypes = { FILETYPE }
236240
config.capabilities = merge_config(defaults.capabilities, config.capabilities)
237241
config.init_options = merge_config(defaults.init_options, config.init_options)

0 commit comments

Comments
 (0)