File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
packages/app/src/app/overmind/effects/vscode Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,27 @@ export function initializeSettings() {
4343 )
4444 ) ;
4545 }
46+
47+ try {
48+ // We need to do this to prevent duplicate closing tags in live sessions.
49+ // https://github.com/codesandbox/codesandbox-client/issues/3398
50+ // I haven't found another way to fix this, as the TS extension literally listens
51+ // for edits and checks whether an edit ends with '>'. Then it asks the LSP for the changes
52+ // and applies them 100ms later. There is no check for cursor or anything else.
53+ // This doesn't happen in VSCode Live Share itself, because there they share the LSP between
54+ // multiple users. This way the request is not duplicated among multiple users.
55+ const settings = JSON . parse (
56+ fs . readFileSync ( '/vscode/settings.json' ) . toString ( )
57+ ) ;
58+ settings [ 'javascript.autoClosingTags' ] = false ;
59+ settings [ 'typescript.autoClosingTags' ] = false ;
60+ fs . writeFileSync (
61+ '/vscode/settings.json' ,
62+ JSON . stringify ( settings , null , 2 )
63+ ) ;
64+ } catch ( e ) {
65+ console . warn ( e ) ;
66+ }
4667}
4768
4869export function initializeCodeSandboxTheme ( ) {
You can’t perform that action at this time.
0 commit comments