You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
This is not exactly a bug, but I don't see a better choice for where to put this.
The instructions for installing luac on Mac should be: brew install lua
Also, I have installed Visual Studio Code, lua (including luac), and lualinter. It says it is running in Visual Studio Code, with the default options. And my Code explorer shows the Lua Scripts folder that contains luaconfig.config. But I'm getting no de-linting joy. Any ideas?
On Tue, Jun 9, 2020 at 6:40 PM Nick Mazuk ***@***.***> wrote:
Ok, I'll update the markdown file.
If you go to preferences (⌘ comma), is "Format on Save" turned on? If not,
that's likely the issue. I'm also adding that to the markdown file.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYB6X2TDKBWOCDSTLSYD73RV3B3PANCNFSM4NZ3DIRA>
.
All three of Format on Save, Paste, and Type were unchecked. But I'm still
not getting the love.
On Tue, Jun 9, 2020 at 6:40 PM Nick Mazuk ***@***.***>
wrote:
> Ok, I'll update the markdown file.
>
> If you go to preferences (⌘ comma), is "Format on Save" turned on? If
> not, that's likely the issue. I'm also adding that to the markdown file.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#5 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ACYB6X2TDKBWOCDSTLSYD73RV3B3PANCNFSM4NZ3DIRA>
> .
>
I'm getting some formatting, but it seems to be generic. Like it
automatically maintains the indent levels for if end, for end, etc. But it
does not change the formatting if you put an if statement on a single line.
On Wed, Jun 10, 2020 at 12:21 PM Nick Mazuk ***@***.***> wrote:
Hmm…
I'm not sure why it's not working.
The only thing I can think of is that perhaps you are already writing
formatted code?
If you want to test this, try using this line of code:
if variable<2 then print('hello') end
It should turn into
if variable < 2 then
print("hello")
end
@CJGarciaMusic <https://github.com/CJGarciaMusic> Have you used the
linter? If so, anything else you had to do to set it up?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYB6X4ANQXN2TEM24V5YZTRV66FTANCNFSM4NZ3DIRA>
.
Interesting. Honestly, I don't know what's causing that. I had no trouble with the setup myself. I've tried to replicate the issue on my end, but I haven't been able to.
In short, I was wondering why my code formatting wasn't working anymore for Lua files and had to debug it. The lua-linter extension did not seem to be formatting the code. Instead, I had another extension called vscode-lua-format which formats the code.
This extension was already installed for me, but I had to add this to VS Code's settings.json
Remind me how to tell if it's working. Also, the settings.json I found was
in
~/Library/Application Support/Code/User
Adding it to that didn't seem to make any difference. Is there another
settings.json?
On Fri, Jul 30, 2021 at 9:43 PM Nick Mazuk ***@***.***> wrote:
I may have written about the wrong plugin…
In short, I was wondering why my code formatting wasn't working anymore
for Lua files and had to debug it. The lua-linter extension did not seem
to be formatting the code. Instead, I had another extension called
vscode-lua-format which formats the code.
This extension was already installed for me, but I had to add this to VS
Code's settings.json
"[lua]": {
"editor.defaultFormatter": "Koihik.vscode-lua-format"
},
So my guess is that to get the code formatting, you need to:
1. Install vscode-lua-format
<https://marketplace.visualstudio.com/items?itemName=Koihik.vscode-lua-format>
2. Add the above snippet to your settings.json
If this works for you, I'll update the docs.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACYB6XZXIB2RDLXH65JF4WTT2NPL5ANCNFSM4NZ3DIRA>
.
If it is not formatted, you can try to manually trigger the format. The easiest way is to use the command palette (⌘⇧P) and type/select Format Document.
For the settings.json, I'm not 100% sure where it is on the disk. I always open it through the command palette (⌘⇧P) and select Preferences: Open Settings (JSON) to edit it straight in VS Code.
Can you show me the thing I need to add to settings.json in context? For
now, I've installed the vscode_lua_format thing, but I'm still not getting
any formatting.
Thanks,
Robert
Hate to beat a dead horse, but I was playing around with a new folder structure for Lua scripts this weekend and found out that this setting must be set for code formatting to work.
The formatter seems to not automatically pick up the config file.
I applied the settings from the files in PR #156 and I now have Lua linter function in VS Code. It is complaining that it can't find the file ./luaconfig.config. Is that something that should be added to the Pull Request?
Activity
[-][BUG][/-][+][BUG] Lua Linter setup[/+]Nick-Mazuk commentedon Jun 9, 2020
Ok, I'll update the markdown file.
If you go to preferences (⌘ comma), is "Format on Save" turned on? If not, that's likely the issue. I'm also adding that to the markdown file.
rpatters1 commentedon Jun 9, 2020
rpatters1 commentedon Jun 10, 2020
Nick-Mazuk commentedon Jun 10, 2020
Hmm…
I'm not sure why it's not working.
The only thing I can think of is that perhaps you are already writing formatted code?
If you want to test this, try using this line of code:
It should turn into
@CJGarciaMusic Have you used the linter? If so, anything else you had to do to set it up?
rpatters1 commentedon Jun 12, 2020
Nick-Mazuk commentedon Jun 15, 2020
Interesting. Honestly, I don't know what's causing that. I had no trouble with the setup myself. I've tried to replicate the issue on my end, but I haven't been able to.
Nick-Mazuk commentedon Jul 31, 2021
I may have written about the wrong plugin…
In short, I was wondering why my code formatting wasn't working anymore for Lua files and had to debug it. The
lua-linterextension did not seem to be formatting the code. Instead, I had another extension calledvscode-lua-formatwhich formats the code.This extension was already installed for me, but I had to add this to VS Code's
settings.jsonSo my guess is that to get the code formatting, you need to:
vscode-lua-formatsettings.jsonIf this works for you, I'll update the docs.
rpatters1 commentedon Jul 31, 2021
Nick-Mazuk commentedon Aug 7, 2021
If everything is working, this…
…should be reformatted to this when you save:
If it is not formatted, you can try to manually trigger the format. The easiest way is to use the command palette (⌘⇧P) and type/select
Format Document.For the settings.json, I'm not 100% sure where it is on the disk. I always open it through the command palette (⌘⇧P) and select
Preferences: Open Settings (JSON)to edit it straight in VS Code.rpatters1 commentedon Aug 7, 2021
Nick-Mazuk commentedon Mar 27, 2022
Hate to beat a dead horse, but I was playing around with a new folder structure for Lua scripts this weekend and found out that this setting must be set for code formatting to work.
The formatter seems to not automatically pick up the config file.
Nick-Mazuk commentedon Mar 27, 2022
Just created PR #156 which includes all my relevant settings and extensions for this repo.
(or at least I think it has all my relevant settings and extensions).
rpatters1 commentedon Apr 28, 2022
I applied the settings from the files in PR #156 and I now have Lua linter function in VS Code. It is complaining that it can't find the file
./luaconfig.config. Is that something that should be added to the Pull Request?rpatters1 commentedon Apr 28, 2022
A new issue I'm having is that it is adding in spurious line breaks when I save. Is there a setting to prevent this?
rpatters1 commentedon Apr 28, 2022
Never mind. I found
./luaconfig.config(lol) and it also addressed the spurious line breaks.Nick-Mazuk commentedon Apr 29, 2022
Great! Glad you finally got it working and figured out those issues. Is it time to close this issue?
rpatters1 commentedon Apr 29, 2022
Yes, I think so.