microsoft / live-share

Real-time collaborative development from the comfort of your favorite tools
http://aka.ms/vsls
Creative Commons Attribution 4.0 International
2.27k stars 247 forks source link

Guest opens Clojure file as a notebook (incorrectly) #4765

Open svdo opened 2 years ago

svdo commented 2 years ago

Describe what happened:

I'm one of the maintainers of the Calva extension, which is an extension to support Clojure development in VSCode. Specifically I contributed support for using some of Calva's features over live share. Recently (somewhere in the past couple of weeks) the behaviour all of a sudden changed: when a guest of the live share session opens a Clojure file that the host has not open yet, it is opened as a notebook instead of a normal file. After that, when the host opens the same file it will also see it as a notebook.

Is this an issue in Live Share? The specific combination of Calva and Live Share? Thanks so much your time and efforts!!

What was your system configuration?

Product and Version [VS/VSCode]: 1.71.0 OS Version[macOS/Windows]: macOS Live Share Extension Version: v1.0.5711 Target Platform or Language [e.g. Node.js]: Clojure

Steps to Reproduce / Scenario:

  1. Install the Calva extension
  2. Create or open a Clojure project in VSCode (e.g. https://github.com/svdo/advent-of-code-2019)
  3. Start a live share session
  4. On a different instance of VSCode (I use vscode-insiders for this), that also has Calva installed, join the live share session
  5. The guest of the live share session opens a Clojure file and sees it as a notebook instead of a normal file
  6. The host opens that same file and also sees it as a notebook instead of a normal file

Please attach logs to this issue: test.zip

svdo commented 2 years ago

These are two relevant comments in the Calva issue (https://github.com/BetterThanTomorrow/calva/issues/1850#issuecomment-1239222477):

Downgrading Calva solves it because the earlier Calva version didn't have notebooks, so they couldn't interfere with LiveShare. The thing about the notebook API is that we only have two possibilities to associate them with files: "option" and "default". We're already saying "option" which should mean that you have to manually open the notebook. Somehow LiveShare is not finding any other way of opening ".clj" files and is than using notebooks for them. That's why @PEZ was suggesting the EditorAssociation setting.

and:

Oh and we cant make notebooks "more optional" because the existence of notebooks needs to be hardcoded into the projects.json file. I tried finding a way to register it dynamically so that you can disable it, but the API to do that is only in a proposed state (interestingly it's called "LiveShare" something...).

svdo commented 1 year ago

Just curious: I noticed that this was tagged with a milestone; does that mean that we can expect this will get looked at soon? Thanks!