-
Notifications
You must be signed in to change notification settings - Fork 1
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
Canonical macOS root paths break linting with TypeScript parser #3
Comments
For the first solution, it will need special handling for external drives as they require the I don’t see a way to detect whether a drive is external from the Nova Extensions API. |
Actually, I think I got that one solved: As it turns out, you don’t need to know if a drive is external because the quirk of the Nova path resolving function that got us into this mess can also be leveraged to get us out of it again. Specifically function nixalize (path) {
const normalised = nova.path.normalize(path)
if (!nova.path.isAbsolute(normalised)) return normalised
const parts = nova.path.split(normalised)
if (parts.length <= 2) return normalised
const root = nova.path.normalize('/')
const same = nova.path.split(root).every((el, idx) => parts[idx] === el)
return same
? nova.path.join(...['/'].concat(parts.slice(3)))
: normalised
} As a German, I find this quintessentially Münchhausenesque solution deeply satisfying. Anyway, release coming up ASAP. |
Some parsers (like TypeScript’s) choke and die on Cocoa style qualified paths, i.e. those beginning with “/Volumes/Root Drive Name”. Converting such paths to a format more palatable to *nix sensibilities seems to solve the issue. Closes #3.
I’ve pushed all the fixes to the dev branch. @natesilva would you like (and do you have the opportunity) to test it before I pull the trigger on the release? |
Testing now. |
It works! |
Some parsers (like TypeScript’s) choke and die on Cocoa style qualified paths, i.e. those beginning with “/Volumes/Root Drive Name”. Converting such paths to a format more palatable to *nix sensibilities seems to solve the issue. Closes #3.
Some parsers (like TypeScript’s) choke and die on Cocoa style qualified paths, i.e. those beginning with “/Volumes/Root Drive Name”. Converting such paths to a format more palatable to *nix sensibilities seems to solve the issue. Closes #3.
Some parsers (like TypeScript’s) choke and die on Cocoa style qualified paths, i.e. those beginning with “/Volumes/Root Drive Name”. Converting such paths to a format more palatable to *nix sensibilities seems to solve the issue. Closes #3.
Some parsers (like TypeScript’s) choke and die on Cocoa style qualified paths, i.e. those beginning with “/Volumes/Root Drive Name”. Converting such paths to a format more palatable to *nix sensibilities seems to solve the issue. Closes #3.
Some parsers (like TypeScript’s) choke and die on Cocoa style qualified paths, i.e. those beginning with “/Volumes/Root Drive Name”. Converting such paths to a format more palatable to *nix sensibilities seems to solve the issue. Closes #3.
On Mac systems,
/Volumes/<Drive name (defaults to “Macintosh HD”)>
is the canonical root path returned by all file management Cocoa APIs, and hence by Nova’s APIs. That<Drive name>
path is actually a symbolic link to the UNIX root path/
, a situation which the TypeScript ESLint parser apparently is unable to handle (see #2 passim for notes on this).Tentatively, there seem to be two solutions to this, both of which have stood up to (cursory) testing:
/Volumes/<Drive name>
from all qualified paths.The text was updated successfully, but these errors were encountered: