Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 107 additions & 16 deletions BUGS-TO-REPORT.md

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion WIP.Harness.md
Original file line number Diff line number Diff line change
Expand Up @@ -1824,8 +1824,11 @@ others are Stage 2's probe lanes:
five codes `event_output` reads from the compiler's own output, the other for `&HFD0000`, the
native-exception code. The scenario reads each line's HTML from
`debugConsoleContent.dataNodes` and the colour its class gives, and `g_TraceMode`. About 15 s.
- The tbIDE lanes of BETA 1045, `designers`, `menus`, `datasheet` and `ico-cur`, are described in
[WIP.tbIDE.md](WIP.tbIDE.md#the-beta-1045-surface), with their times. The lanes `references`,
`parent`, `widgets`, `detach`, `help` and `help-offline` are described in their files' headers.

**Timing:** the lanes other than widgets (24 s alone) take about two minutes at the default two at a time
**Timing:** the lanes before BETA 1045's, other than widgets (24 s alone), take about two minutes at the default two at a time
(the env lane is 16 s alone, the help lane 15 to 18 s, of which its cases are about 6 s). Typical lane costs: an add-in build about 10 s, a host IDE
about 9 s, a scenario 2 s; the slowest lanes are arch (56 s: two builds and two switches of
target) and reload (47 s: two builds and two restarts).
Expand Down
13 changes: 13 additions & 0 deletions WIP.Screenshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,19 @@ line the page quotes. Its pictures are under `docs/IDE/Troubleshooting/Images/`.
with `LoadResDataInternal`**, as the install's add-in samples do: `LoadResData` is the VB
package's, which neither an add-in sample nor the Standard DLL template references (TB5079
without it); the class and the project must not share a name (TB5139).
- **`Restart_Without_Addins`** (index.md, *Rebuilding an addin the IDE has loaded*; Wayne
Phillips' procedure, which the owner tried by hand): a composite of the toolbar from the build
target box to the restart button, ringed with "+ Shift" under it, and an arrow to the console's
`[IDE] SHIFT KEY DETECTED: DISABLED LOADING OF ADDINS`. The restart is real: Shift is held in
the page by `Input.dispatchKeyEvent` (since BETA 1045 the page follows Shift by keydown and
keyup, not by the `tbMisc_ShiftKeyState…` commands), the button clicked, and MyAddIn's buttons
not coming back confirm the add-in did not load; a restart without Shift loads it again. The
restart prints `restarting from MEMORY [<project path>]` above the line, so the setup opens
its project in `TbIde` under the tool's folder (`runFolder`, shown as `C:\tbshots\TbIde`,
removed by `endBuilding`): in the lane's work folder the path held the Windows user name. The
console is floated 110 px tall, which holds both lines in either theme: grown by `fitConsole`
it came out 19 px taller in dark than in Light. It is emptied while floated, since docked its
Clear button has no size.
- **Docking is a real drag** (`dockAboveProperties`): the grip at the left of a floating
panel's title bar starts the IDE's own drag on the press (a `dragstart` it makes itself), and
the docked panels take HTML drag events, so the mouse is pressed on the grip and moved with
Expand Down
7 changes: 6 additions & 1 deletion WIP.tbIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,14 @@ the sources do not is measured by an add-in lane, and the lane's tests are the r
|---|---|---|
| `designers` | `test/addin/probes/designers`, `designers-host` | `Register` and the forms of `IconData`, the order of the `Designer` calls, `GetURI`, `SetFileData` and the dirty dot, the toolbox, `Editors.Open` with a designer, `Unregister` |
| `menus` | `test/addin/probes/menus`, `menus-host`, `unsupported` | `Menu.Id` and `MenuEntry.Id`, placing an entry by `RelativeToCommand`, `BeforeShow`, `AddCustom`, `ShowPopup`, the removals, `SelectedItemPath`, `AddFileUI`, the `Addin*` theme colours, `UnsupportedHostAddin` and `Host.CompilerVersion` |
| `datasheet` | `test/addin/probes/datasheet` | the element in a tool window, `Ready()`, the four events and their answers, the controller's methods and what they return to twinBASIC, a failed answer |
| `datasheet` | `test/addin/probes/datasheet` | the element in a tool window, `Ready()`, the four events and their answers, the controller's methods and what they return to twinBASIC, a failed answer, the keys, the colours after a theme change |
| `ico-cur` | the bundled ICO Designer | it refuses a `.cur` file |

