During programming today I noticed that I have 2 instances of the .ino file open. they show also the file location in the tab. I have no idea how it got there or how I can close it.
right-click on tab shows the option (empty)?
Restarting the IDE restores the session with 2 open instances.
Thanks for your report @Xinonix . This is a known bug that is being tracked by the Arduino IDE developers here:
opened 07:21AM - 13 Jun 22 UTC
closed 08:11AM - 22 Jun 22 UTC
conclusion: resolved
topic: code
type: imperfection
criticality: high
### Describe the problem
The Arduino IDE's language server-based "Go to defin… ition" feature reveals the definition of a code component. If that definition is in a file that is not already open in an editor tab, a tab must be added for that file. If the file is already open in a tab then that tab is simply selected and the cursor placed at the start of the definition.
🐛 If the sketch was created in an earlier version of the Arduino IDE, "Go to definition" for a definition within one of the open sketch editor tabs causes the creation of a confusing duplicate tab instead of simply using the existing tab.
### To reproduce
1. Start Arduino IDE 2.0.0-rc6.
1. Select **File > New** from the Arduino IDE menus.
1. Create a sketch that contains a function definition and a call to that function:
```cpp
void setup() {
foo();
}
void loop() {}
void foo() {}
```
1. Save the sketch to any convenient name and location.
1. Select **File > Quit** from the Arduino IDE menus.
1. Start the latest version of the Arduino IDE.
1. Open the sketch you created if it is not already.
1. Select any board with language server support (e.g., Arduino Uno) from the **Tools > Board** menu in the Arduino IDE.
1. Select the editor.
1. Right click on the function call:
```cpp
foo();
```
1. Select "**Go to Definition**" from the context menu.
🐛 A duplicate tab is created.
🐛 The cursor is only moved to the start of the function definition in the newly created tab, and that tab is not selected, so the user is not guided to the function definition in any meaningful way.

