Repository navigation
feat: register luau-lsp for omp sessions with the tern definitions - #8
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OMP's built-in Lua server covers only
.lua(LuaJIT/Vim settings), so OMP sessions in this repository had no language server forwindow.luau..omp/lsp.jsonregistersluau-lsp lspfor.luaufiles with--definitions=@tern=types/tern.d.luau,languageId: "luau"(OMP maps no language id for.luau),plugin.tomlas the root marker, and the standard (non-Roblox) platform with the Rojo sourcemap off. CONTRIBUTING.md names it next to the existingluau-lspprerequisite.Proof through OMP 18.18.0's own
lsptool, from the repository root on luau-lsp 1.70.1 (dotfiles-ngscripts/lsp-smoke.ts):tern.plugin.data(window.luau:13):string, "Absolute path of the plugin's data directory (holdskv.json)." fromtypes/tern.d.luaunow_ms(window.luau:118) resolves to window.luau:77window.luau: clean, asluau-lsp analyzereportstern.log.warnx("probe"):TypeError: Key 'warnx' not found in table '{ debug, error, info, warn }'(1002), the same errorluau-lsp analyze --definitions=types/tern.d.luauprints; the file was removed afterwardsGo-to-definition on Tern globals (
tern,tern.log.warn) returns nothing: luau-lsp 1.70.1 gives definition-file globals no source location, so hover is the navigation for Tern APIs.Existing checks:
python3 -B -m unittest discover -s tests -t .(155 tests, OK, 1 skipped) andluau-lsp analyze --definitions=types/tern.d.luau window.luau(exit 0).