# Lua -MQ VS Code Lua Autocomplete Definition Library (2 Viewers)1.0.0

#### Coldblooded

##### Purveyor of all things MQNext and Lua
Coldblooded submitted a new resource:

MQ VS Code Lua Autocomplete Definition Library - Work Smarter, not Harder

What it is:

This is a collection of Lua files that mimic the MQ libraries and contain Annotation tags that are a lot like standard Lua comments but contain information that allows us to create definitions for Classes, Fields, Functions, Function signatures, and return types. IDEs then use this information to provide typeahead, autocompletion, documentation, and class type information while you write your code. All this results in writing more accurate code, with fewer mistakes, and...

#### burdsjm

Very cool.

Not sure I did it right but I just saved the directory right in my mqnext\lua folder and it works.

#### burdsjm

Nvm the mq.lua crashes all the lua's in game. Don't do what I did.

#### Cannonballdex

Excuse my lack of knowledge here.

Place the files in a subdirectory under your project

Where do I find my project?

#### Coldblooded

##### Purveyor of all things MQNext and Lua
Excuse my lack of knowledge here.

Place the files in a subdirectory under your project

Where do I find my project?

Poor words on my part. Directions updated.
Should be "Place the files in a subdirectory under your Lua directory"

#### Coldblooded

##### Purveyor of all things MQNext and Lua
Should we name this subdirectory anything specific?
No, whatever you like. Mine is just named mq-defintions because I do a git clone into the Lua directory and that's the name of the git repo

#### Cannonballdex

I set up the settings file, already had the Lua Language Server installed. Placed the files in my MQNext Lua Folder and still not getting what I'm looking for. Anything I am doing wrong here?

#### Attachments

• Untitled.png
4.6 KB · Views: 5
• Untitled2.png
10.2 KB · Views: 5

#### rouneq

Should we name this subdirectory anything specific?
I call mine "annotations" because I have a lot more than the mq definitions in them. I've already gone through a major overhaul of the original mq annotations and spent time in discussion with the Lua Language Server community on how to annotate the API to better reflect how calling code should look. I'm in the middle of a project, but once I have some breathing room I'll see what's different with the definitions here vs what I came up with.

#### Cannonballdex

I set up the settings file, already had the Lua Language Server installed. Placed the files in my MQNext Lua Folder and still not getting what I'm looking for. Anything I am doing wrong here?
Anyone know how to install this to get the results intended?

#### Coldblooded

##### Purveyor of all things MQNext and Lua
I set up the settings file, already had the Lua Language Server installed. Placed the files in my MQNext Lua Folder and still not getting what I'm looking for. Anything I am doing wrong here?
You might want to double check that config. The screenshot you displayed had the path looking exactly like this example, which needs to be modified to work correctly. It's just an example.
Example:
{
"Lua.runtime.version": "Lua 5.1",
"Lua.workspace.library": [
"./relative/path/to/mq/def",
"./relative/path/to/imgui/def"
],
}

#### Cannonballdex

You might want to double check that config. The screenshot you displayed had the path looking exactly like this example, which needs to be modified to work correctly. It's just an example.
Example:
{
"Lua.runtime.version": "Lua 5.1",
"Lua.workspace.library": [
"./relative/path/to/mq/def",
"./relative/path/to/imgui/def"
],
}
I had an idea that was it but I wasn't sure of the relative path to imgui.

I tried every absolute path that I could find, added the imgui.lua to my lua folder and edited both config files. One in the vscode folder and the one in the definition folder. Just not working for me. lol

Last edited:

#### Dragonslayer

seems I didn't unsterstand the Instructions:

In order to be as close to the author as possible, I copied the content of the zip into the folder "MQNext\lua\mq-defintions"
As soon as I add the Line"[email protected] Mq"
I get the Error Message as shown below

I presume, my problem is, that I don't understand what to look for, in order to be able to set the 2 lines of the "Lua.workspace.library" in settings.json

settings.json:
{
"Lua.runtime.version": "Lua 5.1",
/*  "Lua.workspace.library": [
"./mq/def",
"./imgui/def"
],    */
}

Should the path point to a folder like "MQNext\lua\mq\def" like ""./mq/def""? I found a folder "mq" within the folder "lua", but there is no folder "def" within the folder "mq".
Similar for imgui.

What am I missing?

#### Cannonballdex

seems I didn't unsterstand the Instructions:
View attachment 42024

In order to be as close to the author as possible, I copied the content of the zip into the folder "MQNext\lua\mq-defintions"
As soon as I add the Line"[email protected] Mq"
I get the Error Message as shown below

View attachment 42023

I presume, my problem is, that I don't understand what to look for, in order to be able to set the 2 lines of the "Lua.workspace.library" in settings.json

settings.json:
{
"Lua.runtime.version": "Lua 5.1",
/*  "Lua.workspace.library": [
"./mq/def",
"./imgui/def"
],    */
}

Should the path point to a folder like "MQNext\lua\mq\def" like ""./mq/def""? I found a folder "mq" within the folder "lua", but there is no folder "def" within the folder "mq".
Similar for imgui.

What am I missing?
I'm stuck in the same boat. I assume the /def part is the folder name in your lua folder and mine is C:\MQNext\lua\mq-definitions. But no idea where the imgui is or should be located. Is this the imgui.lua file or a folder? Hope to get this working myself.

#### aquietone

I'm stuck in the same boat. I assume the /def part is the folder name in your lua folder and mine is C:\MQNext\lua\mq-definitions. But no idea where the imgui is or should be located. Is this the imgui.lua file or a folder? Hope to get this working myself.
coldblooded has 2 git repos, mq-definitions and mq-imgui-definitions
Both just go into your lua folder. All you need to do to use them after that and the settings updates, is have the [email protected] Mq and [email protected] ImGui

#### Cannonballdex

coldblooded has 2 git repos, mq-definitions and mq-imgui-definitions
Both just go into your lua folder. All you need to do to use them after that and the settings updates, is have the [email protected] Mq and [email protected] ImGui
Thank you. Works like a charm.

#### Dragonslayer

@Cannonballdex: did you enter the full absolute path?
I tried ". /. /mq-definitions" which should be the relativ path to the folder, but that seemed to not do the trick.

#### Cannonballdex

@Cannonballdex: did you enter the full absolute path?
I tried ". /. /mq-definitions" which should be the relativ path to the folder, but that seemed to not do the trick.
I have my structure like so, using windows, you might get the idea of how to set up the settings.json
C:\MQNext\lua\mq-definitions
C:\MQNext\lua\mq-imgui-definitions

My settings for vscode ended up C:\Users\MyComp\AppData\Roaming\Code\User\settings.json
INI:
{
"Lua.runtime.version": "Lua 5.1",
"Lua.workspace.library": [
"C:\\MQNext\\lua\\mq-definitions",
"C:\\MQNext\\lua\\mq-imgui-definitions"
]
}

Replies
0
Views
426
Replies
3
Views
1K
Replies
6
Views
1K
Replies
0
Views
190
Replies
1
Views
137

• C