luau-lsp

Language Server Implementation for Luau

MIT License

Stars
232

Bot releases are visible (Hide)

luau-lsp - 1.22.1

Published by github-actions[bot] over 1 year ago

[1.22.1] - 2023-07-15

Changed

  • Sync to upstream Luau 0.584
  • Removed need for typechecking for operations that don't require the type information (e.g., document link / color)

Fixed

  • Fixed diagnostics not showing when working in a new file with no workspace open
  • Fixed race condition where sometimes the server does not receive user configuration on initial load, falling back to defaults
  • luau-lsp.fflags.override will now be parsed when using CLI analyze settings. Note that the other fflags options are not supported in CLI analyze mode
  • Fixed semantic tokens segfault crash on some tables
  • Fixed duplicate definitions showing in the Go To Definition page
  • Fixed some syntax highlighting inconsistencies
  • Added a temporary fix to "RecursionLimitException" exceptions leaking to the public interface.
luau-lsp - 1.22.0

Published by github-actions[bot] over 1 year ago

[1.22.0] - 2023-06-30

Added

  • Support requiring directories with init.luau (or init.lua) files inside of them. i.e. require("../Directory") resolves to ../Directory/init.luau.
  • The CLI analyze now accepts a parameter --settings=path/to/settings.json which takes in LSP-style settings to configure features such as require settings. Note: this is separate to .luaurc

Changed

  • Significant improvements to memory usage in large workspaces when workspace indexing or diagnostics are enabled
  • Sync to upstream Luau 0.582
  • Deprioritise file or directory aliases over exact paths in autocomplete, since typically aliases start with a prefix (e.g. @)
  • Signature Help is more intelligent about providing information about the best function overload which matches

Fixed

  • Fixed language features not working in new untitled files
  • Fixed incorrect color conversions in the color picker between RGB/HSV/Hex
  • Fixed autoimporting modules not respecting multiline requires
  • Fixed documentation for debug and utf8 library
  • Fixed synthetic typeof() showing up in signature help for builtin tables (e.g. function typeof(string).byte(...))
  • Fixed signature help highlighting for string library
  • Fixed rename symbol on a type definition type NAME = ...
  • Fixed file and directory aliases not being canonicalised to absolute paths causing "Follow Link" to fail when using relative alias paths
  • Don't show directory aliases after the first path segment has been typed
  • Fixed rename symbol not working when triggered at the end of a symbol
  • Fix indentation of autocomplete end when autocompleting inside of a function call
luau-lsp - 1.21.0

Published by github-actions[bot] over 1 year ago

[1.21.0] - 2023-06-14

Deprecated

  • Deprecated luau-lsp.autocompleteEnd setting in favour of luau-lsp.completion.autocompleteEnd

Added

  • Added folding ranges for multi-line function definitions, so long parameter lists can be collapsed
  • Added notification when we detect definitions file changes
  • Added support for auto-requiring modules when autocompleteing a type reference, to allow indexed types: i.e. autocompleting Module in type Foo = Module.Bar
  • Added luau-lsp.require.directoryAliases to map require string prefixes to directories
  • Added tilde expansion to luau-lsp.require.fileAliases (and directoryAliases), mapping ~/foo.lua to a file in your home directory
  • End autocompletion will now work for defined anonymous functions inside of function calls

Changed

  • Sync to upstream Luau 0.580
  • Updated workspace indexing strategy to minimise memory usage. We no longer index ignored files (luau-lsp.ignoreGlobs),
    and there is a setting luau-lsp.index.maxFiles (default: 10,000) to configure the amount of files indexed before backing off.

Fixed

  • When editing in model projects, we now force relative requires, instead of incorrect absolute requires using a "ProjectRoot"
luau-lsp - 1.20.2

Published by github-actions[bot] over 1 year ago

[1.20.2] - 2023-05-10

Fixed

  • Fixed internal error for LazyType unwrapping
luau-lsp - 1.20.1

