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

Extension does not work with untitled files and files opened outside of folders #118

Closed
kidonng opened this issue Aug 10, 2022 · 3 comments

Comments

@kidonng
Copy link

kidonng commented Aug 10, 2022

When writing in Untitled files (i.e. new files not saved to disk), XO prompts an error with every keystroke:

Cannot read properties of undefined (reading 'length')

It would be awesome if the extension can support or at least disable for them.

@kidonng
Copy link
Author

kidonng commented Aug 14, 2022

Actually it's not just untitled files, but also any file opened outside of a folder. The latter seems to be the same as #108, so the extension does support it but it's broken now. Hmm, I was mistaken, it requires a package.json, which is obviously not the usual case.

@kidonng kidonng changed the title Extension does not work with Untitled files Extension does not work with files outside of folders Aug 14, 2022
@kidonng kidonng changed the title Extension does not work with files outside of folders Extension does not work with untitled files and files opened outside of folders Aug 14, 2022
@spence-s
Copy link
Collaborator

spence-s commented Aug 14, 2022

@kidonng regarding untitled/unsaved files, this may not be something we will pursue.

This extension always uses the users xo (and any corresponding configs) to lint things, so untitled files are a grey area there.

The architecture of the extension is changing to attempt to resolve xo up from wherever the file is everytime, so it won't be dependant on being a file in the vscode workspace anymore which I think will be a close solution. It will still require that the users xo can be found upstream from the file. I will leave this issue open until the new architecture is released.

@spence-s
Copy link
Collaborator

This should be resolved with the latest release

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

No branches or pull requests

2 participants