### Expected behavior
Duplicate tabs are not created.
### Arduino IDE version
2.0.0-rc7
### Operating system
Windows
### Operating system version
Windows 10
### Additional context
Related:
- https://github.com/arduino/arduino-ide/issues/1044
- https://github.com/arduino/arduino-ide/pull/1024
- https://github.com/arduino/arduino-ide/issues/656
- https://github.com/arduino/arduino-ide/issues/793
---
Originally reported at https://forum.arduino.cc/t/ctrl-click-navigation/1000117/19
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://github.com/arduino/arduino-ide#nightly-builds)
- [X] My report contains all necessary details
One of the developers did some investigation on it today and found it is a problem with the Eclipse Theia IDE framework the Arduino IDE 2.x is built on:
opened 01:38PM - 17 Jun 22 UTC
closed 02:31PM - 22 Jul 22 UTC
shell
quality
### Bug Description:
When opening editors, the opener `options` is used to ge… nerate an [identity key](https://github.com/eclipse-theia/theia/blob/024d8714393cc0d8f821d6350cba71c6df4a63ad/packages/core/src/browser/widget-manager.ts#L258-L260) for the widget. This is clear and works as expected. However, the property order of the opener `options` also matters when trying to [find an already opened widget](https://github.com/eclipse-theia/theia/blob/024d8714393cc0d8f821d6350cba71c6df4a63ad/packages/core/src/browser/widget-manager.ts#L195).
The following code causes unexpected behavior:
```ts
const uri = 'file:///path/to/an/existing/resource.txt';
const options = {
counter: 0,
mode: 'reveal',
preview: false
} as EditorOpenerOptions;
await this.editorManager.open(uri, options);
const sameOptions = {
...options,
preview: options.preview,
mode: options.mode // change the property order
};
await this.editorManager.open(widget.editor.uri, sameOptions);
```
My code is here: https://github.com/eclipse-theia/theia/compare/master...kittaakos:opener-options
Steps to reproduce:
- Open an editor,
- Wait 2 sec
See in action:
https://user-images.githubusercontent.com/1405703/174308827-9fa9c652-caea-44d5-8365-c8f5f36576de.mp4
Do I misuse the APIs? if not, I think Theia should compare keys with deepEqual and try to find the existing widget instead doing `Map.get` by the JSON options.
### Steps to Reproduce:
1.
2.
3.
### Additional Information
- Operating System: macOS 12.3.1
- Theia Version: 462376a7993
There were some previous reports of this issue being triggered by other operations in the Arduino IDE:
opened 05:23AM - 02 Dec 21 UTC
closed 09:33AM - 31 May 22 UTC
conclusion: resolved
topic: code
type: imperfection
criticality: high
## Describe the bug
Arduino sketches may consist of multiple files, which are… shown in the Arduino IDE as tabs. The "**Search**" and "**Sketchbook**" side bar panels allow the selection of the active tab by clicking on its sketch file.
When this selection is done under the following conditions:
- The tab has not been selected since the sketch was opened
- The selection is done via a double-click rather than a single click
🐛 Instead of selecting the tab as expected, a duplicate tab is opened.
## To Reproduce
1. Open a multiple file sketch in the Arduino IDE.
The following sketch is provided for the demonstration: [MultipleFiles.zip](https://github.com/arduino/arduino-ide/files/7639211/MultipleFiles.zip)
1. Open the "**Search**" side bar panel by clicking the magnifying glass icon.
1. Search for the text `hello`
There will be a search result in each of the files of the demo sketch.
1. Double click on a search from either of the tabs other than the one that is currently selected in the editor.
For example, if the "**SomeTab2.ino**" tab is selected, then double-click the search result in the "**MultipleFiles.ino**" or "**SomeTab2.ino**" tabs.
🐛 There are now two tabs for the file associated with the search result you clicked:

## Expected behavior
Clicking a file of a currently open sketch in a sidebar panel always selects its tab.
Each sketch file only ever gets a single tab in the editor.
## Desktop
### Original report
- OS: Windows 10
- Version: 2.0.0-rc1-snapshot.f0d9894
Date: 2021-11-30T16:25:41.414Z
CLI Version: 0.20.1 [abb21449]
### Last checked with
- OS: Windows 10
- Version: 2.0.0-rc3-snapshot-2f9bf86
Date: 2022-02-11T14:52:06.341Z
CLI Version: 0.21.0 [10107d24]
## Additional context
🐛 The equivalent procedure will also produce duplicate tabs when using the "**Sketchbook**" side bar panel.
opened 04:40PM - 01 Feb 22 UTC
closed 09:33AM - 31 May 22 UTC
conclusion: resolved
topic: code
type: imperfection
criticality: high
## Describe the bug
The <kbd>▼</kbd> button on the right side of the editor b… ar lists all the editor tabs of the sketch. The user can select the tab from this menu, which can be useful for navigating sketches with many tabs.
:bug: If a sketch tab which has not previously been opened via the standard tab UI is opened from this menu, a duplicate tab is opened.
## To Reproduce
1. Select **File > New** from the Arduino IDE menus.
1. Click the <kbd>▼</kbd> button on the right side of the editor bar.
1. Select "**New Tab**" from the tab control menu.
1. In the "**Name for new file**" field, type `TabB`.
1. Click the <kbd>OK</kbd> button.
1. Save the sketch as "**TabA**".
1. Close the IDE window that has "**TabA**" open.
(this is necessary because the bug only occurs when a tab has not yet been opened in the current window, and at this point both the tabs have been opened)
1. Open the "**TabA**" sketch in the Arduino IDE.
1. Click the <kbd>▼</kbd> button on the right side of the editor bar.
1. From the menu, select whichever of the two tabs is not currently open in the editor.
:bug: You now have two duplicate tabs for the file that was selected from the menu:

(in this screenshot, I selected "**TabA.ino**" from the menu)
## Expected behavior
Each sketch file only ever gets a single tab in the editor.
## Desktop
### Original report
- OS: Windows 10
- Version: 2.0.0-rc3-snapshot.759b410
Date: 2022-01-31T13:15:29.574Z
CLI Version: 0.20.2 [13783819]
### Last checked with
- OS: Windows 10
- Version: 2.0.0-rc3-snapshot-2f9bf86
Date: 2022-02-11T14:52:06.341Z
CLI Version: 0.21.0 [10107d24]
## Additional context
This is most likely another incarnation of the same bug that causes https://github.com/arduino/arduino-ide/issues/656. I decided to open a separate issue for it since this one is encountered via a significantly different and more common UI path than https://github.com/arduino/arduino-ide/issues/656 and there have been multiple user reports of this general issue.
The duplicate tabs contain the file parent path as reported at https://github.com/arduino/arduino-ide/issues/665
---
The issue is not dependent on the specific sketch creation method from the instructions. It will occur with any multi-tab sketch.
Those issues were fixed in Arduino IDE 2.0.0-rc7, so at least it should be less likely to occur when using the latest version of the Arduino IDE even if not all the possible causes were fixed. If you are using an older version of the Arduino IDE 2.x, I recommend you to update to either 2.0.0-rc7 or even better to the latest nightly build:
https://github.com/arduino/arduino-ide#nightly-builds
This is unrelated. Since they were not relevant to Arduino's specific use case, the items that would normally appear under that context menu were removed by the developers , but they did not remove the context menu itself at that time. Hopefully the useless empty context menu can eventually be removed, but for now please just ignore it.
I am running the latest version, rc-7, so this might be a new one or an unsolved.
The right-click on tab did show (close-right) in this release, earlier and that resulted in closing the last tab. I could not repeat that action...
Is there a known way to close the second occurance of the .ino file?
Yes. Please follow these instructions:
Open the "Command Palette ".
(Ctrl +Shift +P or Command +Shift +P by default)
Run the "View: Reset Workbench Layout " command.
Gives me a
for the last 15 minutes...
Restart solves that one.
Thanks for reporting that. We have been tracking this sort of hang issue here:
opened 09:23PM - 20 Mar 22 UTC
topic: code
type: imperfection
topic: language server
criticality: highest
### Describe the problem
The IDE hangs permanently during the "**Save As...**… " operation under the following conditions:
- IDE was last shut down via "**File > Quit**"
- Currently selected board is from a different platform than the one selected in the previous window
- The language server "**indexing**" process is in progress
### To reproduce
1. Start the Arduino IDE.
1. Select **File > Quit** from the Arduino IDE menus.
❗ This exact shutdown method is required. The bug does not occur after shutting the IDE down via **File > Close** or the native window close control on the title bar (i.e., **X** or **🔴**).
1. Start the Arduino IDE.
1. Select **File > New** from the Arduino IDE menus.
1. Select a board of a different platform from the **Tools > Board** menu in the Arduino IDE.
**ⓘ** e.g., if you originally had "**Arduino Uno**" ("**Arduino AVR Boards**" platform) selected, you could select "**Arduino Nano 33 BLE**" ("**Arduino Mbed OS Nano Boards**" platform).
❗ The issue is timing sensitive, so you will have a short time window if selecting a board from a lightweight platform such as "**Arduino AVR Boards**". The boards of any of the "**Arduino Mbed OS \_\_\_\_ Boards**" platforms are recommended as these provide a large window.
1. Immediately select **File > Save As...** from the Arduino IDE menus.
1. Immediately click the <kbd>**Save**</kbd> button.
❗ This must be done while the IDE is still in the state where it shows something like "**indexing 42/188**" at the left side of the status bar.
🐛 The IDE hangs forever in the state where the window title is "**index.html**" and contains spinning dots:

### Expected behavior
The sketch that was produced by the "**Save As...**" operation is loaded in the Arduino IDE.
### Arduino IDE version
2.0.0-rc5-snapshot-f36df02 Date: 2022-03-17T10:22:00.589Z
### Operating system
Windows
### Operating system version
10
### Additional context
The first version I can reproduce this fault with is https://github.com/arduino/arduino-ide/commit/e6b9d4e2aa0503a0cb99e472051e1e49f487e2c7. I can not reproduce the fault with https://github.com/arduino/arduino-ide/commit/69ac1f4779589d0d21ce3d37c180b3393ad6156c.
The "**Save As...**" process stopped working correctly at https://github.com/arduino/arduino-ide/commit/112153fb965f63d952d126c8244cd3f84f0a1a1b (https://github.com/arduino/arduino-ide/issues/829), so it is possible that the bug was introduced somewhere between https://github.com/arduino/arduino-ide/commit/69ac1f4779589d0d21ce3d37c180b3393ad6156c and https://github.com/arduino/arduino-ide/commit/e6b9d4e2aa0503a0cb99e472051e1e49f487e2c7 but was not visible due to https://github.com/arduino/arduino-ide/issues/829
---
I see the following output printed on the command line after I do a **File > Quit**:
```text
root ERROR Uncaught Exception:
root ERROR Error: Connection got disposed.
at Object.dispose (C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-jsonrpc\lib\main.js:904:25)
at C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-ws-jsonrpc\lib\socket\connection.js:14:41
at CallbackList.invoke (C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-jsonrpc\lib\events.js:62:39)
at Emitter.fire (C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-jsonrpc\lib\events.js:121:36)
at closeHandler (C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-jsonrpc\lib\main.js:240:26)
at CallbackList.invoke (C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-jsonrpc\lib\events.js:62:39)
at Emitter.fire (C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-jsonrpc\lib\events.js:121:36)
at WebSocketMessageReader.fireClose (C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-jsonrpc\lib\messageReader.js:111:27)
at WebSocketMessageReader.fireClose (C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-ws-jsonrpc\lib\socket\reader.js:67:19)
at C:\ide 2\18-arduino-ide_2.0.0-rc5-snapshot-f36df02_Windows_64bit\resources\app\node_modules\vscode-ws-jsonrpc\lib\socket\reader.js:24:18
```
I see the same output printed multiple times after the fault occurs.
---
I suspect it is related to https://github.com/arduino/arduino-ide/issues/657
---
I was only able to reproduce the fault by saving during the language server "indexing" operation triggered by the board selection. The fault did not occur for me when saving during subsequent indexing operation triggered by editing the sketch.
---
I was not able to reproduce the issue with the "**Arduino > Language: Log**" setting enabled.
---
Originally reported at:
- https://forum.arduino.cc/t/saving-files-is-a-crap-shoot/970560/5
- https://forum.arduino.cc/t/freeze-on-save-when-using-save-as/996842
---
Some of the user reports did not match the specific procedure for reproduction I described above, and I have also encountered it occasionally under other conditions.
I believe that the fault can be triggered in other ways, but I wanted to provide a procedure that consistently reproduces the issue and this was the one I happened to discover.
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-ide/issues?q=)
- [X] I verified the problem still occurs when using the latest [nightly build](https://github.com/arduino/arduino-ide#nightly-builds)
- [X] My report contains all necessary details
Unfortunately, none of the team are able to reproduce the issue at the moment, which makes the investigation and development work to fix it extremely difficult. I do not experience this thing when I reproduce the steps you followed to reach it.
If anyone finds a procedure that can be followed to reliably reproduce the issue, please do share detailed instructions here. That would be very valuable in any efforts to fix this.
system
Closed
December 15, 2022, 11:14am
7
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.