Published by github-actions[bot] over 1 year ago

[1.20.1] - 2023-05-09

Fixed

  • Fixed bug in semantic tokens system causing language server crashes
luau-lsp - 1.20.0

Published by github-actions[bot] over 1 year ago

[1.20.0]

Added

  • Added support for workspace symbols to resolve symbols across the whole workspace. In VSCode, you can open this using Ctrl + T
  • Added configuration option luau-lsp.require.fileAliases to statically provide custom mappings from string requires to a file path.
    For example, adding @example/constants mapping to C:/fakepath/constants.luau will automatically resolve require("@example/constants")
  • Added support for Folding Ranges. The language server now signals the following foldable ranges in a document:
    • Whole blocks, such as do .. end, for - do .. end function() .. end etc.
    • Tables, and type tables x = { .. }
    • Multiline function calls foo(..)
    • Block comments --[[ .. ]]
    • Custom comment regions denoted using --#region and --#endregion
  • Added support for Call Hierarchies. Call Hierarchies allow you to view all incoming and outgoing calls of a function:
    i.e., all functions that call the current function, as well as all functions that the current function calls.
    This works at multiple levels, displaying ancestor and descendant functions.

Changed

  • Sync to upstream Luau 0.575
luau-lsp - 1.19.2

Published by github-actions[bot] over 1 year ago

[1.19.2]

Fixed

  • Fixed forced expressive types in diagnostics
  • Added option --no-strict-dm-types for analyze CLI to disable strict datamodel types and its associated false positives
luau-lsp - 1.19.1

Published by github-actions[bot] over 1 year ago

[1.19.1] - 2023-04-27

Fixed

  • Fixed regression in DataModel item autocompletion
luau-lsp - 1.19.0

Published by github-actions[bot] over 1 year ago

[1.19.0] - 2023-04-26

Deprecated

  • Deprecated config luau-lsp.completion.suggestImports: use luau-lsp.completion.imports.enabled instead

Added

  • Added setting luau-lsp.index.enabled which will index the whole workspace into memory. If disabled, only limited support for Find All References and rename is possible
  • Added support for finding all references of both local and exported types. For exported types, luau-lsp.index.enabled must be enabled for full support.
  • Added support for renaming table properties across files. If luau-lsp.index.enabled is disabled, this feature is disabled for correctness reasons.
  • Added support for renaming types (both local and exported). If luau-lsp.index.enabled is disabled, this exported types renaming is disabled for correctness reasons.
  • Added more settings to auto-importing:
    • luau-lsp.completion.imports.enabled: replaces luau-lsp.completion.suggestImports (default: false)
    • luau-lsp.completion.imports.suggestServices: whether GetService imports are included in suggestions (default: true)
    • luau-lsp.completion.imports.suggestRequires: whether auto-requires are included in suggestions (default: true)
    • luau-lsp.completion.imports.requireStyle: the style of require format (default: "auto")
    • luau-lsp.completion.imports.separateGroupsWithLine: whether an empty line should be added in between services and requires (default: false)

Changed

  • Sync to upstream Luau 0.573
  • Improved find all references system for tables. We can now track all references to table and its properties across files. This requires luau-lsp.index.enabled to be enabled for full support.

Fixed

  • Fixed pull diagnostics result not following spec
  • Fixed errors when file has shebang #! present at top of file
  • Fixed string require autocompletion failing when autocomplete triggered on an incomplete string, e.g. require("Constants/Te|").
    Originally, nothing would autocomplete. Now, everything inside of the Constants folder will still autocomplete as usual (filtered for "Te").
luau-lsp - 1.18.1

Published by github-actions[bot] over 1 year ago

[1.18.1] - 2023-03-23

Fixed

  • Fixed server crash when auto require imports is enabled and there is a type-asserted require present in the file (require(location) :: any)
  • Fixed additional automatic service imports when completing an automatic require import being placed before a hot comment (such as --!strict)
  • Fixed automatic require import being placed incorrectly we also autocomplete a service. This can be shown when there is a multiline comment, and the service is imported above that comment, but the require gets imported inside of the comment incorrectly.
