tidev / pulsar-titanium

Titanium SDK development tools and UI package for the Pulsar text editor
Other
36 stars 12 forks source link

Click to create function not working #663

Closed m1ga closed 1 year ago

m1ga commented 1 year ago
definitionsProvider.js? [sm]:154 Uncaught (in promise) TypeError: Cannot read property 'replace' of undefined
    at Object.callback (definitionsProvider.js? [sm]:154)

when I try to click and create a method from a XML file.

let insertText = atom.config.get('appcelerator-titanium.codeTemplates.jsFunction');
insertText = insertText.replace(/(\${text})/g, text).replace(/\\n/g, '\n');

insertText is null. Not looked any further yet :smile:

m1ga commented 1 year ago

it's so strange. When I log atom.config.get('appcelerator-titanium.codeTemplates'); it only contains:

{
    "tssClass": "\\n\".${text}\": {\\n}\\n",
    "tssId": "\\n\"#${text}\": {\\n}\\n",
    "tssTag": "\\n\"${text}\": {\\n}\\n"
}

the jsFunction is missing :thinking:

ewanharris commented 1 year ago

I think this might be down to something I botched when attempting to release back before Atom got shutdown, I think I changed the name in package.json and that will impact this stuff. Lemme take a look

m1ga commented 1 year ago

My current workaround is to set the regex right away instead of getting it from the config :smile: I think it still worked last week but I think I was still using an old folder back then. I moved some stuff around and noticed it today that it didn't work. But I'm not sure why its working for all TSS parts and just not for the JS one

ewanharris commented 1 year ago

@m1ga I just created #666 that I think should deal with this. I think what's happening is that you set the 3 values you see (they look to be different to the defaults) but I guess not the jsFunction, as those were set and are persisted then they exist, but because jsFunction is now on the titanium namespace then 💥 😞

Given the appcelerator-titanium->titanium swap that I did to try and force getting a release out when the atom registry was being DOS'd, I should have also updated all the config values to lookup against titanium., so uhh here we are I guess 😅