A lane test that asserts an IDE defect says so in a comment and asserts only the defect; the
correct behaviour around it is a test of its own. A reproducer's `repro.json` names the defect's
tests only, so that `bug_repro.mjs verify` reports the defect fixed only when it is. Measured on
BETA 1045, one at a time: `designers` about 120 s, `menus` 56 s, `datasheet` 85 s.

Decisions the pages rest on:

- **The datasheet has a page of its own**, `Datasheet.md` (owner: "in full (-ish)"), though it
Expand Down
5 changes: 3 additions & 2 deletions bugs/addcustom-first-menu-dead/repro.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"mode": "lane",
"lane": "addin:menus",
"tests": [
"AddCustom: a menu-bar item after Help; the add-in's first menu call gives one that does not open, and whose Caption and Visible do not change it"
"AddCustom: a menu-bar item after Help; the add-in's first menu call gives one that does not open, and whose Caption and Visible do not change it",
"after a compiler restart the dead ProbeFirst item stays beside the new one, which does not open either"
],
"steps": "1. An add-in whose `OnProjectLoaded` calls `Set m = Host.Menus.AddCustom(\"ProbeFirst\", True)` and `m.AddEntry \"One\"` before any other menu call.\n2. Load it and open a project. **ProbeFirst** is on the menu bar after **Help**.\n3. Click **ProbeFirst**. Nothing opens.\n4. `m.Caption = \"ProbeFirst2\"` leaves the bar item's text as it was; `m.Caption` reads `ProbeFirst2`.\n5. Restart the compiler. The bar now shows **ProbeFirst** twice."
"steps": "1. An add-in whose `OnProjectLoaded` calls `Set m = Host.Menus.AddCustom(\"ProbeFirst\", True)` and `m.AddEntry \"One\"` before any other menu call.\n2. Load it and open a project. **ProbeFirst** is on the menu bar after **Help**.\n3. Click **ProbeFirst**. Nothing opens.\n4. `m.Caption = \"ProbeFirst2\"` leaves the bar item's text as it was; `m.Caption` reads `ProbeFirst2`.\n5. Restart the compiler. The bar now shows **ProbeFirst** twice, and neither opens."
}
Binary file not shown.
13 changes: 13 additions & 0 deletions bugs/collection-binary-nullstring-key/repro.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"mode": "test",
"expect": {
"exit": 7,
"output": [
"^PASS RegressionTests.Control_TextCompare_NullStringKey_IsTheEmptyKey$",
"^PASS RegressionTests.Control_BinaryCompare_LiteralEmptyKey_IsTheEmptyKey$",
"^FAIL RegressionTests.BinaryCompare_NullStringKey_Exists: .*Expected: True Actual: False",
"^FAIL RegressionTests.BinaryCompare_NullStringKey_ItemReadsIt: .*Expected: 1 \\[Long\\] Actual: -5 \\[Long\\]",
"^FAIL RegressionTests.BinaryCompare_NullStringKey_IsInKeys: .*Expected: 1 \\[Long\\] Actual: 0 \\[Long\\]"
]
}
}
75 changes: 75 additions & 0 deletions bugs/collection-binary-nullstring-key/src/Settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"configuration.inherits": "Defaults",
"project.appTitle": "CollectionBinaryNullstringKey",
"project.buildPath": "${SourcePath}\\Build\\${ProjectName}_${Architecture}.${FileExtension}",
"project.buildType": "Standard EXE",
"project.description": "Reproduces: Collection with KeyCompareMode vbBinaryCompare adds an item with a vbNullString key with no key",
"project.exportPathIsV2": true,
"project.id": "{E8F691CA-E218-4E9C-A633-BF9DEBFEEFF0}",
"project.name": "CollectionBinaryNullstringKey",
"project.optionExplicit": true,
"project.references": [
{
"id": "{00020430-0000-0000-C000-000000000046}",
"lcid": 0,
"name": "OLE Automation",
"path32": "C:\\Windows\\SysWOW64\\stdole2.tlb",
"path64": "C:\\Windows\\System32\\stdole2.tlb",
"symbolId": "stdole",
"versionMajor": 2,
"versionMinor": 0
},
{
"id": "{F50B82D0-DCAB-43FE-9631-11959D4A4728}",
"isCompilerPackage": true,
"licence": "MIT",
"name": "[COMPILER PACKAGE] twinBASIC - VB Compatibility Package (Forms)",
"path32": "",
"path64": "",
"publisher": "TWINBASIC-COMPILER",
"symbolId": "VB",
"versionBuild": 0,
"versionMajor": 0,
"versionMinor": 0,
"versionRevision": 31
},
{
"id": "{C192FB39-64CA-4D9B-B477-A5502F48EFCC}",
"isCompilerPackage": true,
"licence": "MIT",
"name": "[COMPILER PACKAGE] twinBASIC - App global class object",
"path32": "",
"path64": "",
"publisher": "TWINBASIC-COMPILER",
"symbolId": "AppGlobalClassProject",
"versionBuild": 0,
"versionMajor": 1,
"versionMinor": 0,
"versionRevision": 0
},
{
"id": "{9847A10D-8987-44B2-8B87-EA77DEF7F1D9}",
"isCompilerPackage": true,
"licence": "MIT",
"name": "[COMPILER PACKAGE] Assert",
"path32": "",
"path64": "",
"publisher": "TWINBASIC-COMPILER",
"symbolId": "Assert",
"versionBuild": 0,
"versionMajor": 0,
"versionMinor": 0,
"versionRevision": 24
}
],
"project.settingsVersion": 1,
"project.startupObject": "Sub Main",
"project.warnings": {
"errors": [],
"hints": [],
"ignored": [],
"info": [],
"warnings": []
},
"runtime.useUnicodeStandardLibrary": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
' Regression tests: a Collection whose KeyCompareMode is vbBinaryCompare keeps an item added
' with a vbNullString key under the key "", as the same Collection does with
' vbTextCompare, and as it does with the key "" written as a literal. On BETA 1045 the item
' is added with no key: Count goes up, but Exists("") is False, Item("") raises 5 and Keys
' has no entry. vbNullString and "" are the same String value (vbNullString = "" is True);
' they differ only in StrPtr, which is 0 for vbNullString.
' tbrun --tests runs each case and prints PASS or FAIL.
[TestFixture]
Module RegressionTests