luau-lsp - 1.18.0

Published by github-actions[bot] over 1 year ago

[1.18.0] - 2023-03-20

Added

  • Added support for changing Color3 colors using the color picker
  • Added support for automatic require imports (currently only for Roblox mode). If you start typing the name of a module in your code, you can autocomplete the require statement automatically. This feature is enabled by setting luau-lsp.completion.suggestImports. (Thanks @HawDevelopment!)

https://user-images.githubusercontent.com/19635171/226330935-9ece767e-7b6e-45a1-aaaa-db6a1930550f.mp4

Changed

  • Sync to upstream Luau 0.568.
    In particular, this provide improvements to control flow analysis refinements. This allows the type checker to recognise type
    options that are unreachable after a conditional/unconditional code block. e.g.:
local function x(x: string?)
    if not x then return end

    -- x is 'string' here
end

To enable this feature, the FFlag LuauTinyControlFlowAnalysis must currently be enabled.

  • The language server will only be enabled on "file" and "untitled" schemes. This means it will be disabled in diff mode
    and live share. This is because we cannot yet provide sufficient information in these contexts.
luau-lsp - 1.17.1

Published by github-actions[bot] over 1 year ago

[1.17.1] - 2023-03-04

Changed

  • Sync to upstream Luau 0.566

Fixed

  • Don't autocomplete another set of parentheses on a function call if they already exist
  • Fix .luaurc in current working directory not taken into account when calling luau-lsp analyze
  • Fixed slowdown of autocompletion when at a position where a type is explicitly expected (e.g., autocompleting a return expression when a return type is specified). Currently requires LuauAutocompleteSkipNormalization to be enabled
luau-lsp - 1.17.0

Published by github-actions[bot] over 1 year ago

[1.17.0] - 2023-02-12

Added

  • Added two code actions: Sort requires and Sort services (services only enabled if luau-lsp.types.roblox == true).
    These actions will sort their respective groups alphabetically based on a variable name set.
    You can also set these actions to automatically run on save by configuring:
"editor.codeActionsOnSave": {
    "source.organizeImports": true
}

https://user-images.githubusercontent.com/19635171/218268532-b967a0d8-0192-4a50-912f-cbd5b3a99944.mp4

Equivalent functionality has also been added to StyLua

Changed

  • Sync to upstream Luau 0.563

  • Prioritised common services and Instance properties/methods in autocomplete so that they show up first. This is especially useful for services like ReplicatedStorage, and methods like :FindFirstChild

Before After
image image
image image

Fixed

  • Further fixes to document symbols failing due to malformed ranges
luau-lsp - 1.16.4

Published by github-actions[bot] over 1 year ago

[1.16.4] - 2023-02-10

Fixed

  • Fixed document symbols crashing due to internal malformed data
luau-lsp - 1.16.3

Published by github-actions[bot] over 1 year ago

[1.16.3] - 2023-02-09

Fixed

  • Changed internal representation of documents to reduce the likelihood of Request Failed for "No managed text document"

Please do let me know if this has improved (or worsened) the issue!

luau-lsp - 1.16.2

Published by github-actions[bot] over 1 year ago

[1.16.2] - 2023-02-01

Fixed

  • Fixed document symbol crash on incomplete functions
  • Fixed --base-luaurc not registering for an LSP server
  • Fixed crashing on invalid FFlags configuration - the VSCode client will now validate the flags
luau-lsp - 1.16.1

Published by github-actions[bot] over 1 year ago

[1.16.1] - 2023-01-30

Fixed

  • Fixed error in document symbols not conforming to specification - selectionRange will now be fully enclosed by range
luau-lsp - 1.16.0

Published by github-actions[bot] over 1 year ago

[1.16.0] - 2023-01-29

