root workspace path expansion in pathToFlow config is different for LSP vs non-LSP
carlost opened this issue · 1 comments
If the extension is:
-
using LSP:
${workspaceFolder}
is replaced with the root workspace path: https://github.com/flowtype/flow-for-vscode/blob/7a179ec7bcd882be3e9b829333bba2849ff24077/lib/flowLSP/utils/getFlowPath.js#L133 -
NOT using LSP:
${workspaceRoot}
is replaced with the root workspace path:
https://github.com/flowtype/flow-for-vscode/blob/7a179ec7bcd882be3e9b829333bba2849ff24077/lib/flowNonLSP/pkg/flow-base/lib/FlowHelpers.js#L185
I don't see why this should be different based on the use of LSP. If the nuclide packages are to be kept as is, and you don't want to make this change in the LSP code, then we should at least update the documentation.
Let me know if you are open to a PR on this issue.
EDIT: in addition to fixing some grammer, I updated the code references to refer to the last commit in master when i added this issue.
as far as I can tell, despite the variable being called workspaceRoot
internally in the LSP codepath, it's actually the value of VS Code's workspaceFolder
. now that we've removed the non-LSP codepath, I think workspaceFolder
is the better one to keep.
this also matches up with the variables you can use in other parts of VS Code: https://code.visualstudio.com/docs/editor/variables-reference#_why-isnt-workspaceroot-documented