' A Collection with one item, 1, added under `Key` with the compare mode given.
Private Function OneItem(ByVal Mode As VbCompareMethod, ByVal Key As String) As Collection
Dim c As New Collection
c.KeyCompareMode = Mode
c.Add 1, Key
Return c
End Function

' The item under the key "", or the error number that reading it raises, negated.
Private Function ItemOfEmptyKey(ByVal c As Collection) As Long
On Error Resume Next
ItemOfEmptyKey = c.Item("")
If Err.Number Then ItemOfEmptyKey = -Err.Number
End Function

[TestCase]
Public Sub Control_TextCompare_NullStringKey_IsTheEmptyKey()
Dim c As Collection = OneItem(vbTextCompare, vbNullString)
Assert.Strict.IsTrue c.Exists("")
Assert.Strict.AreEqual 1&, ItemOfEmptyKey(c)
End Sub

[TestCase]
Public Sub Control_BinaryCompare_LiteralEmptyKey_IsTheEmptyKey()
Dim c As Collection = OneItem(vbBinaryCompare, "")
Assert.Strict.IsTrue c.Exists("")
Assert.Strict.AreEqual 1&, ItemOfEmptyKey(c)
End Sub

[TestCase]
Public Sub BinaryCompare_NullStringKey_Exists()
Assert.Strict.IsTrue OneItem(vbBinaryCompare, vbNullString).Exists("")
End Sub

[TestCase]
Public Sub BinaryCompare_NullStringKey_ItemReadsIt()
Assert.Strict.AreEqual 1&, ItemOfEmptyKey(OneItem(vbBinaryCompare, vbNullString))
End Sub

[TestCase]
Public Sub BinaryCompare_NullStringKey_IsInKeys()
Dim k As Variant = OneItem(vbBinaryCompare, vbNullString).Keys
Assert.Strict.AreEqual 1&, CLng(UBound(k) - LBound(k) + 1)
End Sub

End Module
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Module Startup

Public Sub Main()
End Sub