Added

  • Support documentation comments attached to a table and table types, e.g. on DATA in the following:
--- Doc comment
local DATA = {
    ...
}

--- Doc comment
type Contents = {
	...
}
  • Include documentation comments on functions and tables in autocompletion
  • Added configuration option luau-lsp.require.mode to configure how string requires are resolved. It can either be relativeToWorkspaceRoot (default) or relativeToFile
  • Added luau-lsp.types.documentationFiles to support adding extra documentation symbols to the database. These are used to support definition files, and should be in the same format as shown here
  • Added luau-lsp.diagnostics.strictDatamodelTypes (default: false) which configures whether we use expressive DataModel types to power diagnostics.
    When off, game / script / workspace (and all their members) are typed as any, which helps to prevent false positives, but may lead to false negatives.
  • Added CLI option --base-luaurc=PATH for both LSP and Analyze mode to provide a path to a .luaurc file which is used as the default configuration
  • Added support for Go To Definition / Type Definition on imported type references module.Type (gated behind FFlag SupportTypeAliasGoToDeclaration)

Changed

  • Sync to upstream Luau 0.560
  • Class symbols with no documentation present in the docs file will no longer show anything on hover/autocomplete (i.e. won't show @luau/global/require)
  • Instance.new() now accepts variables which are of type string without erroring. It will instead error when Instance.new is called with a string literal which is an unknown class name
  • In the CLI, luau-lsp lsp now supports passing multiple --docs= parameters
  • The CLI will now error when an unknown option is passed to it
  • Diagnostics will now be emitted on .luaurc files with parse errors

Fixed

  • Fixed unknown require errors occurring in multi-root workspaces when in a folder which isn't the first one
  • Fixed diagnostics not clearing for files which were deleted unconventionally (i.e., outside of VSCode using File Explorer, or external commands such as git stash)
luau-lsp - 1.15.0

Published by github-actions[bot] almost 2 years ago

[1.15.0] - 2023-01-11

Added

  • Added syntax highlighting support for interpolated strings

image

  • Added color viewers for Color3.new/fromRGB/fromHSV/fromHex (gated behind config.types.roblox)

image

  • Added support for autocompleting require-by-string functions with files and folders when using base Luau

https://user-images.githubusercontent.com/19635171/211882665-9ae31390-830d-4871-bb3b-3c15c1a0c9b2.mp4

  • Support documentation comments on variables:
--- documentation comment
local x = "string"

--- another doc comment
local y = function()
end
  • Support documentation comments on table properties, such as the following:
local tbl = {
    --- This is some special information
    data = "hello",
    --- This is a doc comment
    values = function()
    end,
}

local x = tbl.values -- Should give "This is a doc comment"
local y = tbl.data -- Should give "This is some special information"

Changed

  • Sync to upstream Luau 0.558
  • All Luau FFlags are no longer enabled by default. This can be re-enabled by configuring luau-lsp.fflags.enableByDefault. It is recommended to keep luau-lsp.fflags.sync enabled so that FFlags sync with upstream Luau
  • Allow variable number of = sign for multiline doc comments, so --[[ and --[===[ etc. are valid openers

Fixed

  • Luau analyze now exits with code 0 if there are no reported errors (all errors are ignored)
  • require(instance:FindFirstChild("Testing", true)) will no longer resolve as an immediate child of instance due to the recursive argument
  • Fixed a bug where internally the wrong pointer to an Instance type was being used for DM nodes which manifested into failed unification and never types
  • Constant variables will now be syntax highlighted appropriately at definition site (local CONSTANT)

Full Changelog: https://github.com/JohnnyMorganz/luau-lsp/compare/1.14.3...1.15.0

luau-lsp - 1.14.3

Published by github-actions[bot] almost 2 years ago

[1.14.3] - 2022-12-10

Changed

  • Sync to upstream Luau 0.556 (fixes crashing problems)
  • Sync to latest language client