We currently only launch one set of language clients when starting the extension,
but this has the unfortunate effect of applying the same settings to all workspace
folders. This commit adds support for multiple workspace folders by launching
a server for each folder in the workspace. This allows for having different servers
for different workspace folders, e.g. when there are multiple MLIR projects in
the same workspace.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LG, I'm just not sure how much the optionality/null is getting you here vs extra paths created.
mlir/utils/vscode/src/mlirContext.ts | ||
---|---|---|
44 | Is it inefficient to specify workspace folder rather than null in the singleton case? |
The problem is that a workspace folder isn't actually available in all cases, so to avoid the null checks we'd have to make the extension fail in certain cases (though to be fair, I'm not sure how important those specific cases are).
mlir/utils/vscode/src/mlirContext.ts | ||
---|---|---|
44 | In this case (the one where the comment is pointing) there is no workspace folder, such as when you just open a .mlir file. In the case where we only have one folder in the workspace, passing in the folder shouldn't be inefficient given that it helps gate various things (such as finding the server). Providing the workspace folder when possible also properly handles when the folder itself overrides the extension configuration (e.g. to specify a specific server). |
Is it inefficient to specify workspace folder rather than null in the singleton case?