Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting issue with the plugin present #6

Closed
muppet9010 opened this issue Aug 23, 2022 · 5 comments
Closed

Formatting issue with the plugin present #6

muppet9010 opened this issue Aug 23, 2022 · 5 comments

Comments

@muppet9010
Copy link
Contributor

muppet9010 commented Aug 23, 2022

Somehow the plugin being present is causing this formatting issue I reported to Sumneko:
LuaLS/lua-language-server#1490


185979148-5c2d6706-fbab-4d65-a9c3-f69f4c457572

Have a new file with some content, add a comment block to the end of the file and add a new line within the content block, the file is cleared.

I know its Sumneko as it doesn't happen when I disable the extension. It only started in the last version or 2.

Start with file content:

local x = 1

Press enter a few times to get some empty lines

Type --[[ and it auto completes the closing ]], leaving the cursor in the middle of the command block.

Press enter to add a new line, with the intention of typing within the comment block. The file is cleared at this point.


I've reproduced this twice with the plugin being present the issue occurs. If I remove the plugin lua folder from the .vscode folder then issue doesn't occur. I restart VSCode between each try and let Sumneko full load and do its TypeDef processing.

@JanSharp
Copy link
Owner

I cannot reproduce with my configuration unforutantely. However the plugin is not doing anything in this file, which leads me to believe that the simple existence of the plugin is not handled properly by the formatting logic in sumneko.lua.

I would suggest to first try this and see if it also has the same behavior:
Have a lua file somewhere with the contents below and change your Lua.runtime.plugin path to point to that file instead of the factorio plugin.

function OnSetText()
  return {}
end

If you can still reproduce the issue with this stub plugin then I really can't do anything, you'd have to report back to the issue in sumneko.lua. They might need your config, although the config does seem like it is in the log file. I just have trouble extracting information from that log file since I'm not familiar with all the default values.

If the issue does not occur with the stub plugin then we have a much more convoluted bug at our hands

@muppet9010
Copy link
Contributor Author

Ah so the issue happens with your dummy plugin contents. And I know your real plugin isn't active as when I hover over a global.bob I don't see the mod name on the global's "scope" or whatever it is.

@JanSharp
Copy link
Owner

Yea then I can't help much, sorry. I don't know enough about the internals of the language server to diagnose this issue, so your best bet is to tell them to use the dummy plugin with your config to reproduce the issue. I'm not doing that myself since I don't know what configuration you're using (your settings.json file for vscode (workspace and or user), all settings starting with Lua.), plus you might not even need to share those since, like I said previously, the info might already be in the log file. Long story short, the sumneko.lua maintainers should be able to assist you much better than I ever could

@muppet9010
Copy link
Contributor Author

oh sorry, meant to say I have passed on the details to them including the dummy plugin file, etc.
I jumped to updating their GitHub issue too quickly.

@JanSharp
Copy link
Owner

:D you're fine. I just saw your message in the other issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants