Skip to content

Commit

Permalink
docs: use the dot notation for type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
akinsho committed Apr 9, 2023
1 parent 6e93e83 commit 66acf6f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lua/flutter-tools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local command = function(name, callback, opts)
api.nvim_create_user_command(name, callback, opts or {})
end

---@param opts config.ProjectConfig
---@param opts flutter.ProjectConfig
function M.setup_project(opts) config.setup_project(opts) end

local function setup_commands()
Expand Down
16 changes: 8 additions & 8 deletions lua/flutter-tools/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ local M = {}
---@type table?
local current_device = nil

---@class FlutterRunner
---@field is_running fun(runner: FlutterRunner):boolean
---@field run fun(runner: FlutterRunner, paths:table, args:table, cwd:string, on_run_data:fun(is_err:boolean, data:string), on_run_exit:fun(data:string[], args: table))
---@field cleanup fun(funner: FlutterRunner)
---@field send fun(runner: FlutterRunner, cmd:string, quiet: boolean?)
---@class flutter.Runner
---@field is_running fun(runner: flutter.Runner):boolean
---@field run fun(runner: flutter.Runner, paths:table, args:table, cwd:string, on_run_data:fun(is_err:boolean, data:string), on_run_exit:fun(data:string[], args: table))
---@field cleanup fun(funner: flutter.Runner)
---@field send fun(runner: flutter.Runner, cmd:string, quiet: boolean?)

---@type FlutterRunner?
---@type flutter.Runner?
local runner = nil

function M.use_debugger_runner()
Expand Down Expand Up @@ -98,7 +98,7 @@ function M.run_command(args)
M.run({ args = args })
end

---@param callback fun(project_config: config.ProjectConfig)
---@param callback fun(project_config: flutter.ProjectConfig?)
local function select_project_config(callback)
local project_config = config.project
if #project_config < 2 then return callback(project_config[1]) end
Expand All @@ -113,7 +113,7 @@ end
---@alias RunOpts {cli_args: string[]?, args: string[]?, device: Device?}

---@param opts RunOpts
---@param project_conf config.ProjectConfig?
---@param project_conf flutter.ProjectConfig?
local function run(opts, project_conf)
if M.is_running() then return ui.notify("Flutter is already running!") end
opts = opts or {}
Expand Down
6 changes: 3 additions & 3 deletions lua/flutter-tools/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ local lazy = require("flutter-tools.lazy")
local path = lazy.require("flutter-tools.utils.path") ---@module "flutter-tools.utils.path"
local ui = lazy.require("flutter-tools.ui") ---@module "flutter-tools.ui"

---@class config.ProjectConfig
---@class flutter.ProjectConfig
---@field device string
---@field flavours string[]
---@field dart_define table<string, string>>

local M = {}

---@type config.ProjectConfig[]
---@type flutter.ProjectConfig[]
local project_config = {}

local fn = vim.fn
Expand Down Expand Up @@ -146,7 +146,7 @@ local function handle_deprecation(key, value, conf)
if deprecation.fallback then conf[deprecation.fallback] = value end
end

---@param project config.ProjectConfig | config.ProjectConfig[]
---@param project flutter.ProjectConfig | flutter.ProjectConfig[]
M.setup_project = function(project)
if not vim.tbl_islist(project) then project = { project } end
project_config = project
Expand Down
2 changes: 1 addition & 1 deletion lua/flutter-tools/runners/debugger_runner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local api = vim.api

local fmt = string.format

---@type FlutterRunner
---@type flutter.Runner
local DebuggerRunner = {}

local service_extensions_isolateid = {}
Expand Down
2 changes: 1 addition & 1 deletion lua/flutter-tools/runners/job_runner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local ui = require("flutter-tools.ui")
local dev_tools = require("flutter-tools.dev_tools")
local api = vim.api

---@type FlutterRunner
---@type flutter.Runner
local JobRunner = {}

---@type Job
Expand Down

0 comments on commit 66acf6f

Please sign in to comment.