Lua: Fix comment line endings

Change-Id: I00a5ece580b69a65c8fa60eae8458526d1df257e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-06-13 06:59:00 +02:00
parent e331329e4f
commit 8f715a350b
12 changed files with 156 additions and 162 deletions

View File

@@ -4,30 +4,30 @@ local action = {}
---@enum CommandAttributes
action.CommandAttribute = {
---Hide the command from the menu
---Hide the command from the menu.
CA_Hide = 1,
---Update the text of the command
---Update the text of the command.
CA_UpdateText = 2,
---Update the icon of the command
---Update the icon of the command.
CA_UpdateIcon = 4,
---The command cannot be configured
---The command cannot be configured.
CA_NonConfigurable = 8,
}
---@class ActionOptions
---@field context? string The context in which the action is available
---@field text? string The text to display for the action
---@field iconText? string The icon text to display for the action
---@field toolTip? string The tooltip to display for the action
---@field onTrigger? function The callback to call when the action is triggered
---@field commandAttributes? CommandAttributes The attributes of the action
---@field commandDescription? string The description of the command
---@field defaultKeySequence? string The default key sequence for the action
---@field defaultKeySequences? string[] The default key sequences for the action
---@field context? string The context in which the action is available.
---@field text? string The text to display for the action.
---@field iconText? string The icon text to display for the action.
---@field toolTip? string The tooltip to display for the action.
---@field onTrigger? function The callback to call when the action is triggered.
---@field commandAttributes? CommandAttributes The attributes of the action.
---@field commandDescription? string The description of the command.
---@field defaultKeySequence? string The default key sequence for the action.
---@field defaultKeySequences? string[] The default key sequences for the action.
local ActionOptions = {}
---Creates a new Action
---@param id string The id of the action
---Creates a new Action.
---@param id string The id of the action.
---@param options ActionOptions
function action.create(id, options) end

View File

@@ -20,7 +20,7 @@ local async = {}
function async.sync(func) end
---@async
---Calls an async function and waits for it to finish. **Must** be called from async.sync()
---Calls an async function and waits for it to finish. **Must** be called from async.sync().
---
--- Example:
--- ```lua
@@ -39,7 +39,7 @@ function async.sync(func) end
function async.wait(func) end
---@async
---Calls multiple async functions and waits for all of them to finish. **Must** be called from async.sync()
---Calls multiple async functions and waits for all of them to finish. **Must** be called from async.sync().
---
--- Example:
--- ```lua

View File

