This would require scanning through already open projects / workspaces to see if the file is loaded, and attach to that workspace for the duration of the CLI call. Alternately, if that workspace was not already open, should be be opened? Of should that require an explicit call to open? If a workspace gets opened, then scoping becomes problematic; in theory, that workspace would stay open for some time, and if another request comes in at a parent level, that workspace would get overlapped. It might be better to open-and-close workspaces that are only referenced by the CLI?
There are a large number of potential commands available via the LSP. It might be interesting to also expose these over the CLI. For example:
This would require scanning through already open projects / workspaces to see if the file is loaded, and attach to that workspace for the duration of the CLI call. Alternately, if that workspace was not already open, should be be opened? Of should that require an explicit call to open? If a workspace gets opened, then scoping becomes problematic; in theory, that workspace would stay open for some time, and if another request comes in at a parent level, that workspace would get overlapped. It might be better to open-and-close workspaces that are only referenced by the CLI?