You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open up a new, unsaved file in an active, non-empty repo (it need not be persisted)
Type in const foo = require("../mod")
Start to change foo to {bar}
Atom: 1.32.2 x64 Electron: 2.0.9 OS: Mac OS X 10.13.6 Thrown From: autocomplete-modules package 2.2.5
Stack Trace
Uncaught TypeError: Cannot read property 'substring' of undefined
At /Users/isiahmeadows/.atom/packages/autocomplete-modules/lib/lookups/export/local.js:17
TypeError: Cannot read property 'substring' of undefined
at LocalLookup.getList (/packages/autocomplete-modules/lib/lookups/export/local.js:17:27)
at relevantLookups.reduce (/packages/autocomplete-modules/lib/lookups/index.js:25:16)
at Array.reduce (<anonymous>)
at LookupApi.filterList (/packages/autocomplete-modules/lib/lookups/index.js:23:28)
at CompletionProvider.getSuggestions (/packages/autocomplete-modules/lib/completion-provider.js:64:34)
at n.forEach.t (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:644623)
at Array.forEach (<anonymous>)
at AutocompleteManager.getSuggestionsFromProviders (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:644139)
at AutocompleteManager.findSuggestions (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:643877)
at AutocompleteManager.requestNewSuggestions (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:652407)
at AutocompleteManager.showOrHideSuggestionListForBufferChanges (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:653498)
at Function.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1186984)
at Emitter.emit (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1188425)
at TextBuffer.emitDidChangeTextEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:501342)
at TextBuffer.transact (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:489600)
at TextEditor.transact (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:24215)
at mergeIntersectingSelections (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:16150)
at TextEditor.mergeSelections (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:39529)
at TextEditor.mergeIntersectingSelections (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:39038)
at TextEditor.mutateSelectedText (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:16113)
at TextEditor.insertText (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:15662)
at TextEditor.e.(anonymous function) [as insertText] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:256932)
at TextEditorComponent.didTextInput (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:93579)
Hi. You mentioned it's an unsaved file.
Atom can't infer where the relative path is from the file as it's still in memory and not in an exact location.
What should be considered is a safe way for it to have its exception caught.
I get that. It still should at least tolerate an in-memory file, though.
IMHO, I feel it should just not attempt to resolve non-native modules (or at least non-global modules) if it hasn't been saved yet. fs is okay, but it shouldn't offer completions for ../lib/foo, for example. You could go either way with something like lodash, however.
On Tue., 13 Nov. 2018, 11:11 am Isiah Meadows, ***@***.***> wrote:
I get that. It still should at least tolerate an in-memory file, though.
IMHO, I feel it should just not attempt to resolve non-native modules (or
at least non-global modules) if it hasn't been saved yet. fs is okay, but
it shouldn't offer completions for ../lib/foo, for example. You could go
either way with something like lodash, however.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#125 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKXAhrzuIn2j1LlLC4ZKc_iGglvFOgmiks5uuhqzgaJpZM4YZOfm>
.
[Enter steps to reproduce:]
const foo = require("../mod")
foo
to{bar}
Atom: 1.32.2 x64
Electron: 2.0.9
OS: Mac OS X 10.13.6
Thrown From: autocomplete-modules package 2.2.5
Stack Trace
Uncaught TypeError: Cannot read property 'substring' of undefined
Commands
Non-Core Packages
The text was updated successfully, but these errors were encountered: