Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local Variables are Accessible in Typescript Across Files. #395

Open
EvWhymark opened this issue Dec 5, 2023 · 3 comments
Open

Local Variables are Accessible in Typescript Across Files. #395

EvWhymark opened this issue Dec 5, 2023 · 3 comments

Comments

@EvWhymark
Copy link
Collaborator

EvWhymark commented Dec 5, 2023

Local variables across files within our editor are listed in our autocompletions and show errors related to the local variable. For example if you had two const x = 5 lines in two different files the linter will say you cant redeclare block scoped variables. See attached screenshots for more examples of the issue.

My idea to fix this issue would be to rework how we populate the typescript VFS. I think to fix this problem we will need it to only read and update the current active tab within the editor instead of all the files in our shareDB doc.

image image image
@EvWhymark EvWhymark changed the title Local Variables are Accessible Across Files. Local Variables are Accessible in Typescript Across Files. Dec 5, 2023
@curran
Copy link
Contributor

curran commented Dec 6, 2023

Whoah interesting catch! That's surprising.

@curran
Copy link
Contributor

curran commented Dec 6, 2023

Curious if there's a specific way to reproduce this.

@EvWhymark
Copy link
Collaborator Author

I was able to consistently get this interaction rather consistently between two typescript/javascript files. Try out opening index.js and try accessing one of the local variables in hexContinousTest1.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants