Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 8092961

Browse files
author
Monte Goulding
authored
Merge pull request #1831 from livecode/bugfix-lcs_extensions
[[ Extensions ]] Various fixes for issues caused by script extensions
2 parents 89097b4 + 3be3877 commit 8092961

2 files changed

Lines changed: 20 additions & 17 deletions

File tree

Toolset/libraries/revidedeveloperextensionlibrary.livecodescript

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ Summary: Returns an array of details of the extensions found in user folders
9595
Returns (array):
9696
{ key: The path to the folder containing the extensions
9797
value (array): The array of details pertaining to the extension
98-
{ key: "id"
98+
{ key: "name"
9999
value: The extension ID
100-
key: "name"
100+
key: "title"
101101
value: The title of the extension
102102
key: "author"
103103
value: The author of the extension
@@ -236,7 +236,7 @@ private function __revIDEDeveloperExtensionFetchFolderDetails pFolder, pFile
236236

237237
# If either we had to generate the new docs data or get it from the file, parse to a docs library array
238238
local tLibraryA
239-
dispatch function "revDocsParseDocTextToLibraryArray" to stack "revDocsParser" with tData, tDetailsA["name"], tDetailsA["author"]
239+
dispatch function "revDocsParseDocTextToLibraryArray" to stack "revDocsParser" with tData, tDetailsA["title"], tDetailsA["author"]
240240
put the result into tLibraryA
241241
put tLibraryA["doc"] into tDetailsA["api"]
242242
put tAPIFolder & slash & "api.lcdoc" into tDetailsA["api_file"]
@@ -431,7 +431,7 @@ on revIDEDeveloperExtensionTest pPath
431431
end if
432432

433433
# AL-2015-07-15: [[ Bug ]] If the details of the extension doesn't include an ID, then the compile failed
434-
if tDetailsA["id"] is empty then
434+
if tDetailsA["name"] is empty then
435435
__revIDEDeveloperExtensionSendError "Could not compile module" && pPath
436436
exit revIDEDeveloperExtensionTest
437437
end if
@@ -497,7 +497,7 @@ on revIDEDeveloperExtensionCreateTestStack pPath, pRectsA, pDetailsA
497497
end revIDEDeveloperExtensionCreateTestStack
498498

499499
on __revIDEDeveloperExtensionDoCreateTestStack pPath, tRectsA, pDetailsA
500-
revIDEExtensionLoad pDetailsA["id"], pPath, pDetailsA["version"]
500+
revIDEExtensionLoad pDetailsA["name"], pPath, pDetailsA["version"]
501501

502502
local tResult
503503
put the result into tResult
@@ -518,16 +518,16 @@ on __revIDEDeveloperExtensionDoCreateTestStack pPath, tRectsA, pDetailsA
518518
set the loc of stack "LiveCode Extension Test Window" to tRectsA["loc"]
519519
end if
520520
set the destroyStack of stack "LiveCode Extension Test Window" to true
521-
set the title of it to pDetailsA["name"]
521+
set the title of it to pDetailsA["title"]
522522
set the script of it to __testStackScript()
523523
go stack "LiveCode Extension Test Window"
524-
revIDECreateObject pDetailsA["id"], the long id of the defaultStack, \
524+
revIDECreateObject pDetailsA["name"], the long id of the defaultStack, \
525525
(the width of the defaultStack / 2) & comma & (the height of the defaultStack / 2)
526526
unlock messages
527527
end if
528528

529529
if there is not a widget 1 of stack "LiveCode Extension Test Window" then
530-
__revIDEDeveloperExtensionSendError "failed to create widget" && pDetailsA["id"]
530+
__revIDEDeveloperExtensionSendError "failed to create widget" && pDetailsA["name"]
531531
__revIDEDeveloperExtensionDoClearTestStack
532532
exit __revIDEDeveloperExtensionDoCreateTestStack
533533
end if
@@ -536,7 +536,7 @@ on __revIDEDeveloperExtensionDoCreateTestStack pPath, tRectsA, pDetailsA
536536
set the rect of widget 1 of stack "LiveCode Extension Test Window" to tRectsA["wrect"]
537537
end if
538538

539-
set the cCurExtension of stack "LiveCode Extension Test Window" to pDetailsA["id"]
539+
set the cCurExtension of stack "LiveCode Extension Test Window" to pDetailsA["name"]
540540
unlock screen
541541
end __revIDEDeveloperExtensionDoCreateTestStack
542542

@@ -572,12 +572,12 @@ on revIDEDeveloperExtensionUninstall pPath
572572
local tDetailsA
573573
put revIDEDeveloperExtension(pPath) into tDetailsA
574574

575-
if tDetailsA["id"] is empty then
575+
if tDetailsA["name"] is empty then
576576
__revIDEDeveloperExtensionSendError "Extension id lost from" && pPath & ": cannot uninstall"
577577
exit revIDEDeveloperExtensionUninstall
578578
end if
579579

580-
revIDEUninstallExtension tDetailsA["id"]
580+
revIDEUninstallExtension tDetailsA["name"]
581581

582582
end revIDEDeveloperExtensionUninstall
583583

@@ -787,11 +787,11 @@ private on __revIDEDeveloperExtensionBuildPackage pFolder, pTargetFolder, @rBuil
787787
end if
788788

789789
local tTargetName
790-
if tDetailsA["id"] is empty then
790+
if tDetailsA["name"] is empty then
791791
__revIDEDeveloperExtensionSendError "no id found in " && tFullpath
792792
return "no id found"
793793
end if
794-
put tDetailsA["id"] into tTargetName
794+
put tDetailsA["name"] into tTargetName
795795

796796
local tTargetVersion
797797
if tDetailsA["version"] is empty then
@@ -1024,7 +1024,7 @@ on revIDEDeveloperExtensionEditDefaultScript pFolder
10241024
put tSupportFolder & "/defaultscript.livecodescript" into tDefaultScript
10251025

10261026
local tExpectedName
1027-
put sExtensionDetailsA[pFolder]["id"] & ".__DefaultScript" into tExpectedName
1027+
put sExtensionDetailsA[pFolder]["name"] & ".__DefaultScript" into tExpectedName
10281028
if there is a file tDefaultScript then
10291029
try
10301030
# If we have a valid stack, open it and edit the script
@@ -1060,5 +1060,5 @@ on revIDEDeveloperExtensionEditDefaultScript pFolder
10601060
end revIDEDeveloperExtensionEditDefaultScript
10611061

10621062
function revIDEDeveloperExtensionFetchDefaultScript pFolder
1063-
return revIDEExtensionFetchDefaultScript(pFolder, sExtensionDetailsA[pFolder]["id"], false)
1063+
return revIDEExtensionFetchDefaultScript(pFolder, sExtensionDetailsA[pFolder]["name"], false)
10641064
end revIDEDeveloperExtensionFetchDefaultScript

Toolset/libraries/revideextensionlibrary.livecodescript

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,8 +1099,11 @@ private command __revIDELCSExtensionLoad pID, pFolder, pVersion, pStatus, pError
10991099
end if
11001100

11011101
# Update name, status, error, and whether the extension comes with the IDE
1102-
__extensionPropertySet tCacheIndex, "name", pID
1103-
__extensionPropertySet tCacheIndex, "type_id", pID & "." & pVersion
1102+
local tId
1103+
put the short name of stack \
1104+
revInternal__LoadedLibraryStackName(item 1 of pSourceFile) into tId
1105+
__extensionPropertySet tCacheIndex, "name", tId
1106+
__extensionPropertySet tCacheIndex, "type_id", tId & "." & pVersion
11041107

11051108
__extensionPropertySet tCacheIndex, "author", pAdditionalInfoA["author"]
11061109
__extensionPropertySet tCacheIndex, "title", pAdditionalInfoA["display name"]

0 commit comments

Comments
 (0)