End Module
4 changes: 2 additions & 2 deletions bugs/datasheet-keys-throw/repro.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"mode": "lane",
"lane": "addin:datasheet",
"tests": [
"keys: Up and Down move the current record; PageDown scrolls without moving it"
"keys: Home and End throw; after Up or Down, Right, Left, Tab and Shift+Down throw and move nothing"
],
"steps": "1. A datasheet with a few columns and rows. Click a data cell.\n2. Press Right. Nothing moves; the page reports an uncaught TypeError.\n3. Press Home. Nothing moves; the page reports `page left not yet implemented`.\nControl: Down moves the current record by one."
"steps": "1. A datasheet with a few columns and rows. Click a data cell.\n2. Press Home. Nothing moves; the page reports `page left not yet implemented`. End, Ctrl+Home and Ctrl+End do the same.\n3. Click a data cell, then press Down: the current record moves down one.\n4. Press Right. Nothing moves; the page reports an uncaught `TypeError: Cannot read properties of null (reading 'x')`. Left, Tab and Shift+Down do the same, until the next click.\nControl: Right pressed straight after a click moves the current cell one column right."
}
2 changes: 1 addition & 1 deletion bugs/datasheet-zero-drawn-blank/repro.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"mode": "lane",
"lane": "addin:datasheet",
"tests": [
"what the grid draws: the header, a 0 as nothing, no number formatting, a tick only for true"
"a 0 draws nothing, in an integer column and in a string column"
],
"steps": "1. A datasheet whose `onGetInfo` answers `{\"recordCount\": 2, \"columns\": [{\"name\": \"n\", \"type\": \"integer\"}, {\"name\": \"s\", \"type\": \"string\"}]}`.\n2. Its `onGetRows` answers `[[0, 0], [1, 1]]`.\n3. The first row's two cells are empty; the second row shows `1` and `1`."
}
3 changes: 2 additions & 1 deletion bugs/designer-dirty-dot-stays/repro.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"mode": "lane",
"lane": "addin:designers",
"tests": [
"SetFileData with the saved bytes: the page holds the tab unchanged, but its dot stays"
"SetFileData with the saved bytes: the page holds the tab unchanged, but its dot stays",
"closing a tab the page holds unchanged: no question; OnClosing, OnDeactivated, OnClosed"
],
"steps": "1. A designer that calls `SetFileData` with changed bytes: the tab shows the dot.\n2. The designer calls `SetFileData` with the bytes the file was opened with. The dot stays.\n3. Close the tab. The IDE asks nothing, as for a tab with no changes."
}
2 changes: 1 addition & 1 deletion bugs/menus-removealladdedentries-noop/repro.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"mode": "lane",
"lane": "addin:menus",
"tests": [
"Menus.RemoveAllAddedEntries changes nothing; a compiler restart drops every entry, the add-in adds its own again, and the dead ProbeFirst item stays"
"Menus.RemoveAllAddedEntries changes nothing: the entries and the custom menus stay"
],
"steps": "1. An add-in that adds an entry to `Host.Menus.FileMenu`, one to `Host.Menus.ProjectExplorerFileViewContextMenu`, and a menu with `Host.Menus.AddCustom`.\n2. Call `Host.Menus.RemoveAllAddedEntries`.\n3. Open the **File** menu, and right-click a file in the Project Explorer. Both entries are still there, and so is the custom menu."
}
2 changes: 1 addition & 1 deletion bugs/toolwindow-addin-colours-stale/repro.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"mode": "lane",
"lane": "addin:menus",
"tests": [
"--themeAddin*: a tool window keeps the colours of the theme it was made in; High Contrast Dark has Dark's"
"--themeAddin*: a tool window keeps the values of the theme it was made in"
],
"steps": "1. Under the Dark theme, an add-in makes a tool window whose CSS is `body { background: var(--themeAddinBackColor) }`. The background is `#2b2b2b`.\n2. Choose **Window → Theme → Light**. The tool window's background stays `#2b2b2b`; the IDE's own panels turn light.\n3. Control: a tool window made now has Light's `#FFFFFF`."
}
2 changes: 1 addition & 1 deletion builder/page-baseline.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"src": "docs",
"pages": 1660,
"staticFiles": 1589
"staticFiles": 1593
}
Binary file modified docs/Documentation/Images/confirm-merge.light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/Documentation/Images/confirm-merge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/Documentation/Images/confirm-merge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 8 additions & 4 deletions docs/Reference/Built-In/tbIDE/Datasheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ Three steps make a datasheet, all of them on its **parent** element, not on the

Then set what the controller is to show, such as `setZoom` or `setColumnWidths`, and call `controller.loadData()`. The datasheet then asks for the columns through **onGetInfo**, and for the rows on screen through **onGetRows**. Until the columns have come, it shows nothing.

