Merge pull request #2558 from Feodoric/autocomplete-with-no-leading-slash

Fixes autocomplete for scripts in directory without using leading slash
This commit is contained in:
hydroflame 2022-01-11 12:10:56 -05:00 committed by GitHub
commit fa0f5cb451
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -299,7 +299,7 @@ export async function determineAllPossibilitiesForTabCompletion(
const filename = command[1] + "";
if (!isScriptFilename(filename)) return; // Not a script.
if (filename.endsWith(".script")) return; // Doesn't work with ns1.
const script = currServ.scripts.find((script) => script.filename === filename);
const script = currServ.scripts.find((script) => script.filename === filename || script.filename === '/' + filename);
if (!script) return; // Doesn't exist.
if (!script.module) {
await compile(p, script, currServ.scripts);