Removed duplicated code and use same method to create default workspace key. #8893
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recently, Pylance added its own workspace factory to support other types of workspaces, such as Copilot or Code Block workspaces, which require their own behaviors.
While doing that, we moved all notebook-related code from the existing workspace factory. It seems this introduced a bug where the default workspace still uses notebook-related bits when generating the default workspace key.
Now, we use the same code to generate the default workspace key, rather than having two separate places generating it differently that caused us to miss this one spot.
fixes microsoft/pylance-release#6348