vscode-lua-format icon indicating copy to clipboard operation
vscode-lua-format copied to clipboard

TTSLua

Open Kijan opened this issue 4 years ago • 8 comments

Hi I am new to VSC and wanted to use your formatter for files with the extension *.ttslua. But i cant get it to work. Can you tell me what i have to change to get to work?

Kijan avatar Apr 06 '20 08:04 Kijan

  • [ ] First of all install the extension
  • [ ] Then right click on the .lua file
  • [ ] After that select "Format document with..."
  • [ ] At last select "vscode-lua-format"

karanankit01 avatar Apr 06 '20 10:04 karanankit01

no i think you missunderstood me. i have it installed in VSC and when i have lua files and press ALT+SHIFT+F it works like it should ;) but i have *.ttslua and there i get every time "There is no formatter for 'TTS Lua' files installed." so thats why i thought your formatter is not set to ttslua and maybe that could be changed easily like i did it for Atom editor. but i cant get it to work for VSC -.-

Kijan avatar Apr 06 '20 11:04 Kijan

"files.associations": {
    "*.ttslua": "lua"
}

You can add this in your settings.json. VSC will treat .ttslua as .lua.

Koihik avatar Apr 07 '20 02:04 Koihik

That is not a good alternative because i am using an other extension for the ttslua with autofill and other stuff that will not work when it is triggert as lua sorry :(

Kijan avatar Apr 07 '20 07:04 Kijan

That is not a good alternative because i am using an other extension for the ttslua with autofill and other stuff that will not work when it is triggert as lua sorry :(

"[ttslua]": {
    "editor.defaultFormatter": "Koihik.vscode-lua-format"
},

specify LuaFormatter as default formatter for any extension you want. btw: LuaFormatter only works when the file is a valid Lua source file.

Koihik avatar Apr 07 '20 09:04 Koihik

i cant get it to work :( "files.associations": { "*.ttslua": "TTS Lua" }, "[ttslua]": { "editor.defaultFormatter": "Koihik.vscode-lua-format" }, "[TTS Lua]": { "editor.defaultFormatter": "Koihik.vscode-lua-format" }, "[TTSLua]": { "editor.defaultFormatter": "Koihik.vscode-lua-format" }, i tested different things... when i change "*.ttslua": "TTS Lua" to lua then your formatter works but the other extension not any more...

Kijan avatar Apr 07 '20 09:04 Kijan

i cant get it to work :( "files.associations": { "*.ttslua": "TTS Lua" }, "[ttslua]": { "editor.defaultFormatter": "Koihik.vscode-lua-format" }, "[TTS Lua]": { "editor.defaultFormatter": "Koihik.vscode-lua-format" }, "[TTSLua]": { "editor.defaultFormatter": "Koihik.vscode-lua-format" }, i tested different things... when i change "*.ttslua": "TTS Lua" to lua then your formatter works but the other extension not any more...

Each language has a unique identifier in VSCode. Language Identifiers If other extension works well, you can check language identifier on status bar.

Koihik avatar Apr 08 '20 12:04 Koihik

yeah if i click at the bottom then at the top there is "(TTS Lua)" next to "Tabletop Simulator Lua"... thats why i tested this but it is not working... I stopped to try getting it to work.

Kijan avatar Apr 08 '20 14:04 Kijan