yomybaby / atom-titanium

[DEPRECATED] Atom package for Titanium Alloy
https://atom.io/packages/titanium-alloy
MIT License
49 stars 11 forks source link

Uncaught TypeError: Cannot read property '2' of null #77

Open miniman42 opened 6 years ago

miniman42 commented 6 years ago

[Enter steps to reproduce:]

  1. in any given views/widget.xml with a corresponding styles/widget.tss begin to type in any elements attribute value within quotes ie start with and add 4 to the id e.g 2 Then hit backspace to make it 3 Then type 4 again and the error is thrown

Atom: 1.25.1 x64 Electron: 1.7.11 OS: Mac OS X 10.13.4 Thrown From: titanium-alloy package 0.14.6

Stack Trace

Uncaught TypeError: Cannot read property '2' of null

At /Users/gb/.atom/packages/titanium-alloy/lib/viewProvider.js:461

TypeError: Cannot read property '2' of null
    at /packages/titanium-alloy/lib/viewProvider.js:461:84
    at TextBuffer.module.exports.TextBuffer.scanInRange (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1097:15)
    at TextBuffer.module.exports.TextBuffer.scan (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1052:25)
    at TextEditor.scan (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:3363:30)
    at tokenTextForSelector (/packages/titanium-alloy/lib/viewProvider.js:461:10)
    at Object.getAttributeValueCompletions (/packages/titanium-alloy/lib/viewProvider.js:267:18)
    at /packages/titanium-alloy/lib/viewProvider.js:54:28
    at Object.getSuggestions (/packages/titanium-alloy/lib/viewProvider.js:55:8)
    at providers.forEach.provider (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:300:58)
    at Array.forEach (native)
    at AutocompleteManager.getSuggestionsFromProviders (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:271:21)
    at AutocompleteManager.findSuggestions (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:263:23)
    at AutocompleteManager.requestNewSuggestions (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:704:18)
    at AutocompleteManager.showOrHideSuggestionListForBufferChanges (/Applications/Atom.app/Contents/Resources/app/node_modules/autocomplete-plus/lib/autocomplete-manager.js:770:18)
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at TextBuffer.module.exports.TextBuffer.emitDidChangeTextEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1748:32)
    at TextBuffer.module.exports.TextBuffer.transact (/Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:975:18)
    at TextEditor.transact (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1839:30)
    at mergeIntersectingSelections (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1386:25)
    at TextEditor.mergeSelections (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:3249:53)
    at TextEditor.mergeIntersectingSelections (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:3223:42)
    at TextEditor.mutateSelectedText (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1385:23)
    at TextEditor.insertText (/Applications/Atom.app/Contents/Resources/app/src/text-editor.js:1349:31)
    at TextEditor.object.(anonymous function) [as insertText] (/Applications/Atom.app/Contents/Resources/app/node_modules/underscore-plus/lib/underscore-plus.js:77:33)
    at TextEditorComponent.didTextInput (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:1654:30)

Commands

  2x -0:31.7.0 core:backspace (input.hidden-input)

Non-Core Packages

atom-beautify 0.32.2 
auto-reveal-active-file 0.3.1 
dash 1.7.1 
expand-region 0.4.0 
git-time-machine 1.5.9 
hyperclick 0.1.5 
language-terraform 0.8.1 
language-velocity 0.1.2 
open-in-sourcetree 0.1.9 
open-on-bitbucket 0.5.0 
project-manager 3.3.5 
ti-create 0.30.0 
titanium-alloy 0.14.6 
jasonkneen commented 6 years ago

Yep, getting this too all the time.

Frk7 commented 5 years ago

I always have this exception when adding a class or id to an XML file. It's really annoying and makes the plugin almost unusable.

Can someone add this fix from haraldsvik to the official plugin release (to make it usable)? A lot of users still prefer this plugin to Appcelerator's one (that has some drawbacks) and I think having a choice between two plugins is a good thing.

yomybaby commented 5 years ago

I’ll check, merge, relase soon. Currently I’m not use atom. Sorry for late.

yomybaby commented 5 years ago

Hello, I just released new version for #78 . I don't have enough time to maintain this package. I recommend to use Apccelerator Titanium Package. please check this.

Thanks for your contribution.