This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Fix some package detections #100
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9619aa6
:bug: Correctly determine the package for "Failed to load/activate" e…
50Wliu 4054914
:bug: :checkered_flag: Fix linked packages detection on Windows
50Wliu effa7b2
nof
50Wliu e16f91c
load --> enable
50Wliu ed1f3d4
Also catch errors on grammar load
50Wliu 7db06a6
Use package name metadata if available
50Wliu 7e5cec3
:art move packageName to the top
50Wliu 07454de
Use a real-path in the spec's fake stack trace
maxbrunsfeld File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,11 +175,11 @@ class NotificationIssue | |
|
||
getPackageName: -> | ||
options = @notification.getOptions() | ||
return unless options.stack? or options.detail? | ||
return unless options.stack? or options.detail? or options.packageName? | ||
|
||
packagePaths = @getPackagePathsByPackageName() | ||
for packageName, packagePath of packagePaths | ||
if packagePath.indexOf('.atom/dev/packages') > -1 or packagePath.indexOf('.atom/packages') > -1 | ||
if packagePath.indexOf(path.join('.atom', 'dev', 'packages')) > -1 or packagePath.indexOf(path.join('.atom', 'packages')) > -1 | ||
packagePaths[packageName] = fs.realpathSync(packagePath) | ||
|
||
getPackageName = (filePath) => | ||
|
@@ -190,6 +190,8 @@ class NotificationIssue | |
return packName unless /^\.\./.test(relativePath) | ||
@getPackageNameFromFilePath(filePath) | ||
|
||
return options.packageName if options.packageName? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like this could be returned at the top of this method? Like line 178? |
||
|
||
if options.detail? and packageName = getPackageName(options.detail) | ||
return packageName | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh man. Cant believe this has been in there so long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this still might be incorrect...@kevinsawicki if someone sets their
ATOM_HOME
to something like/Users/user/ATOM
, then will this check fail? If so, how would I fix that? By readingprocess.env.ATOM_HOME
and then regexing it to capture the last folder path?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gentle bump @kevinsawicki
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal of this line is to check if the package is bundled or not right?
There is
atom.packages.isBundledPackage
andatom.packages.isBundledPackagePath
that might be useful to use instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's actually to check if a package is symlinked or not, and then to get its true path since that's where the error will have been thrown from.
Eg if I have notifications linked to
.atom\packages\notifications
fromC:\Users\user\Documents\Github\notifications
and notifications throws an error, then this piece of code will correctly match the two.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, I'd say maybe just call
fs.realpath
in all cases then if we want to ensure the stack paths match the package paths.