Closed robotboy655 closed 9 months ago
@Goz3rr Any feedback on this?
Thanks, seems like this slipped past without me noticing.
I don't do much lua coding these days so I'm not sure if I can judge what would be the best behavior here, but seeing as it's mostly gated behind an optional setting I don't think there really is a wrong choice here. As I understand it you want to lint all the files in the workspace at all times, even when they're not currently open in the editor?
Things that stood out to me at a glance:
await
instead of .then()
?Yes, the main idea behind this PR is to lint all documents in the workspace.
I have pushed changes that address the code style inconsistency and to use async/await as requested. If I missed anything, please let me know (and preferably point out what I missed)
Yes, the following changes https://github.com/Goz3rr/vscode-glualint/pull/17/commits/c30fe13faf154478c72223885548bfd976f33e0f are meant to address already opened documents not being linted on editor open. The workspaceContains
activation event is necessary when the selected tab is not a Lua file on VSCode open.
I am testing on VSCode 1.85 via extension debugging, but this also happens in the live build of the extension. There must've been a change to VSCode that causes this. There may be some trickery with package.json
that would enable the extension to actually see all open documents with vscode.workspace.textDocuments
, but I am not sure. Here's what my proposed fix does:
https://github.com/Goz3rr/vscode-glualint/assets/3299036/79f25f87-7c9f-4624-87f6-7f717a8f97bd
I can move this to a separate PR if desired.
The changes look good, thanks!
This Pull Request adds an option to lint all files within the workspace. There are a few caveats to this however:
glualint.activeLanguages
setting. This should be fine since we target.lua
files and the linter should handle any such file. I have also mentioned this in the description of the new option.all_files
option withstarting_state
with values ofnone
,opened_documents
,all_files
or something. What setting would linting on document/tab switch be handled by?This Pull Request also fixes opened documents not getting linted on editor open, especially when the currently opened document is a non Lua file. This also bypasses
glualint.activeLanguages
due to API limitations.Please let me know if there are any issues or changes necessary.