Skip to content

Commit 05e377c

Browse files
authored
feat: Manage Node & Java settings for plugins (#222)
1 parent 1b83f3f commit 05e377c

4 files changed

Lines changed: 77 additions & 2 deletions

File tree

docs/src/content/docs/reference/Settings.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ List of extensions that should not be configured automatically.
9999
- `sumneko.lua`
100100
- `twxs.cmake`
101101
- `ms-dotnettools.vscode-dotnet-runtime`
102+
- `SonarSource.sonarlint-vscode`
102103

103104
---
104105

@@ -144,6 +145,7 @@ List of extensions that should be configured automatically. If both include and
144145
- `sumneko.lua`
145146
- `twxs.cmake`
146147
- `ms-dotnettools.vscode-dotnet-runtime`
148+
- `SonarSource.sonarlint-vscode`
147149

148150
---
149151

docs/src/content/docs/reference/Supported-extensions.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,20 @@ List of extensions that can be automatically configured to use tools from
3737
| [buf](https://marketplace.visualstudio.com/items?itemName=bufbuild.vscode-buf) | `buf.commandLine.path` | |
3838
| [biome](https://marketplace.visualstudio.com/items?itemName=biomejs.biome-vscode) | `biome.lsp.bin` | Not enabled by default. Update `"mise.configureExtensionsAutomaticallyIgnoreList"` to `[]` to enable it. Use it only if you don't install biome with npm. |
3939
| [oxc](https://marketplace.visualstudio.com/items?itemName=oxc.oxc-vscode) | `oxc.path.oxfmt`, `oxc.path.oxlint`, `oxc.path.tsgolint` | Not enabled by default. Update `"mise.configureExtensionsAutomaticallyIgnoreList"` to `[]` to enable it. Use it only if you don't install oxc with npm. Note that `oxfmt` and `npm:tsgolint` are separate tools from `oxlint`. |
40+
| | `oxc.path.node` (if [node](https://mise.jdx.dev/lang/node.html) installed through `mise`) | |
4041
| [bazel](https://marketplace.visualstudio.com/items?itemName=BazelBuild.vscode-bazel) | `bazel.executable`, `bazel.buildifierExecutable` | Does not work with shims |
4142
| [Swift](https://marketplace.visualstudio.com/items?itemName=swiftlang.swift-vscode) | `swift.path` | Does not work with shims |
4243
| [Pkl](https://marketplace.visualstudio.com/items?itemName=Pkl.pkl-vscode) | `pkl.cli.path` | |
44+
| | `pkl.lsp.java.path` (if [java](https://mise.jdx.dev/lang/java.html) installed through `mise`) | |
4345
| [Hadolint](https://marketplace.visualstudio.com/items?itemName=exiasr.hadolint) | `hadolint.hadolintPath` | Does not work with symlinks |
4446
| [ty](https://marketplace.visualstudio.com/items?itemName=astral-sh.ty) | `ty.path` | |
4547
| [Shell-format](https://marketplace.visualstudio.com/items?itemName=foxundermoon.shell-format) | `shellformat.path` | |
4648
| [Lua](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) | `Lua.misc.executablePath` | Does not work with symlinks |
4749
| [CMake](https://marketplace.visualstudio.com/items?itemName=twxs.cmake) | `cmake.cmakePath` | |
4850
| [.NET Runtime](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.vscode-dotnet-runtime) | `dotnetAcquisitionExtension.sharedExistingDotnetPath` | |
4951
| [Tombi TOML](https://marketplace.visualstudio.com/items?itemName=tombi-toml.tombi) | `tombi.path` | Does not work with symlinks |
52+
| [Sonarlint](https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarlint-vscode) | `sonarlint.ls.javaHome` (if [java](https://mise.jdx.dev/lang/java.html) installed through `mise`) | |
53+
| | `sonarlint.pathToNodeExecutable` (if [node](https://mise.jdx.dev/lang/node.html) installed through `mise`) | |
5054

5155
Extensions which have built-in support for `mise`:
5256

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@
225225
"foxundermoon.shell-format",
226226
"sumneko.lua",
227227
"twxs.cmake",
228-
"ms-dotnettools.vscode-dotnet-runtime"
228+
"ms-dotnettools.vscode-dotnet-runtime",
229+
"SonarSource.sonarlint-vscode"
229230
]
230231
},
231232
"markdownDescription": "List of extensions that should not be configured automatically."
@@ -272,7 +273,8 @@
272273
"foxundermoon.shell-format",
273274
"sumneko.lua",
274275
"twxs.cmake",
275-
"ms-dotnettools.vscode-dotnet-runtime"
276+
"ms-dotnettools.vscode-dotnet-runtime",
277+
"SonarSource.sonarlint-vscode"
276278
]
277279
},
278280
"markdownDescription": "List of extensions that should be configured automatically. If both include and ignore lists are set, the ignore list takes precedence. If the include list includes 'all' (default), all supported extensions are considered except those in the ignore list."

src/utils/supportedExtensions.ts

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,73 @@ export const SUPPORTED_EXTENSIONS: Array<ConfigurableExtension> = [
762762
});
763763
},
764764
},
765+
{
766+
toolNames: ["java"],
767+
extensionId: "SonarSource.sonarlint-vscode",
768+
generateConfiguration: async ({ tool }) => {
769+
return {
770+
"sonarlint.ls.javaHome": tool.install_path,
771+
};
772+
},
773+
},
774+
{
775+
toolNames: ["java"],
776+
extensionId: "Pkl.pkl-vscode",
777+
generateConfiguration: async ({
778+
miseService,
779+
tool,
780+
miseConfig,
781+
useShims,
782+
}) => {
783+
return configureSimpleExtension(miseService, {
784+
configKey: "pkl.lsp.java.path",
785+
binName: "java",
786+
useShims,
787+
useSymLinks: false,
788+
tool,
789+
miseConfig,
790+
});
791+
},
792+
},
793+
{
794+
toolNames: ["node"],
795+
extensionId: "oxc.oxc-vscode",
796+
generateConfiguration: async ({
797+
miseService,
798+
tool,
799+
miseConfig,
800+
useShims,
801+
useSymLinks,
802+
}) => {
803+
return configureSimpleExtension(miseService, {
804+
configKey: "oxc.path.node",
805+
binName: "node",
806+
useShims,
807+
useSymLinks,
808+
tool,
809+
miseConfig,
810+
});
811+
},
812+
},
813+
{
814+
toolNames: ["node"],
815+
extensionId: "SonarSource.sonarlint-vscode",
816+
generateConfiguration: async ({
817+
miseService,
818+
tool,
819+
miseConfig,
820+
useShims,
821+
}) => {
822+
return configureSimpleExtension(miseService, {
823+
configKey: "sonarlint.pathToNodeExecutable",
824+
binName: "node",
825+
useShims,
826+
useSymLinks: false,
827+
tool,
828+
miseConfig,
829+
});
830+
},
831+
},
765832
];
766833

767834
function appendSubdirs(basePath: string, subdirs?: string[]): string {

0 commit comments

Comments
 (0)