A parent holds one datasheet. Its colours are the theme's [colours for addins](Themes#colours-for-addins), and follow a change of the IDE's theme. Its text is Tahoma, 12 pixels high at 100 percent.
A parent holds one datasheet. Its colours are the theme's [colours for addins](Themes#colours-for-addins), as its parent has them, and in a designer's tab they follow a change of the IDE's theme. Its text is Tahoma, 12 pixels high at 100 percent.

<!-- test: bug toolwindow-addin-colours-stale, lane addin:datasheet -->
> [!NOTE] BETA 1045
> A datasheet in a [tool window](ToolWindow) keeps the colours of the theme the window was made in, because the window keeps that theme's colours for addins. After a change from Dark to Light it is still drawn in Dark's colours. A tool window made after the change, with an id no window has had, has the new theme's colours.

## Events

Expand Down Expand Up @@ -183,7 +187,7 @@ Before `loadData()`, a method that sets how the grid looks keeps the value for w
| `setColumnIsSorted(index, on)`, `setColumnIsFiltered(index, on)` | Shows or hides the sort mark or the filter mark in the header of a column, by its number from 0. A filter mark also shows *(filtered)* in the bar at the bottom. The datasheet itself neither sorts nor filters: the addin does that in the rows it gives, and calls `refresh()`. |
| `getSelectedRows()` | Returns the selected rows as `"first:last"`, both counted from 0 and both included: `"3:5"` for three rows. With no row selected, it returns the current row as `"r:r"`, and `"-1:-1"` when there is none. |
| `selectAllRows()` | Selects every row. |
| `navigateToRecord(n)` | Makes row *n* the current row, counted from 1, and scrolls to it. A number past either end goes to the first or the last row. |
| `navigateToRecord(n)` | Makes row *n* the current row, counted from 1, and scrolls to it. A fraction is dropped: 12.7 is row 12. A number past either end goes to the first or the last row. |
| `flashMessage(text, ms)` | Shows *text* in the bar at the bottom for *ms* milliseconds, 3,000 by default. An empty text clears it. |
| `getState()` | Returns `"created"`, `"loading"`, `"ready"`, `"refreshing"`, `"error"` or `"disposed"`. |
| `getLastError()` | Returns the reason for the last failure, or an empty string. |
Expand All @@ -192,11 +196,11 @@ Before `loadData()`, a method that sets how the grid looks keeps the value for w

## What the user does

The bar at the bottom moves to the first, previous, next and last row, or to the row whose number is typed into its box, and says how many rows there are. <kbd>Up</kbd> and <kbd>Down</kbd> move the current row, and so does <kbd>Enter</kbd>, down. <kbd>Page Down</kbd> and <kbd>Page Up</kbd> scroll, and leave the current row where it was. The mouse wheel scrolls, with <kbd>Ctrl</kbd> held too: it does not zoom.
The bar at the bottom moves to the first, previous, next and last row, or to the row whose number is typed into its box, and says how many rows there are. <kbd>Up</kbd> and <kbd>Down</kbd> move the current row, and so does <kbd>Enter</kbd>, down. <kbd>Page Down</kbd> and <kbd>Page Up</kbd> scroll, and leave the current row where it was. After a click on a cell, <kbd>Right</kbd>, <kbd>Left</kbd> and <kbd>Tab</kbd> move to the next or previous cell, and <kbd>Shift</kbd>+<kbd>Down</kbd> moves the current row down. The mouse wheel scrolls, with <kbd>Ctrl</kbd> held too: it does not zoom.

<!-- test: bug datasheet-keys-throw, lane addin:datasheet -->
> [!NOTE] BETA 1045
> <kbd>Right</kbd>, <kbd>Left</kbd>, <kbd>Tab</kbd>, <kbd>Home</kbd> and <kbd>End</kbd> move nothing in a datasheet, and each raises an error in the IDE's page. Scroll sideways with the scroll bar.
> <kbd>Home</kbd> and <kbd>End</kbd>, with or without <kbd>Ctrl</kbd>, move nothing in a datasheet, and each raises an error in the IDE's page. Once <kbd>Up</kbd> or <kbd>Down</kbd> has moved the current row, <kbd>Right</kbd>, <kbd>Left</kbd>, <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Down</kbd> do the same, until the next click on a cell. Click a cell first, or scroll sideways with the scroll bar.

No cell can be edited: a double-click, or a key typed on a cell, opens no editor.

Expand Down
Loading