@@ -16,10 +16,10 @@ Core.GeneratedFile.Attribute = {
---@field filePath FilePath
---@field contents string
---@field isBinary boolean
---@field attributes Attribute A combination of Attribute
---@field attributes Attribute A combination of Attribute.
Core.GeneratedFile = {}
---Create a new GeneratedFile
---Create a new GeneratedFile.
---@return GeneratedFile
function Core.GeneratedFile.new() end

View File

@@ -1,12 +1,12 @@
---@meta Fetch
local Fetch = {}
---A network reply from fetch
---A network reply from fetch.
---@class QNetworkReply
---@field error integer The error code of the reply or 0 if no error
---@field error integer The error code of the reply or 0 if no error.
local QNetworkReply = {}
---Returns the data of the reply
---Returns the data of the reply.
---@return string
function QNetworkReply:readAll() end
@@ -16,15 +16,15 @@ function QNetworkReply:readAll() end
function Fetch.fetch(options) end
--@param options FetchOptions
--@param callback function The callback to call when the fetch is done
--@param callback function The callback to call when the fetch is done.
function Fetch.fetch_cb(options, callback) end
---@class FetchOptions
---@field url string The url to fetch
---@field method? string The method to use (GET, POST, ...), default is GET
---@field headers? table The headers to send
---@field body? string The body to send
---@field convertToTable? boolean If true, the resulting data will expect JSON and converted it to a table
---@field url string The url to fetch.
---@field method? string The method to use (GET, POST, ...), default is GET.
---@field headers? table The headers to send.
---@field body? string The body to send.
---@field convertToTable? boolean If true, the resulting data will expect JSON and converted it to a table.
local FetchOptions = {}
return Fetch

View File

@@ -2,11 +2,11 @@
local gui = {}
---The base class of all ui related classes
---The base class of all ui related classes.
---@class Object
gui.Object = {}
---The base class of all gui layout classes
---The base class of all gui layout classes.
---@class Layout : Object
gui.Layout = {}
@@ -26,14 +26,14 @@ local column = {}
---@return Column
function gui.Column(children) end
---A group box with a title
---A group box with a title.
---@class Group : Widget
local group = {}
---@return Group
function gui.Group(children) end
---Row layout
---Row layout.
---@class Row : Layout
local row = {}
@@ -41,7 +41,7 @@ local row = {}
---@return Row
function gui.Row(children) end
---Flow layout
---Flow layout.
---@class Flow : Layout
local flow = {}
@@ -49,7 +49,7 @@ local flow = {}
---@return Flow
function gui.Flow(children) end
---Grid layout
---Grid layout.
---@class Grid : Layout
local grid = {}
@@ -57,7 +57,7 @@ local grid = {}
---@return Grid
function gui.Grid(children) end
---Form layout
---Form layout.
---@class Form : Layout
local form = {}
@@ -66,7 +66,7 @@ local form = {}
function gui.Form(children) end
---A stack of multiple widgets
---A stack of multiple widgets.
---@class Stack : Widget
local stack = {}
@@ -74,7 +74,7 @@ local stack = {}
---@return Stack
function gui.Stack(children) end
---A Tab widget
---A Tab widget.
---@class Tab : Widget
local tab = {}
@@ -82,7 +82,7 @@ local tab = {}
---@return Tab
function gui.Tab(children) end
---A Multiline text edit
---A Multiline text edit.
---@class TextEdit : Widget
local textEdit = {}
@@ -90,7 +90,6 @@ local textEdit = {}
---@return TextEdit
function gui.TextEdit(children) end
---A PushButton
---@class PushButton : Widget
local pushButton = {}
@@ -98,7 +97,6 @@ local pushButton = {}
---@return PushButton
function gui.PushButton(children) end
---A Label
---@class Label : LayoutItem
local label = {}
@@ -106,7 +104,6 @@ local label = {}
---@return Label
function gui.Label(children) end
---A SpinBox
---@class SpinBox : Widget
local spinBox = {}
@@ -114,7 +111,6 @@ local spinBox = {}
---@return SpinBox
function gui.SpinBox(children) end
---A Splitter
---@class Splitter : Widget
local splitter = {}
@@ -122,7 +118,6 @@ local splitter = {}
---@return Splitter
function gui.Splitter(children) end
---A Toolbar
---@class ToolBar : Widget
local toolBar = {}
@@ -130,7 +125,6 @@ local toolBar = {}
---@return ToolBar
function gui.ToolBar(children) end
---A TabWidget
---@class TabWidget : Widget
local tabWidget = {}
@@ -142,40 +136,40 @@ function gui.TabWidget(children) end
---@param child Layout|string|BaseAspect|function
---@return TabWidget
function gui.TabWidget(name, child) end
---A "Line break" in the gui
---A "Line break" in the gui.
function gui.br() end
---A "Stretch" in the layout
---A "Stretch" in the layout.
function gui.st() end
---An empty grid cell in a grid layout
---An empty grid cell in a grid layout.
function gui.empty() end
---A horizontal line in the layout
---A horizontal line in the layout.
function gui.hr() end
---Clears the margin of the layout
---Clears the margin of the layout.
function gui.noMargin() end
---Sets the margin of the layout to the default value
---Sets the margin of the layout to the default value.
function gui.normalMargin() end
---Sets the alignment of a Grid layout according to the Form layout rules
---Sets the alignment of a Grid layout according to the Form layout rules.
function gui.withFormAlignment() end
---Sets the size of the parent object if possible
---Sets the size of the parent object if possible.
function gui.resize(width, height) end
---Sets the spacing of the gui
---Sets the spacing of the gui.
function gui.spacing(spacing) end
---Sets the field growth policy of the gui
---Sets the field growth policy of the gui.
function gui.fieldGrowthPolicy(policy) end
---Sets the onClicked handler of the parent object if possible
---Sets the onClicked handler of the parent object if possible.
function gui.onClicked(f) end
---Sets the onTextChanged handler of the parent object if possible
---Sets the onTextChanged handler of the parent object if possible.
function gui.onTextChanged(f) end
return gui

View File

@@ -3,26 +3,26 @@
local Install = {}
---@class PackageInfo
---@field name string The name of the package
---@field version string The version of the package
---@field path FilePath The path to the package
---@field name string The name of the package.
---@field version string The version of the package.
---@field path FilePath The path to the package.
local PackageInfo = {}
---@class InstallOptions
---@field name string The name of the package to install
---@field url string The url to fetch the package from
---@field version string The version of the package to install
---@field name string The name of the package to install.
---@field url string The url to fetch the package from.
---@field version string The version of the package to install.
local InstallOptions = {}
---Install something
---@param msg string The message to display to the user asking for permission to install
---@param options InstallOptions|[InstallOptions] The options to install
---@return boolean Result Whether the installation was successful
---@param msg string The message to display to the user asking for permission to install.
---@param options InstallOptions|[InstallOptions] The options to install.
---@return boolean Result Whether the installation was successful.
---@return string Error The error message if the installation failed.
function Install.install(msg, options) end
---Get the package info
---@param name any The name of the package
---@param name any The name of the package.
---@return PackageInfo
function Install.packageInfo(name) end

View File

@@ -1,38 +1,38 @@
---@meta LSP
---@meta LSP.
local lsp = {}
---@class ClientOptions
---@field name string The name under which to register the language server.
---@field cmd function|string[] The command to start the language server, or a function returning a string[].
---@field transport? "stdio"|"localsocket" Defaults to stdio
---@field serverName? string The socket path when transport == "localsocket"
---@field languageFilter LanguageFilter The language filter deciding which files to open with the language server
---@field transport? "stdio"|"localsocket" Defaults to stdio.
---@field serverName? string The socket path when transport == "localsocket".
---@field languageFilter LanguageFilter The language filter deciding which files to open with the language server.
---@field startBehavior? "AlwaysOn"|"RequiresFile"|"RequiresProject"
---@field initializationOptions? table|string The initialization options to pass to the language server, either a json string, or a table
---@field initializationOptions? table|string The initialization options to pass to the language server, either a JSON string, or a table.
---@field settings? AspectContainer
---@field onStartFailed? function This callback is called when client failed to start.
local ClientOptions = {}
---@class LanguageFilter
---@field patterns? string[] The file patterns supported by the language server
---@field mimeTypes? string[] The mime types supported by the language server
---@field patterns? string[] The file patterns supported by the language server.
---@field mimeTypes? string[] The mime types supported by the language server.
local LanguageFilter = {}
---@class Client
---@field on_instance_start function The callback to call when a language client starts
---@field on_instance_start function The callback to call when a language client starts.
lsp.Client = {}
---@param msg string The name of the message to handle
---@param callback function The callback to call when the message is received
---Registers a message handler for the message named 'msg'
---@param msg string The name of the message to handle.
---@param callback function The callback to call when the message is received.
---Registers a message handler for the message named 'msg'.
function lsp.Client:registerMessage(msg, callback) end
---@param msg table the message to send
---Sends a message to the language server
---@param msg table the message to send.
---Sends a message to the language server.
function lsp.Client:sendMessage(msg, callback) end
---Creates a new Language Client
---Creates a new Language Client.
---@param options ClientOptions
---@return Client
function lsp.Client.create(options) end

View File

@@ -2,15 +2,15 @@
local messagemanager = {}
---Writes a message to the Output pane
---Writes a message to the Output pane.
---@param ... any
function messagemanager.writeSilently(...) end
---Writes a message to the Output pane and flashes the pane if its not open
---Writes a message to the Output pane and flashes the pane if its not open.
---@param ... any
function messagemanager.writeFlashing(...) end
---Writes a message to the Output pane and opens the pane if its not open
---Writes a message to the Output pane and opens the pane if its not open.
---@param ... any
function messagemanager.writeDisrupting(...) end

View File

@@ -4,14 +4,14 @@ local process = {}
---@async
---Runs a command in a terminal, has to be called from a coroutine!
---@param cmd string The command to run
---@return number The exit code of the command
---@param cmd string The command to run.
---@return number exitCode The exit code of the command.
function process.runInTerminal(cmd) end
---@async
---Runs a command and returns the output!
---@param cmd string The command to run
---@return string The output of the command
---@param cmd string The command to run.
---@return string output The output of the command.
function process.commandOutput(cmd) end
return process

View File

@@ -8,48 +8,48 @@ local settings = {}
---@class BaseAspect
settings.BaseAspect = {}
---Applies the changes from its volatileValue to its value
---Applies the changes from its volatileValue to its value.
function settings.BaseAspect:apply() end
---@class AspectCreate
---@field settingsKey? string The settings key of the aspect
---@field displayName? string The display name of the aspect
---@field labelText? string The label text of the aspect
---@field toolTip? string The tool tip of the aspect
---@field enabler? BoolAspect Enable / Disable this aspect based on the state of the `enabler`
---@field onValueChanged? function () Called when the value of the aspect changes
---@field onVolatileValueChanged? function () Called when the volatile value of the aspect changes
---@field settingsKey? string The settings key of the aspect.
---@field displayName? string The display name of the aspect.
---@field labelText? string The label text of the aspect.
---@field toolTip? string The tool tip of the aspect.
---@field enabler? BoolAspect Enable / Disable this aspect based on the state of the `enabler`.
---@field onValueChanged? function () Called when the value of the aspect changes.
---@field onVolatileValueChanged? function () Called when the volatile value of the aspect changes.
local AspectCreate = {}
---The base class of most typed aspects
---The base class of most typed aspects.
---@generic T
---@class TypedAspect<T> : BaseAspect
---@field value `T` The value of the aspect
---@field volatileValue `T` The temporary value of the aspect
---@field defaultValue `T` The default value of the aspect
---@field value `T` The value of the aspect.
---@field volatileValue `T` The temporary value of the aspect.
---@field defaultValue `T` The default value of the aspect.
local TypedAspect = {}
---@generic T
---@class TypedAspectCreate<T> : AspectCreate
---@field defaultValue `T` The default value of the aspect
---@field defaultValue `T` The default value of the aspect.
local TypedAspectCreate = {}
---A container for aspects
---A container for aspects.
---@class AspectContainer : BaseAspect
settings.AspectContainer = {}
---Options for creating an AspectContainer
---Options for creating an AspectContainer.
---@class AspectContainerCreate
---@field autoApply? boolean Whether the aspects should be applied automatically or not
---@field autoApply? boolean Whether the aspects should be applied automatically or not.
AspectContainerCreate = {}
---Create a new AspectContainer
---Create a new AspectContainer.
---@param options AspectContainerCreate
---@return AspectContainer
function settings.AspectContainer.create(options) end
---A aspect containing a boolean value
---A aspect containing a boolean value.
---@class BoolAspect : TypedAspect<boolean>
settings.BoolAspect = {}
@@ -63,7 +63,7 @@ settings.LabelPlacement = {
---@field labelPlacement? LabelPlacement:
BoolAspectCreate = {}
---Create a new BoolAspect
---Create a new BoolAspect.
---@param options BoolAspectCreate
---@return BoolAspect
function settings.BoolAspect.create(options) end
@@ -86,15 +86,15 @@ settings.StringDisplayStyle = {
};
---@class StringAspectCreate : TypedAspectCreate<string>
---@field displayStyle? StringDisplayStyle The display type of the aspect
---@field historyId? string The history id of the aspect
---@field displayStyle? StringDisplayStyle The display type of the aspect.
---@field historyId? string The history id of the aspect.
---@field valueAcceptor? function string (oldvalue: string, newValue: string)
---@field showToolTipOnLabel? boolean
---@field displayFilter? function string (value: string)
---@field placeHolderText? string
---@field acceptRichText? boolean
---@field autoApplyOnEditingFinished? boolean
---@field elideMode? Qt.TextElideMode The elide mode of the aspect
---@field elideMode? Qt.TextElideMode The elide mode of the aspect.
StringAspectCreate = {}
---@class StringAspect : TypedAspect<string>
@@ -116,9 +116,9 @@ settings.Kind = {
};
---@class FilePathAspectCreate
---@field expectedKind? Kind The kind of path we want to select
---@field historyId? string The history id of the aspect
---@field defaultPath? FilePath The default path of the aspect
---@field expectedKind? Kind The kind of path we want to select.
---@field historyId? string The history id of the aspect.
---@field defaultPath? FilePath The default path of the aspect.
---@field promptDialogFilter? string
---@field promptDialogTitle? string
---@field commandVersionArguments? string[]
@@ -136,8 +136,8 @@ settings.Kind = {
FilePathAspectCreate = {}
---@class FilePathAspect
---@field expandedValue FilePath The expanded value of the aspect
---@field defaultPath FilePath The default path of the aspect
---@field expandedValue FilePath The expanded value of the aspect.
---@field defaultPath FilePath The default path of the aspect.
settings.FilePathAspect = {}
---Create a new FilePathAspect
@@ -146,7 +146,7 @@ settings.FilePathAspect = {}
function settings.FilePathAspect.create(options) end
---Set the value of the aspect
---@param value string|FilePath The value to set
---@param value string|FilePath The value to set.
function settings.FilePathAspect:setValue(value) end
settings.IntegerAspect = {}
@@ -179,7 +179,7 @@ settings.OptionsPage = {}
---@field aspectContainer AspectContainer
OptionsPageCreate = {}
---Creates a new OptionsPage
---Creates a new OptionsPage.
---@param options OptionsPageCreate
---@return OptionsPage
function settings.OptionsPage.create(options) end

View File

@@ -1,36 +1,36 @@
---@meta
---@class QRect
---@field x integer The x position of the rectangle
---@field y integer The y position of the rectangle
---@field width integer The width of the rectangle
---@field height integer The height of the rectangle
---@field x integer The x position of the rectangle.
---@field y integer The y position of the rectangle.
---@field width integer The width of the rectangle.
---@field height integer The height of the rectangle.
QRect = {}
---@class QSize
---@field width integer The width of the size
---@field height integer The height of the size
---@field width integer The width of the size.
---@field height integer The height of the size.
QSize = {}
---@class QPoint
---@field x integer The x position of the point
---@field y integer The y position of the point
---@field x integer The x position of the point.
---@field y integer The y position of the point.
QPoint = {}
---@class QPointF
---@field x number The x position of the floating point
---@field y number The y position of the floating point
---@field x number The x position of the floating point.
---@field y number The y position of the floating point.
QPointF = {}
---@class QSizeF
---@field width number The width of the floating point size
---@field height number The height of the floating point size
---@field width number The width of the floating point size.
---@field height number The height of the floating point size.
QSizeF = {}
---@class QRectF
---@field x number The x position of the floating point rectangle
---@field y number The y position of the floating point rectangle
---@field width number The width of the floating point rectangle
---@field height number The height of the floating point rectangle
---@field x number The x position of the floating point rectangle.
---@field y number The y position of the floating point rectangle.
---@field width number The width of the floating point rectangle.
---@field height number The height of the floating point rectangle.
QRectF = {}

View File

@@ -3,99 +3,99 @@
local utils = {}
---Suspends the current coroutine for the given amount of milliseconds. Call `a.wait` on the returned value to get the result.
---@param ms number The amount of milliseconds to wait
---@param ms number The amount of milliseconds to wait.
function utils.waitms(ms) end
---Calls the callback after the given amount of milliseconds
---@param ms number The amount of milliseconds to wait
---@param callback function The callback to call
---Calls the callback after the given amount of milliseconds.
---@param ms number The amount of milliseconds to wait.
---@param callback function The callback to call.
function utils.waitms_cb(ms, callback) end
---@class FilePath
utils.FilePath = {}
---@param path string The path to convert
---@return FilePath The converted path
---Convert and clean a path, returning a FilePath object
---@param path string The path to convert.
---@return FilePath The converted path.
---Convert and clean a path, returning a FilePath object.
function utils.FilePath.fromUserInput(path) end
---@return FilePath The new absolute path
---@return FilePath The new absolute path.
---Searches for the path inside the PATH environment variable. Call `a.wait` on the returned value to get the result.
function utils.FilePath:searchInPath() end
---@class (exact) DirEntriesOptions
---@field nameFilters? string[] The name filters to use (e.g. "*.lua"), defaults to all files
---@field fileFilters? integer The filters to use (combination of QDir.Filters.*), defaults to QDir.Filters.NoFilter
---@field flags? integer The iterator flags (combination of QDirIterator.Flags.*), defaults to QDirIterator.Flags.NoIteratorFlags
---@field nameFilters? string[] The name filters to use (e.g. "*.lua"), defaults to all files.
---@field fileFilters? integer The filters to use (combination of QDir.Filters.*), defaults to QDir.Filters.NoFilter.
---@field flags? integer The iterator flags (combination of QDirIterator.Flags.*), defaults to QDirIterator.Flags.NoIteratorFlags.
---Returns all entries in the directory. Call `a.wait` on the returned value to get the result.
---@param options DirEntriesOptions
---@return FilePath[]
function utils.FilePath:dirEntries(options) end
---Returns the FilePath as it should be displayed to the user
---Returns the FilePath as it should be displayed to the user.
---@return string
function utils.FilePath:toUserOutput() end
---Returns whether the target exists
---Returns whether the target exists.
---@return boolean
function utils.FilePath:exists() end
---Returns whether the target is a file and executable
---Returns whether the target is a file and executable.
---@return boolean
function utils.FilePath:isExecutableFile() end
---Returns the path portion of FilePath as a string in the hosts native format
---Returns the path portion of FilePath as a string in the hosts native format.
---@return string
function utils.FilePath:nativePath() end
---Returns the last part of the path
---Returns the last part of the path.
---@return string
function utils.FilePath:fileName() end
---Returns the current working path of Qt Creator
---Returns the current working path of Qt Creator.
---@return FilePath
function utils.FilePath.currentWorkingPath() end
---Returns a new FilePath with the given tail appended
---@param tail string|FilePath The tail to append
---Returns a new FilePath with the given tail appended.
---@param tail string|FilePath The tail to append.
---@return FilePath
function utils.FilePath:resolvePath(tail) end
---Returns the parent directory of the path
---Returns the parent directory of the path.
---@return FilePath
function utils.FilePath:parentDir() end
---If the path targets a symlink, this function returns the target of the symlink
---@return FilePath The resolved path
---If the path targets a symlink, this function returns the target of the symlink.
---@return FilePath resolvedPath The resolved path.
function utils.FilePath:resolveSymlinks() end
---Returns the suffix of the path (e.g. "test.ui.qml" -> ".qml")
---Returns the suffix of the paths (e.g. "test.ui.qml" -> ".qml").
---@return string
function utils.FilePath:suffix() end
---Returns the complete suffix of the path (e.g. "test.ui.qml" -> "ui.qml")
---Returns the complete suffix of the paths (e.g. "test.ui.qml" -> "ui.qml").
---@return string
function utils.FilePath:completeSuffix() end
---Returns whether the path is absolute
---Returns whether the path is absolute.
---@return boolean
function utils.FilePath:isAbsolutePath() end
---@class HostOsInfo
---@field os "mac"|"windows"|"linux" The current host operating system
---@field architecture "unknown"|"x86"|"x86_64"|"itanium"|"arm"|"arm64" The current host architecture
---@field os "mac"|"windows"|"linux" The current host operating system.
---@field architecture "unknown"|"x86"|"x86_64"|"itanium"|"arm"|"arm64" The current host architecture.
utils.HostOsInfo = {}
---Returns whether the host operating system is windows
---Returns whether the host operating system is windows.
---@return boolean
function utils.HostOsInfo.isWindowsHost() end
---Returns whether the host operating system is mac
---Returns whether the host operating system is mac.
---@return boolean
function utils.HostOsInfo.isMacHost() end
---Returns whether the host operating system is linux
---Returns whether the host operating system is linux.
---@return boolean
function utils.HostOsInfo.isLinuxHost() end