Skip to content

Commit f6d1cce

Browse files
committed
fix broken path autocomplete
1 parent a0539a1 commit f6d1cce

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

dist/main/atom/autoCompleteProvider.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ exports.provider = {
2222
return Promise.resolve([]);
2323
if (!fs.existsSync(filePath))
2424
return Promise.resolve([]);
25-
var pathMatchers = ['reference.path.quoted.string', 'require.path.quoted.string', 'es6import.path.quoted.string'];
25+
var pathMatchers = ['reference.path.string.quoted', 'require.path.string.quoted', 'es6import.path.string.quoted'];
2626
var lastScope = options.scopeDescriptor.scopes[options.scopeDescriptor.scopes.length - 1];
2727
if (pathMatchers.some(function (p) { return lastScope === p; })) {
28-
return parent.getRelativePathsInProject({ filePath: filePath, prefix: options.prefix, includeExternalModules: lastScope !== 'reference.path.quoted.string' })
28+
return parent.getRelativePathsInProject({ filePath: filePath, prefix: options.prefix, includeExternalModules: lastScope !== 'reference.path.string.quoted' })
2929
.then(function (resp) {
3030
return resp.files.map(function (file) {
3131
var relativePath = file.relativePath;
@@ -36,17 +36,17 @@ exports.provider = {
3636
rightLabelHTML: '<span>' + file.name + '</span>',
3737
type: 'path'
3838
};
39-
if (lastScope == 'reference.path.quoted.string') {
39+
if (lastScope == 'reference.path.string.quoted') {
4040
suggestion.atomTS_IsReference = {
4141
relativePath: relativePath
4242
};
4343
}
44-
if (lastScope == 'require.path.quoted.string') {
44+
if (lastScope == 'require.path.string.quoted') {
4545
suggestion.atomTS_IsImport = {
4646
relativePath: relativePath
4747
};
4848
}
49-
if (lastScope == 'es6import.path.quoted.string') {
49+
if (lastScope == 'es6import.path.string.quoted') {
5050
suggestion.atomTS_IsES6Import = {
5151
relativePath: relativePath
5252
};

lib/main/atom/autoCompleteProvider.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ export var provider: autocompleteplus.Provider = {
9292
if (!fs.existsSync(filePath)) return Promise.resolve([]);
9393

9494
// If we are looking at reference or require path support file system completions
95-
var pathMatchers = ['reference.path.quoted.string', 'require.path.quoted.string', 'es6import.path.quoted.string'];
95+
var pathMatchers = ['reference.path.string.quoted', 'require.path.string.quoted', 'es6import.path.string.quoted'];
9696
var lastScope = options.scopeDescriptor.scopes[options.scopeDescriptor.scopes.length - 1];
9797

9898
// For file path completions
9999
if (pathMatchers.some(p=> lastScope === p)) {
100-
return parent.getRelativePathsInProject({ filePath, prefix: options.prefix, includeExternalModules: lastScope !== 'reference.path.quoted.string' })
100+
return parent.getRelativePathsInProject({ filePath, prefix: options.prefix, includeExternalModules: lastScope !== 'reference.path.string.quoted' })
101101
.then((resp) => {
102102
return resp.files.map(file => {
103103
var relativePath = file.relativePath;
@@ -112,19 +112,19 @@ export var provider: autocompleteplus.Provider = {
112112
type: 'path'
113113
};
114114

115-
if (lastScope == 'reference.path.quoted.string') {
115+
if (lastScope == 'reference.path.string.quoted') {
116116
suggestion.atomTS_IsReference = {
117117
relativePath: relativePath
118118
};
119119
}
120120

121-
if (lastScope == 'require.path.quoted.string') {
121+
if (lastScope == 'require.path.string.quoted') {
122122
suggestion.atomTS_IsImport = {
123123
relativePath: relativePath
124124
};
125125
}
126126

127-
if (lastScope == 'es6import.path.quoted.string') {
127+
if (lastScope == 'es6import.path.string.quoted') {
128128
suggestion.atomTS_IsES6Import = {
129129
relativePath: relativePath
130130
};

0 commit comments

Comments
 (0)