misogi / vscode-ruby-rubocop

Rubocop extension for Visual Studio Code
https://marketplace.visualstudio.com/items/misogi.ruby-rubocop
MIT License
137 stars 68 forks source link

Eliminate `workspace.rootPath` due to its deprecation #140

Closed ahukkanen closed 2 years ago

ahukkanen commented 3 years ago

workspace.rootPath is now deprecated as of: https://github.com/microsoft/vscode/wiki/Adopting-Multi-Root-Workspace-APIs

If your extension is making use of the (now deprecated) workspace.rootPath property to work on the currently opened folder, then you are affected. See the section 'Eliminating workspace.rootPath below'.

This causes the extension not to function properly in multi-root environments. Rubocop will be always run through the system's default Ruby interpreter which is not always desired. Different projects can have different versions of Ruby and different versions of Rubocop.

We should use workspace.getWorkspaceFolder(uri) instead according to: https://github.com/microsoft/vscode/wiki/Adopting-Multi-Root-Workspace-APIs#eliminating-rootpath

martinzamuner commented 3 years ago

@misogi Releasing this would be much appreciated 🙏 .

misogi commented 2 years ago

Thank you!