From 66acf6fda7d5f899e78e76263bb560901c700b5b Mon Sep 17 00:00:00 2001 From: Akin Sowemimo <22454918+akinsho@users.noreply.github.com> Date: Sun, 2 Apr 2023 22:37:53 +0100 Subject: [PATCH] docs: use the dot notation for type annotations --- lua/flutter-tools.lua | 2 +- lua/flutter-tools/commands.lua | 16 ++++++++-------- lua/flutter-tools/config.lua | 6 +++--- lua/flutter-tools/runners/debugger_runner.lua | 2 +- lua/flutter-tools/runners/job_runner.lua | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lua/flutter-tools.lua b/lua/flutter-tools.lua index 7f90f897..f6e2d9fe 100644 --- a/lua/flutter-tools.lua +++ b/lua/flutter-tools.lua @@ -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() diff --git a/lua/flutter-tools/commands.lua b/lua/flutter-tools/commands.lua index 0c970c51..9468c730 100644 --- a/lua/flutter-tools/commands.lua +++ b/lua/flutter-tools/commands.lua @@ -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() @@ -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 @@ -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 {} diff --git a/lua/flutter-tools/config.lua b/lua/flutter-tools/config.lua index e5952bb0..cfb7475d 100644 --- a/lua/flutter-tools/config.lua +++ b/lua/flutter-tools/config.lua @@ -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> local M = {} ----@type config.ProjectConfig[] +---@type flutter.ProjectConfig[] local project_config = {} local fn = vim.fn @@ -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 diff --git a/lua/flutter-tools/runners/debugger_runner.lua b/lua/flutter-tools/runners/debugger_runner.lua index 99c15750..f99423d7 100644 --- a/lua/flutter-tools/runners/debugger_runner.lua +++ b/lua/flutter-tools/runners/debugger_runner.lua @@ -7,7 +7,7 @@ local api = vim.api local fmt = string.format ----@type FlutterRunner +---@type flutter.Runner local DebuggerRunner = {} local service_extensions_isolateid = {} diff --git a/lua/flutter-tools/runners/job_runner.lua b/lua/flutter-tools/runners/job_runner.lua index c70b29d5..7f1df17c 100644 --- a/lua/flutter-tools/runners/job_runner.lua +++ b/lua/flutter-tools/runners/job_runner.lua @@ -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