mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-07-14 14:30:29 +03:00
Fix issue where symbol-provider-ctags
used the wrong package root
This commit is contained in:
parent
865153b471
commit
ddfa645122
@ -62,11 +62,11 @@ class CtagsProvider {
|
||||
const {resourcePath} = atom.getLoadSettings();
|
||||
const currentFileWasRequiredFromSnapshot = !fs.isAbsolute(__dirname);
|
||||
const packageRoot = currentFileWasRequiredFromSnapshot
|
||||
? path.join(resourcePath, 'node_modules', 'symbols-view')
|
||||
? path.join(resourcePath, 'node_modules', 'symbol-provider-ctags')
|
||||
: path.resolve(__dirname, '..');
|
||||
|
||||
if (path.extname(resourcePath) === '.asar' && packageRoot.indexOf(resourcePath) === 0) {
|
||||
return path.join(`${resourcePath}.unpacked`, 'node_modules', 'symbols-view');
|
||||
return path.join(`${resourcePath}.unpacked`, 'node_modules', 'symbol-provider-ctags');
|
||||
} else {
|
||||
return packageRoot;
|
||||
}
|
||||
|
@ -52,6 +52,14 @@ describe('CTagsProvider', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('identifies its project root correctly', () => {
|
||||
let root = provider.getPackageRoot();
|
||||
expect(root).toContain("symbol-provider-ctags");
|
||||
expect(
|
||||
fs.existsSync(path.join(root, "vendor", "ctags-darwin"))
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
describe('when tags can be generated for a file', () => {
|
||||
beforeEach(async () => {
|
||||
await atom.workspace.open(directory.resolve('sample.js'));
|
||||
|
Loading…
Reference in New Issue
Block a user