Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

add windows core package detection #307

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ notifications:
on_success: never
on_failure: change

env:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar enough with the Atom toolchain to know this, so I'll ask: what's the significance of adding this? Is it necessary to fix this issue?

- ATOM_CHANNEL=nightly

script: 'curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh | sh'

git:
Expand Down
5 changes: 4 additions & 1 deletion lib/snippets.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const SnippetExpansion = require('./snippet-expansion')
const EditorStore = require('./editor-store')
const {getPackageRoot} = require('./helpers')

// Used to guess if the snippets file comes from a core package (bundled with Atom) or not
const IS_CORE_PACKAGE = new RegExp(`${_.escapeRegExp(path.sep)}node_modules${_.escapeRegExp(path.sep)}`);

module.exports = {
activate () {
this.loaded = false
Expand Down Expand Up @@ -218,7 +221,7 @@ module.exports = {
loadPackageSnippets (callback) {
const disabledPackageNames = atom.config.get('core.packagesWithSnippetsDisabled') || []
const packages = atom.packages.getLoadedPackages().sort((pack, _) => {
return /\/node_modules\//.test(pack.path) ? -1 : 1
return IS_CORE_PACKAGE.test(pack.path) ? -1 : 1
})

const snippetsDirPaths = []
Expand Down